Class Erc1155<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.erc1155.transfer(walletAddress, tokenId, quantity);

Type Parameters

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

Hierarchy

  • Erc1155

Implements

  • UpdateableNetwork
  • DetectableFeature

Constructors

  • Type Parameters

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

    Parameters

    • contractWrapper: ContractWrapper<T>
    • storage: ThirdwebStorage<IpfsUploadBatchOptions>
    • chainId: number

    Returns Erc1155<T>

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.

      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.erc1155.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.erc1155.airdrop(tokenId, addresses);

      Twfeature

      ERC1155BatchTransferable

  • 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">>>

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

Type declaration

    • (...args): Promise<TResult>
    • Burn NFTs

      Parameters

      • Rest ...args: [tokenId: BigNumberish, amount: BigNumberish]

      Returns Promise<TResult>

      Remarks

      Burn the specified NFTs from the connected wallet

      Example

      // The token ID to burn NFTs of
      const tokenId = 0;
      // The amount of the NFT you want to burn
      const amount = 2;

      const result = await contract.erc1155.burn(tokenId, amount);

      Twfeature

      ERC1155Burnable

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [tokenId: BigNumberish, amount: BigNumberish]

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

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

Type declaration

    • (...args): Promise<TResult>
    • Burn a batch of NFTs

      Parameters

      • Rest ...args: [tokenIds: BigNumberish[], amounts: BigNumberish[]]

      Returns Promise<TResult>

      Remarks

      Burn the batch NFTs from the connected wallet

      Example

      // The token IDs to burn NFTs of
      const tokenIds = [0, 1];
      // The amounts of each NFT you want to burn
      const amounts = [2, 2];

      const result = await contract.erc1155.burnBatch(tokenIds, amounts);

      Twfeature

      ERC1155Burnable

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [tokenIds: BigNumberish[], amounts: BigNumberish[]]

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

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

Type declaration

    • (...args): Promise<TResult>
    • Burn a batch of NFTs from a specific wallet

      Parameters

      • Rest ...args: [account: string, tokenIds: BigNumberish[], amounts: BigNumberish[]]

      Returns Promise<TResult>

      Remarks

      Burn the batch NFTs from the specified wallet

      Example

      // The address of the wallet to burn NFTS from
      const account = "0x...";
      // The token IDs to burn NFTs of
      const tokenIds = [0, 1];
      // The amounts of each NFT you want to burn
      const amounts = [2, 2];

      const result = await contract.erc1155.burnBatchFrom(account, tokenIds, amounts);

      Twfeature

      ERC1155Burnable

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [account: string, tokenIds: BigNumberish[], amounts: BigNumberish[]]

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

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

Type declaration

    • (...args): Promise<TResult>
    • Burn NFTs from a specific wallet

      Parameters

      • Rest ...args: [account: string, tokenId: BigNumberish, amount: BigNumberish]

      Returns Promise<TResult>

      Remarks

      Burn the specified NFTs from a specified wallet

      Example

      // The address of the wallet to burn NFTS from
      const account = "0x...";
      // The token ID to burn NFTs of
      const tokenId = 0;
      // The amount of this NFT you want to burn
      const amount = 2;

      const result = await contract.erc1155.burnFrom(account, tokenId, amount);

      Twfeature

      ERC1155Burnable

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [account: string, tokenId: BigNumberish, amount: BigNumberish]

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

burnable: undefined | Erc1155Burnable
claim: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Claim NFTs

      Parameters

      • Rest ...args: [tokenId: BigNumberish, quantity: BigNumberish, options?: ClaimOptions]

      Returns Promise<TResult>

      • Receipt for the transaction

      Remarks

      Let the connected wallet claim NFTs.

      Example

      const tokenId = 0; // the id of the NFT you want to claim
      const quantity = 1; // how many NFTs you want to claim

      const tx = await contract.erc1155.claim(tokenId, quantity);
      const receipt = tx.receipt; // the transaction receipt

      Twfeature

      ERC1155ClaimCustom | ERC1155ClaimPhasesV2 | ERC1155ClaimPhasesV1 | ERC1155ClaimConditionsV2 | ERC1155ClaimConditionsV1

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [tokenId: BigNumberish, quantity: BigNumberish, options?: ClaimOptions]

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

claimCustom: undefined | ERC1155Claimable
claimTo: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Claim NFTs to a specific Wallet

      Parameters

      • Rest ...args: [destinationAddress: string, tokenId: BigNumberish, quantity: BigNumberish, options?: ClaimOptions]

      Returns Promise<TResult>

      • Receipt for the transaction

      Remarks

      Let the specified wallet claim NFTs.

      Example

      const address = "{{wallet_address}}"; // address of the wallet you want to claim the NFTs
      const tokenId = 0; // the id of the NFT you want to claim
      const quantity = 1; // how many NFTs you want to claim

      const tx = await contract.erc1155.claimTo(address, tokenId, quantity);
      const receipt = tx.receipt; // the transaction receipt

      Twfeature

      ERC1155ClaimCustom | ERC1155ClaimPhasesV2 | ERC1155ClaimPhasesV1 | ERC1155ClaimConditionsV2 | ERC1155ClaimConditionsV1

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [destinationAddress: string, tokenId: BigNumberish, quantity: BigNumberish, options?: ClaimOptions]

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

claimWithConditions: undefined | Erc1155ClaimableWithConditions
contractWrapper: ContractWrapper<T>
featureName: "ERC1155" = FEATURE_EDITION.name
lazyMint: {
    prepare: ((...args) => Promise<Transaction<TransactionResultWithId<objectOutputType<{
        animation_url: ZodOptional<ZodNullable<ZodString>>;
        attributes: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
        background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>;
        description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>;
        external_url: ZodOptional<ZodNullable<ZodString>>;
        id: ZodString;
        image: ZodOptional<ZodNullable<ZodString>>;
        name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>>;
        properties: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
        uri: ZodString;
    }, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>[]>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Lazy mint NFTs

      Parameters

      • Rest ...args: [metadatas: (string | objectInputType<{
            animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
                data: ZodUnion<[ZodTypeAny, ZodString]>;
                name: ZodString;
            }, "strip", ZodTypeAny, {
                data?: any;
                name: string;
            }, {
                data?: any;
                name: string;
            }>]>, ZodString]>>>;
            attributes: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
            background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>;
            description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>;
            external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
                data: ZodUnion<[ZodTypeAny, ZodString]>;
                name: ZodString;
            }, "strip", ZodTypeAny, {
                data?: any;
                name: string;
            }, {
                data?: any;
                name: string;
            }>]>, ZodString]>>>;
            image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
                data: ZodUnion<[ZodTypeAny, ZodString]>;
                name: ZodString;
            }, "strip", ZodTypeAny, {
                data?: any;
                name: string;
            }, {
                data?: any;
                name: string;
            }>]>, ZodString]>>>;
            name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>>;
            properties: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
        }, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">)[], options?: {
            onProgress: ((event) => void);
        }]

      Returns Promise<TResult>

      Remarks

      Create batch allows you to create a batch of many NFTs in one transaction.

      Example

      // Custom metadata of the NFTs to create
      const metadatas = [{
      name: "Cool NFT",
      description: "This is a cool NFT",
      image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
      }, {
      name: "Cool NFT",
      description: "This is a cool NFT",
      image: fs.readFileSync("path/to/image.png"),
      }];

      const results = await contract.erc1155.lazyMint(metadatas); // uploads and creates the NFTs on chain
      const firstTokenId = results[0].id; // token id of the first created NFT
      const firstNFT = await results[0].data(); // (optional) fetch details of the first created NFT

      Twfeature

      ERC1155LazyMintableV1 | ERC1155LazyMintableV2

  • prepare: ((...args) => Promise<Transaction<TransactionResultWithId<objectOutputType<{
        animation_url: ZodOptional<ZodNullable<ZodString>>;
        attributes: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
        background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>;
        description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>;
        external_url: ZodOptional<ZodNullable<ZodString>>;
        id: ZodString;
        image: ZodOptional<ZodNullable<ZodString>>;
        name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>>;
        properties: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
        uri: ZodString;
    }, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>[]>>)
      • (...args): Promise<Transaction<TransactionResultWithId<objectOutputType<{
            animation_url: ZodOptional<ZodNullable<ZodString>>;
            attributes: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
            background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>;
            description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>;
            external_url: ZodOptional<ZodNullable<ZodString>>;
            id: ZodString;
            image: ZodOptional<ZodNullable<ZodString>>;
            name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>>;
            properties: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
            uri: ZodString;
        }, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>[]>>
      • Parameters

        • Rest ...args: [metadatas: (string | objectInputType<{
              animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
                  data: ZodUnion<[ZodTypeAny, ZodString]>;
                  name: ZodString;
              }, "strip", ZodTypeAny, {
                  data?: any;
                  name: string;
              }, {
                  data?: any;
                  name: string;
              }>]>, ZodString]>>>;
              attributes: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
              background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>;
              description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>;
              external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
                  data: ZodUnion<[ZodTypeAny, ZodString]>;
                  name: ZodString;
              }, "strip", ZodTypeAny, {
                  data?: any;
                  name: string;
              }, {
                  data?: any;
                  name: string;
              }>]>, ZodString]>>>;
              image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
                  data: ZodUnion<[ZodTypeAny, ZodString]>;
                  name: ZodString;
              }, "strip", ZodTypeAny, {
                  data?: any;
                  name: string;
              }, {
                  data?: any;
                  name: string;
              }>]>, ZodString]>>>;
              name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>>;
              properties: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
          }, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">)[], options?: {
              onProgress: ((event) => void);
          }]

        Returns Promise<Transaction<TransactionResultWithId<objectOutputType<{
            animation_url: ZodOptional<ZodNullable<ZodString>>;
            attributes: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
            background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>;
            description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>;
            external_url: ZodOptional<ZodNullable<ZodString>>;
            id: ZodString;
            image: ZodOptional<ZodNullable<ZodString>>;
            name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>>;
            properties: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
            uri: ZodString;
        }, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>[]>>

lazyMintable: undefined | Erc1155LazyMintable
mint: {
    prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

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

      Parameters

      • Rest ...args: [metadataWithSupply: {
            metadata: Object;
            supply: Object;
        }]

      Returns Promise<TResult>

      Remarks

      Mint an NFT with a limited supply to the connected wallet.

      Example

      // Address of the wallet you want to mint the NFT to
      const toAddress = "{{wallet_address}}"

      // Custom metadata of the NFT, note that you can fully customize this metadata with other properties.
      const metadata = {
      name: "Cool NFT",
      description: "This is a cool NFT",
      image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
      }

      const metadataWithSupply = {
      metadata,
      supply: 1000, // The number of this NFT you want to mint
      }

      const tx = await contract.erc1155.mint(toAddress, metadataWithSupply);
      const receipt = tx.receipt; // the transaction receipt
      const tokenId = tx.id; // the id of the NFT minted
      const nft = await tx.data(); // (optional) fetch details of minted NFT

      Twfeature

      ERC1155Mintable

  • prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>>>)
mintAdditionalSupply: {
    prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Increase the supply of an existing NFT

      Parameters

      • Rest ...args: [tokenId: BigNumberish, additionalSupply: BigNumberish]

      Returns Promise<TResult>

      Remarks

      Increase the supply of an existing NFT and mint it to the connected wallet address

      Example

      const tokenId = 0;
      const additionalSupply = 1000;
      await contract.erc1155.mintAdditionalSupply(tokenId, additionalSupply);

      Twfeature

      ERC1155Mintable

  • prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>>>)
mintAdditionalSupplyTo: {
    prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

mintBatch: {
    prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>[]>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Mint multiple NFTs at once

      Parameters

      • Rest ...args: [metadataWithSupply: {
            metadata: Object;
            supply: Object;
        }[]]

      Returns Promise<TResult>

      Remarks

      Mint multiple different NFTs with limited supplies to the connected wallet.

      Example

      // Custom metadata and supplies of your NFTs
      const metadataWithSupply = [{
      supply: 50, // The number of this NFT you want to mint
      metadata: {
      name: "Cool NFT #1",
      description: "This is a cool NFT",
      image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
      },
      }, {
      supply: 100,
      metadata: {
      name: "Cool NFT #2",
      description: "This is a cool NFT",
      image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
      },
      }];

      const tx = await contract.erc1155.mintBatch(metadataWithSupply);
      const receipt = tx[0].receipt; // same transaction receipt for all minted NFTs
      const firstTokenId = tx[0].id; // token id of the first minted NFT
      const firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT

      Twfeature

      ERC1155BatchMintable

  • prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>[]>>)
mintBatchTo: {
    prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>[]>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Mint multiple NFTs at once to a specific wallet

      Parameters

      • Rest ...args: [receiver: string, metadataWithSupply: {
            metadata: Object;
            supply: Object;
        }[]]

      Returns Promise<TResult>

      Remarks

      Mint multiple different NFTs with limited supplies to a specified wallet.

      Example

      // Address of the wallet you want to mint the NFT to
      const toAddress = "{{wallet_address}}"

      // Custom metadata and supplies of your NFTs
      const metadataWithSupply = [{
      supply: 50, // The number of this NFT you want to mint
      metadata: {
      name: "Cool NFT #1",
      description: "This is a cool NFT",
      image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
      },
      }, {
      supply: 100,
      metadata: {
      name: "Cool NFT #2",
      description: "This is a cool NFT",
      image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
      },
      }];

      const tx = await contract.erc1155.mintBatchTo(toAddress, metadataWithSupply);
      const receipt = tx[0].receipt; // same transaction receipt for all minted NFTs
      const firstTokenId = tx[0].id; // token id of the first minted NFT
      const firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT

      Twfeature

      ERC1155BatchMintable

  • prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>[]>>)
mintTo: {
    prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Mint an NFT to a specific wallet

      Parameters

      • Rest ...args: [receiver: string, metadataWithSupply: {
            metadata: Object;
            supply: Object;
        }]

      Returns Promise<TResult>

      Remarks

      Mint an NFT with a limited supply to a specified wallet.

      Example

      // Address of the wallet you want to mint the NFT to
      const toAddress = "{{wallet_address}}"

      // Custom metadata of the NFT, note that you can fully customize this metadata with other properties.
      const metadata = {
      name: "Cool NFT",
      description: "This is a cool NFT",
      image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
      }

      const metadataWithSupply = {
      metadata,
      supply: 1000, // The number of this NFT you want to mint
      }

      const tx = await contract.erc1155.mintTo(toAddress, metadataWithSupply);
      const receipt = tx.receipt; // the transaction receipt
      const tokenId = tx.id; // the id of the NFT minted
      const nft = await tx.data(); // (optional) fetch details of minted NFT

      Twfeature

      ERC1155Mintable

  • prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>>>)
mintable: undefined | Erc1155Mintable
query: undefined | Erc1155Enumerable
setApprovalForAll: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Set approval for all NFTs

      Parameters

      • Rest ...args: [operator: string, approved: boolean]

      Returns Promise<TResult>

      Remarks

      Approve or remove operator as an operator for the caller. Operators can call transferFrom or safeTransferFrom for any token owned by the caller.

      Example

      const operator = "{{wallet_address}}";
      await contract.erc1155.setApprovalForAll(operator, true);

      Twfeature

      ERC1155

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [operator: string, approved: boolean]

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

signatureMintable: undefined | Erc1155SignatureMintable
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.erc1155.transfer(toAddress, tokenId, amount);

      Twfeature

      ERC1155

  • 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">>>

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

Type declaration

    • (...args): Promise<TResult>
    • Transfer an NFT from a specific wallet

      Parameters

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

      Returns Promise<TResult>

      Remarks

      Transfer an NFT from a specific 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.erc1155.transfer(toAddress, tokenId, amount);

      Twfeature

      ERC1155

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

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

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

Accessors

  • get claimConditions(): DropErc1155ClaimConditions<BaseClaimConditionERC1155>
  • Configure claim conditions

    Returns DropErc1155ClaimConditions<BaseClaimConditionERC1155>

    Remarks

    Define who can claim NFTs in the collection, when and how many.

    Example

    const presaleStartTime = new Date();
    const publicSaleStartTime = new Date(Date.now() + 60 * 60 * 24 * 1000);
    const claimConditions = [
    {
    startTime: presaleStartTime, // start the presale now
    maxClaimableSupply: 2, // limit how many mints for this presale
    price: 0.01, // presale price
    snapshot: ['0x...', '0x...'], // limit minting to only certain addresses
    },
    {
    startTime: publicSaleStartTime, // 24h after presale, start public sale
    price: 0.08, // public sale price
    }
    ]);
    await contract.erc1155.claimConditions.set(tokenId, claimConditions);

    Twfeature

    ERC1155ClaimPhasesV2 | ERC1155ClaimPhasesV1 | ERC1155ClaimConditionsV2 | ERC1155ClaimConditionsV1

  • get revealer(): DelayedReveal<BaseDelayedRevealERC1155>
  • Mint delayed reveal NFTs

    Returns DelayedReveal<BaseDelayedRevealERC1155>

    Remarks

    Create a batch of encrypted NFTs that can be revealed at a later time.

    Example

    // the real NFTs, these will be encrypted until you reveal them
    const realNFTs = [{
    name: "Common NFT #1",
    description: "Common NFT, one of many.",
    image: fs.readFileSync("path/to/image.png"),
    }, {
    name: "Super Rare NFT #2",
    description: "You got a Super Rare NFT!",
    image: fs.readFileSync("path/to/image.png"),
    }];
    // A placeholder NFT that people will get immediately in their wallet, and will be converted to the real NFT at reveal time
    const placeholderNFT = {
    name: "Hidden NFT",
    description: "Will be revealed next week!"
    };
    // Create and encrypt the NFTs
    await contract.erc1155.drop.revealer.createDelayedRevealBatch(
    placeholderNFT,
    realNFTs,
    "my secret password",
    );
    // Whenever you're ready, reveal your NFTs at any time
    const batchId = 0; // the batch to reveal
    await contract.erc1155.revealer.reveal(batchId, "my secret password");

    Twfeature

    ERC1155Revealable

  • get signature(): Erc1155SignatureMintable
  • Mint with signature

    Returns Erc1155SignatureMintable

    Remarks

    Generate dynamic NFTs with your own signature, and let others mint them using that signature.

    Example

    // see how to craft a payload to sign in the `contract.erc1155.signature.generate()` documentation
    const signedPayload = contract.erc1155.signature().generate(payload);

    // now anyone can mint the NFT
    const tx = contract.erc1155.signature.mint(signedPayload);
    const receipt = tx.receipt; // the mint transaction receipt
    const mintedId = tx.id; // the id of the NFT minted

    Twfeature

    ERC1155SignatureMintable

Methods

  • Get NFT balance of a specific wallet

    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.erc1155.balanceOf(walletAddress, tokenId);

    Twfeature

    ERC1155

  • Get a single NFT

    Parameters

    • tokenId: BigNumberish

      the tokenId of the NFT to retrieve

    Returns Promise<NFT>

    The NFT metadata

    Example

    const tokenId = 0;
    const nft = await contract.erc1155.get(tokenId);

    Twfeature

    ERC1155

  • 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.erc1155.getAll();
    

    Twfeature

    ERC1155Enumerable

  • Construct a claim transaction without executing it. This is useful for estimating the gas cost of a claim transaction, overriding transaction options and having fine grained control over the transaction execution.

    Parameters

    • destinationAddress: string

      Address you want to send the token to

    • tokenId: BigNumberish

      Id of the token you want to claim

    • quantity: BigNumberish

      Quantity of the tokens you want to claim

    • Optional options: ClaimOptions

      Optional claim verification data (e.g. price, currency, etc...)

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

    Deprecated

    Use contract.erc1155.claim.prepare(...args) instead

  • Construct a mint transaction without executing it. This is useful for estimating the gas cost of a mint transaction, overriding transaction options and having fine grained control over the transaction execution.

    Parameters

    • receiver: string

      Address you want to send the token to

    • metadataWithSupply: {
          metadata: Object;
          supply: Object;
      }

      The metadata of the NFT you want to mint

      • metadata: Object
      • supply: Object

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

    Deprecated

    Use contract.erc1155.mint.prepare(...args) instead

    Twfeature

    ERC1155Mintable

  • Get all NFTs owned by a specific wallet

    Parameters

    • Optional walletAddress: string
    • Optional queryParams: {
          count?: number;
          start?: number;
      }
      • 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.erc1155.getOwned(address);

    Twfeature

    ERC1155Enumerable

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

  • Get the total supply of a specific NFT

    Parameters

    • tokenId: BigNumberish

    Returns Promise<BigNumber>

    the total number of NFTs minted in this contract

    Remarks

    This is not the sum of supply of all NFTs in the contract.

    Twfeature

    ERC1155Enumerable

  • Get the total number of NFTs minted

    Returns Promise<BigNumber>

    the total number of NFTs minted in this contract

    Remarks

    This returns the total number of NFTs minted in this contract, not the total supply of a given token.

    Example

    const count = await contract.erc1155.totalCount();
    console.log(count);

    Twfeature

    ERC1155Enumerable

  • Get the total supply of a specific token

    Parameters

    • tokenId: BigNumberish

      The token ID to get the total supply of

    Returns Promise<BigNumber>

    the total supply

    Example

    const tokenId = 0;
    const nft = await contract.erc1155.totalSupply(tokenId);

    Twfeature

    ERC1155

Generated using TypeDoc