transfer
Description
The transfer function is used to transfer ownership of an ERC721 token from one address to another. This function is defined in an ERC721 contract and can be called by the current token owner.
Parameters
| Name | Type | Description |
|---|---|---|
| from | string | The address of the current token owner. |
| to | string | The address of the new token owner. |
| tokenId | number | The ID of the token to transfer. |
| overrides? | Overrides | Optional overrides for the contract call. |
Example
import { ContractType } from "@openformat/sdk";
const contract = sdk.getContract({
contractAddress: "0x123...",
type: ContractType.NFT,
});
const params = {
from: "0x123..."
to: "0x123..."
tokenId: 5,
};
await contract.transfer(params);