Hi everybody how are you? How can I sign contracts with Moralis if I have the private key and the memorandum phrase? where can I get an example of it either with web3 or moralis sdk
You can use ethers.js or web3.js libraries directly to sign transactions with private key or seed phrase.
You can also get the ethers.js library that comes with moralis-v1.
Excuse my boldness, I have not found an example on the internet of how to sign a smart contract erc 721 having the key or the memotechnical phrase I will use moralis, do you not have an address or an example of how to sign it?
Did you look at the links above? You can go through the docs to see how to use ethers.js.
For ethers.js, to create a wallet from a private key or seed phrase.
This link shows how to set up a contract instance so you can interact with it or this one.
thanks if I had seen the ethers one but I donβt have a concrete example.
example:
const sendOptions = { contractAddress: tokenAddress.toString().toLowerCase(), functionName: "createItem", abi: tokenErc721, params: { _req: [user.get("ethAddress"), user.get("ethAddress"), parseFloat(royal) * 1000, user.get("ethAddress"), metadataUrl, 0, contracts.token, '0', '0', '0x0000000000000000000000000000000000000000000000000000000000000000'], }, };
if i execute this function:
const tx: any = await Moralis.executeFunction(sendOptions)
how do i add the mint signing it with the ethers documentation how do i pass it to moralis or to the function i dont understand the process?
you will have to use ethers or web3 directly, not Moralis.executeFunction