Class DropClaimConditions<TContract>

Manages claim conditions for NFT Drop contracts

Type Parameters

  • TContract extends PrebuiltNFTDrop | PrebuiltTokenDrop | BaseClaimConditionERC721 | BaseDropERC20

Hierarchy

  • DropClaimConditions

Constructors

Properties

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

Type declaration

    • (...args): Promise<TResult>
    • Set public mint conditions

      Parameters

      • Rest ...args: [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 fullfiled by users to claim NFTs.

      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
      }
      ]);

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

        • Rest ...args: [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">>>

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: [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: [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

    • quantity: string | number
    • Optional addressToCheck: string

    Returns Promise<boolean>

    Remarks

    Check if the drop can currently be claimed.

    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

    • quantity: string | number

      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
    • quantity: BigNumberish
    • Optional options: ClaimOptions

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

    Deprecated

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

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

    Parameters

    • 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