Skip to main content

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

NameTypeDescription
fromstringThe address of the current token owner.
tostringThe address of the new token owner.
tokenIdnumberThe ID of the token to transfer.
overrides?OverridesOptional 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);