Actually I’m getting an interesting result, the transaction appears to go through but it seems like there may be a bug with the Moralis NodeJS SDK, the transaction response comes back like this
const options = {
type: "erc1155",
receiver: "walletaddress",
contractAddress: process.env.contract_address,
tokenId: 1,
amount: 1,
};
let transaction = await Moralis.transfer(options);
console.log(transaction, 'transaction details');
const receipt = await transaction.wait();
console.log(receipt, 'transaction finished');
The transaction
variable logs out like this:
{
type: 2,
chainId: 1,
nonce: 3,
to: 'asdfasdf' //contractAddress variable is here instead of receiver specified in options
}
It looks like instead of the to
parameter being set to the receiver
it’s being set to the contract address.
When the transaction completes and I get the receipt back the contractAddress
is null
instead of the contract address specified in the options (I verified that the environment variable is sending the correct contract address)
It looks like this:
{
to: 'asdfasdf', //this logs out as contract address again instead of receiver specified in the options
from: 'asdfasdf', // This one is correct
contractAddress: null, // the contractAddress logs out as null
I suspect it has something to do with the chainID, i’m not sure what to set that to for the rinkeby test network?