Class DropErc1155ClaimConditions<TContract>

Manages claim conditions for Edition Drop contracts

Type Parameters

  • TContract extends PrebuiltEditionDrop | BaseClaimConditionERC1155

Hierarchy

  • DropErc1155ClaimConditions

Constructors

Properties

contractWrapper: ContractWrapper<BaseClaimConditionERC1155 | PrebuiltEditionDrop>
metadata: ContractMetadata<TContract, any>
set: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Set claim conditions on a single NFT

      Parameters

      • Rest ...args: [tokenId: BigNumberish, claimConditionInputs: {
            currencyAddress?: string;
            maxClaimablePerWallet?: string | number;
            maxClaimableSupply?: string | number;
            merkleRootHash?: string | number[];
            metadata?: objectInputType<{
                name: ZodOptional<ZodString>;
            }, ZodUnknown, "strip">;
            price?: string | number;
            snapshot?: null | string[] | {
                address: string;
                currencyAddress?: string;
                maxClaimable?: string | number;
                price?: string | number;
            }[];
            startTime?: number | Date;
            waitInSeconds?: string | number | bigint | BigNumber;
        }[], resetClaimEligibilityForAll: any]

      Returns Promise<TResult>

      Remarks

      Sets the public mint conditions that need to be fulfilled by users to claim a particular NFT in this contract.

      Example

      const presaleStartTime = new Date();
      const publicSaleStartTime = new Date(Date.now() + 60 * 60 * 24 * 1000);

      // Optionally specify addresses that can claim
      const snapshots = ['0x...', '0x...']

      // Or alternatively, you can pass snapshots with the max number of NFTs each address can claim
      // const snapshots = [{ address: '0x...', maxClaimable: 1 }, { address: '0x...', maxClaimable: 2 }]

      const claimConditions = [
      {
      startTime: presaleStartTime, // start the presale now
      maxClaimableSupply: 2, // limit how many mints for this presale
      price: 0.01, // presale price
      snapshot: snapshots, // limit minting to only certain addresses
      },
      {
      startTime: publicSaleStartTime, // 24h after presale, start public sale
      price: 0.08, // public sale price
      }
      ]);

      const tokenId = 0; // the id of the NFT to set claim conditions on
      await dropContract.claimConditions.set(tokenId, claimConditions);
  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [tokenId: BigNumberish, claimConditionInputs: {
              currencyAddress?: string;
              maxClaimablePerWallet?: string | number;
              maxClaimableSupply?: string | number;
              merkleRootHash?: string | number[];
              metadata?: objectInputType<{
                  name: ZodOptional<ZodString>;
              }, ZodUnknown, "strip">;
              price?: string | number;
              snapshot?: null | string[] | {
                  address: string;
                  currencyAddress?: string;
                  maxClaimable?: string | number;
                  price?: string | number;
              }[];
              startTime?: number | Date;
              waitInSeconds?: string | number | bigint | BigNumber;
          }[], resetClaimEligibilityForAll: any]

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

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

Type declaration

    • (...args): Promise<TResult>
    • Set claim conditions on multiple NFTs at once

      Parameters

      Returns Promise<TResult>

      Remarks

      Sets the claim conditions that need to be fulfilled by users to claim the given NFTs in this contract.

      Example

      const claimConditionsForTokens = [
      {
      tokenId: 0,
      claimConditions: [{
      startTime: new Date(), // start the claim phase now
      maxClaimableSupply: 2, // limit how many mints for this tokenId
      price: 0.01, // price for this tokenId
      snapshot: ['0x...', '0x...'], // limit minting to only certain addresses
      }]
      },
      {
      tokenId: 1,
      claimConditions: [{
      startTime: new Date(),
      price: 0.08, // different price for this tokenId
      }]
      },
      ];

      await dropContract.claimConditions.setBatch(claimConditionsForTokens);
  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

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

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

Type declaration

    • (...args): Promise<TResult>
    • Update a single claim condition with new data.

      Parameters

      • Rest ...args: [tokenId: BigNumberish, index: number, claimConditionInput: {
            currencyAddress?: string;
            maxClaimablePerWallet?: string | number;
            maxClaimableSupply?: string | number;
            merkleRootHash?: string | number[];
            metadata?: objectInputType<{
                name: ZodOptional<ZodString>;
            }, ZodUnknown, "strip">;
            price?: string | number;
            snapshot?: null | string[] | {
                address: string;
                currencyAddress?: string;
                maxClaimable?: string | number;
                price?: string | number;
            }[];
            startTime?: number | Date;
            waitInSeconds?: string | number | bigint | BigNumber;
        }]

      Returns Promise<TResult>

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

        • Rest ...args: [tokenId: BigNumberish, index: number, claimConditionInput: {
              currencyAddress?: string;
              maxClaimablePerWallet?: string | number;
              maxClaimableSupply?: string | number;
              merkleRootHash?: string | number[];
              metadata?: objectInputType<{
                  name: ZodOptional<ZodString>;
              }, ZodUnknown, "strip">;
              price?: string | number;
              snapshot?: null | string[] | {
                  address: string;
                  currencyAddress?: string;
                  maxClaimable?: string | number;
                  price?: string | number;
              }[];
              startTime?: number | Date;
              waitInSeconds?: string | number | bigint | BigNumber;
          }]

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

Methods

  • Can Claim

    Parameters

    • tokenId: BigNumberish
    • quantity: BigNumberish
    • Optional addressToCheck: string

    Returns Promise<boolean>

    Remarks

    Check if a particular NFT can currently be claimed by a given user.

    Example

    // Quantity of tokens to check claimability of
    const quantity = 1;
    const canClaim = await contract.canClaim(quantity);
  • Get the currently active claim condition

    Parameters

    Returns Promise<{
        availableSupply: string;
        currencyAddress: string;
        currencyMetadata: { symbol: string; value: BigNumber; name: string; decimals: number; displayValue: string; };
        currentMintSupply: string;
        maxClaimablePerWallet: string;
        maxClaimableSupply: string;
        merkleRootHash: Object;
        metadata?: objectOutputType<{
            name: ZodOptional<ZodString>;
        }, ZodUnknown, "strip">;
        price: BigNumber;
        snapshot?: null | {
            address: string;
            currencyAddress?: string;
            maxClaimable: string;
            price?: string;
        }[];
        startTime: Date;
        waitInSeconds: BigNumber;
    }>

    the claim condition metadata

  • Get all the claim conditions

    Parameters

    Returns Promise<{
        availableSupply: string;
        currencyAddress: string;
        currencyMetadata: { symbol: string; value: BigNumber; name: string; decimals: number; displayValue: string; };
        currentMintSupply: string;
        maxClaimablePerWallet: string;
        maxClaimableSupply: string;
        merkleRootHash: Object;
        metadata?: objectOutputType<{
            name: ZodOptional<ZodString>;
        }, ZodUnknown, "strip">;
        price: BigNumber;
        snapshot?: null | {
            address: string;
            currencyAddress?: string;
            maxClaimable: string;
            price?: string;
        }[];
        startTime: Date;
        waitInSeconds: BigNumber;
    }[]>

    the claim conditions metadata

  • For any claim conditions that a particular wallet is violating, this function returns human-readable information about the breaks in the condition that can be used to inform the user.

    Parameters

    • tokenId: BigNumberish

      the token id to check

    • quantity: BigNumberish

      The desired quantity that would be claimed.

    • Optional addressToCheck: string

      The wallet address, defaults to the connected wallet.

    Returns Promise<ClaimEligibility[]>

  • 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

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

    Deprecated

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

  • Returns allow list information and merkle proofs for the given address.

    Parameters

    • tokenId: BigNumberish

      the token ID to check

    • claimerAddress: string

      the claimer address

    • Optional claimConditionId: BigNumberish

      optional the claim condition id to get the proofs for

    Returns Promise<null | {
        address: string;
        currencyAddress?: string;
        maxClaimable: string;
        price?: string;
        proof: string[];
    }>

Generated using TypeDoc