Interface that represents a smart contract, which implements EIP721

interface IERC721 {
    approve(to: string, tokenId: bigint): Promise<Transaction>;
    balanceOf(owner: string): Promise<bigint>;
    getApproved(tokenId: bigint): Promise<string>;
    isApprovedForAll(owner: string, operator: string): Promise<boolean>;
    name(): Promise<string>;
    ownerOf(tokenId: bigint): Promise<string>;
    safeTransferFrom(from: string, to: string, tokenId: bigint): Promise<Transaction>;
    safeTransferFromData(from: string, to: string, tokenId: bigint, data: string): Promise<Transaction>;
    setApprovalForAll(operator: string, approved: boolean): Promise<Transaction>;
    supportsInterface(interfaceId: string): Promise<boolean>;
    symbol(): Promise<string>;
    tokenURI(tokenId: bigint): Promise<string>;
    transferFrom(from: string, to: string, tokenId: bigint): Promise<Transaction>;
}

Hierarchy (view full)

Methods

  • Gives permission to to to transfer tokenId token to another account. The approval is cleared when the token is transferred.

    Only a single account can be approved at a time, so approving the zero address clears previous approvals.

    Requirements:

    • The caller must own the token or be an approved operator.
    • tokenId must exist.

    Emits an Approval event.

    Parameters

    • to: string
    • tokenId: bigint

    Returns Promise<Transaction>

  • Returns the number of tokens in owner's account.

    Parameters

    • owner: string

    Returns Promise<bigint>

  • Returns the account approved for tokenId token.

    Requirements:

    • tokenId must exist.

    Parameters

    • tokenId: bigint

    Returns Promise<string>

  • Returns if the operator is allowed to manage all of the assets of owner.

    See setApprovalForAll

    Parameters

    • owner: string
    • operator: string

    Returns Promise<boolean>

  • Returns the owner of the tokenId token.

    Requirements:

    • tokenId must exist.

    Parameters

    • tokenId: bigint

    Returns Promise<string>

  • Safely transfers tokenId token from from to to, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked.

    Requirements:

    • from cannot be the zero address.
    • to cannot be the zero address.
    • tokenId token must exist and be owned by from.
    • If the caller is not from, it must be have been allowed to move this token by either approve or setApprovalForAll.
    • If to refers to a smart contract, it must implement IERC721Receiver-onERC721Received, which is called upon a safe transfer.

    Emits a Transfer event.

    Parameters

    • from: string
    • to: string
    • tokenId: bigint

    Returns Promise<Transaction>

  • Safely transfers tokenId token from from to to.

    Requirements:

    • from cannot be the zero address.
    • to cannot be the zero address.
    • tokenId token must exist and be owned by from.
    • If the caller is not from, it must be approved to move this token by either approve or setApprovalForAll.
    • If to refers to a smart contract, it must implement IERC721Receiver-onERC721Received, which is called upon a safe transfer.

    Emits a Transfer event.

    Parameters

    • from: string
    • to: string
    • tokenId: bigint
    • data: string

    Returns Promise<Transaction>

  • Returns the Uniform Resource Identifier (URI) for tokenId token.

    Parameters

    • tokenId: bigint

    Returns Promise<string>

  • Transfers tokenId token from from to to.

    WARNING: Usage of this method is discouraged, use safeTransferFrom whenever possible.

    Requirements:

    • from cannot be the zero address.
    • to cannot be the zero address.
    • tokenId token must be owned by from.
    • If the caller is not from, it must be approved to move this token by either approve or setApprovalForAll.

    Emits a Transfer event.

    Parameters

    • from: string
    • to: string
    • tokenId: bigint

    Returns Promise<Transaction>