Class StandardErc721<T>

Standard ERC721 NFT functions

Remarks

Basic functionality for a ERC721 contract that handles IPFS storage for you.

Example

const contract = await sdk.getContract("{{contract_address}}");
await contract.nft.transfer(walletAddress, tokenId);

Type Parameters

  • T extends SignatureDrop | DropERC721 | TokenERC721 | BaseERC721 = BaseERC721

Hierarchy

Implements

  • UpdateableNetwork

Constructors

Properties

_chainId: number
contractWrapper: ContractWrapper<T>
erc721: Erc721<T>
storage: ThirdwebStorage<IpfsUploadBatchOptions>
transfer: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Transfer an NFT

      Parameters

      • Rest ...args: [to: string, tokenId: BigNumberish]

      Returns Promise<TResult>

      Remarks

      Transfer an NFT from the connected wallet to another wallet.

      Example

      const walletAddress = "{{wallet_address}}";
      const tokenId = 0;
      await contract.transfer(walletAddress, tokenId);
  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [to: string, tokenId: BigNumberish]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

Accessors

Methods

  • Get NFT Balance

    Parameters

    • address: string

    Returns Promise<BigNumber>

    Remarks

    Get a wallets NFT balance (number of NFTs in this contract owned by the wallet).

    Example

    const walletAddress = "{{wallet_address}}";
    const balance = await contract.balanceOf(walletAddress);
    console.log(balance);
  • Get all NFTs

    Parameters

    • Optional queryParams: {
          count?: number;
          start?: number;
      }

      optional filtering to only fetch a subset of results.

      • Optional count?: number
      • Optional start?: number

    Returns Promise<NFT[]>

    The NFT metadata for all NFTs queried.

    Remarks

    Get all the data associated with every NFT in this contract.

    By default, returns the first 100 NFTs, use queryParams to fetch more.

    Example

    const nfts = await contract.getAll();
    console.log(nfts);
  • Get all NFTs owned by a specific wallet

    Parameters

    • Optional walletAddress: string

      the wallet address to query, defaults to the connected wallet

    • Optional queryParams: {
          count?: number;
          start?: number;
      }

      optional filtering to only fetch a subset of results.

      • Optional count?: number
      • Optional start?: number

    Returns Promise<NFT[]>

    The NFT metadata for all NFTs in the contract.

    Remarks

    Get all the data associated with the NFTs owned by a specific wallet.

    Example

    // Address of the wallet to get the NFTs of
    const address = "{{wallet_address}}";
    const nfts = await contract.getOwned(address);
    console.log(nfts);
  • Get Owned Token Ids

    Parameters

    • Optional walletAddress: string

    Returns Promise<BigNumber[]>

    Remarks

    Get all the token ids of NFTs owned by a specific wallet (no metadata)

  • Get whether this wallet has approved transfers from the given operator

    Parameters

    • address: string

      the wallet address

    • operator: string

      the operator address

    Returns Promise<boolean>

Generated using TypeDoc