Interface IERC721Enumerable

Interface that represents a smart contract, which implements EIP721Enumerable

interface IERC721Enumerable {
    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>;
    tokenByIndex(index: bigint): Promise<string>;
    tokenOfOwnerByIndex(owner: string, index: bigint): Promise<string>;
    tokenURI(tokenId: bigint): Promise<string>;
    totalSupply(): Promise<bigint>;
    transferFrom(from: string, to: string, tokenId: bigint): Promise<Transaction>;
}

Hierarchy (view full)

Implemented by

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 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 a token ID at a given index of all the tokens stored by the contract. Use along with totalSupply to enumerate all tokens.

    Parameters

    • index: bigint

    Returns Promise<string>

  • Returns a token ID owned by owner at a given index of its token list. Use along with balanceOf to enumerate all of owner's tokens.

    Parameters

    • owner: string
    • index: 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>