transfer()
Triggers a transfer to the address provided.
Parameters
Name | Type | Required | Description |
---|---|---|---|
to | String | Y | Address of user being sent the transfer |
tokenId | Number | Y | Token ID being transferred |
amount | Number | N | Amount of tokens being transferred, if not included, defaults to 1 |
Response
{
"hash": "string"
}
Example Usage
const to = // an address;
const tokenId = 0;
// ERC721
const transaction = await contract.transfer(to, tokenId);
// ERC1155
const amount = 1;
const transaction = await contract.transfer(to, tokenId, amount);
Possible Errors
Errors in the connect()
function
Feedback
Something not quite right, unclear or can't find what you are looking for? Please let us know at support.moonpay.com and we will get back to you as soon as we can.
Updated 8 months ago