Class ERC721

Basic representation of an ERC721 compatible contract. If additional functionality is required, this contract can be extended via inheritance

Hierarchy

Constructors

  • Creates a new instance of the object

    Parameters

    • _contract: IContract
    • IPFSGateway: string = 'https://cloudflare-ipfs.com/ipfs/'

    Returns ERC721

Accessors

  • get IPFSGateway(): string
  • Returns string

  • get address(): string
  • Returns the contract address

    Returns string

  • get contract(): Contract
  • Returns the underlying contract interface

    Returns Contract

Methods

  • Change or reaffirm the approved address for an NFT

    Parameters

    • approved: string
    • tokenId: BigNumberish
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

  • Count all NFTs assigned to an owner

    Parameters

    • owner: string

    Returns Promise<BigNumber>

  • Returns the balances for each of the provided accounts

    Parameters

    • owners: string[]

    Returns Promise<{
        balance: BigNumber;
        owner: string;
    }[]>

  • Returns an interface allowing for us with the multicall method of a provider

    Parameters

    • name: string
    • Rest ...params: any[]

    Returns ContractCall

  • Get the approved address for a single NFT

    Parameters

    • tokenId: BigNumberish

    Returns Promise<string>

  • Retrieves all holders and their held tokenIds

    Returns Promise<Map<string, BigNumber[]>>

  • Query if an address is an authorized operator for another address

    Parameters

    • owner: string
    • operator: string

    Returns Promise<boolean>

  • A descriptive name for a collection of NFTs in this contract

    Returns Promise<string>

  • Returns an array of token IDs owned by the specified account

    Parameters

    • owner: string

    Returns Promise<BigNumber[]>

  • Find the owner of an NFT

    Parameters

    • tokenId: BigNumberish

    Returns Promise<string>

  • Protected

    Automatically keeps trying the call unless we get a revert exception

    Type Parameters

    • T

    Parameters

    • func: ((...args) => Promise<T>)
        • (...args): Promise<T>
        • Parameters

          • Rest ...args: any[]

          Returns Promise<T>

    • Rest ...params: any[]

    Returns Promise<T>

  • Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of exchange. The royalty amount is denominated and should be payed in that same unit of exchange.

    Parameters

    • tokenId: BigNumberish
    • salePrice: BigNumberish

    Returns Promise<{
        receiver: string;
        royaltyAmount: BigNumber;
    }>

  • Transfers the ownership of an NFT from one address to another address

    Parameters

    • from: string
    • to: string
    • tokenId: BigNumberish
    • Optional data: string
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

  • Enable or disable approval for a third party ("operator") to manage all of msg.sender's assets

    Parameters

    • operator: string
    • approved: boolean = true
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

  • Returns whether the specified interface is supported by the contract

    Parameters

    • interfaceId: string

    Returns Promise<boolean>

  • An abbreviated name for NFTs in this contract

    Returns Promise<string>

  • 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: BigNumberish

    Returns Promise<BigNumber>

  • Retrieves all existing token IDs

    Returns Promise<BigNumber[]>

  • Return the metadata of the token

    Returns Promise<{
        address: string;
        name: string;
        symbol: string;
        totalSupply: BigNumber;
    }>

  • 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: BigNumberish

    Returns Promise<BigNumber>

  • A distinct Uniform Resource Identifier (URI) for a given asset.

    Parameters

    • tokenId: BigNumberish

    Returns Promise<string>

  • Returns the total amount of tokens stored by the contract.

    Returns Promise<BigNumber>

  • Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE TO CONFIRM THAT _to IS CAPABLE OF RECEIVING NFTS OR ELSE THEY MAY BE PERMANENTLY LOST

    Parameters

    • from: string
    • to: string
    • tokenId: BigNumberish
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>