Class StandardErc1155<T>

Standard ERC1155 NFT functions

Remarks

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

Example

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

Type Parameters

  • T extends DropERC1155 | TokenERC1155 | BaseERC1155 = BaseERC1155 | BaseSignatureMintERC1155

Hierarchy

Implements

  • UpdateableNetwork

Constructors

Properties

_chainId: number
airdrop: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Airdrop multiple NFTs

      Parameters

      • Rest ...args: [tokenId: BigNumberish, addresses: string[] | {
            address: string;
            quantity?: string | number;
        }[], fromAddress?: string, data: BytesLike]

      Returns Promise<TResult>

      Remarks

      Airdrop one or multiple NFTs to the provided wallet addresses.

      Twfeature

      ERC1155

      Example

      // The token ID of the NFT you want to airdrop
      const tokenId = "0";
      // Array of objects of addresses and quantities to airdrop NFTs to
      const addresses = [
      {
      address: "0x...",
      quantity: 2,
      },
      {
      address: "0x...",
      quantity: 3,
      },
      ];
      await contract.airdrop(tokenId, addresses);

      // You can also pass an array of addresses, it will airdrop 1 NFT per address
      const tokenId = "0";
      const addresses = [
      "0x...", "0x...", "0x...",
      ]
      await contract.airdrop(tokenId, addresses);
  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [tokenId: BigNumberish, addresses: string[] | {
              address: string;
              quantity?: string | number;
          }[], fromAddress?: string, data: BytesLike]

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

contractWrapper: ContractWrapper<T>
erc1155: Erc1155<BaseERC1155 | BaseSignatureMintERC1155>
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, amount: BigNumberish, data: BytesLike]

      Returns Promise<TResult>

      Remarks

      Transfer an NFT from the connected wallet to another wallet.

      Example

      // Address of the wallet you want to send the NFT to
      const toAddress = "{{wallet_address}}";
      const tokenId = "0"; // The token ID of the NFT you want to send
      const amount = 3; // How many copies of the NFTs to transfer
      await contract.transfer(toAddress, tokenId, amount);
  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

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

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

Accessors

Methods

  • Get NFT Balance

    Parameters

    • address: string
    • tokenId: BigNumberish

    Returns Promise<BigNumber>

    Remarks

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

    Example

    // Address of the wallet to check NFT balance
    const walletAddress = "{{wallet_address}}";
    const tokenId = 0; // Id of the NFT to check
    const balance = await contract.balanceOf(walletAddress, tokenId);
  • 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