Claim / Claim Conditions
Functionality available for contracts that implement the
IDropSinglePhase
interface or the
Drop1155
contract.
Enables wallets to claim (mint) NFTs from the contract under specific conditions.
claim
Claim a specified number of tokens to the connected wallet.
const txResult = await contract.erc1155.claim("{{token_id}}", "{{quantity}}");
Configuration
claimTo
The same as claim
, but allows specifying the recipient
address rather than using the connected wallet.
const txResult = await contract.erc1155.claimTo(
"{{wallet_address}}",
"{{token_id}}",
"{{quantity}}",
);
Configuration
canClaim
Check if tokens are currently available for claiming, optionally specifying if a specific wallet address can claim.
const canClaim = await contract.erc1155.claimConditions.canClaim(
"{{token_id}}",
"{{quantity}}",
);
Configuration
getActive
Retrieve the currently active claim phase for a specific token ID, if any.
const activePhase = await contract.erc1155.claimConditions.getActive(
"{{token_id}}",
);
Configuration
getAll
Get all the claim phases configured for a specific token ID.
const claimPhases = await contract.erc1155.claimConditions.getAll(
"{{token_id}}",
);
Configuration
getClaimIneligibilityReasons
Get an array of reasons why a specific wallet address is not eligible to claim tokens, if any.
const reasons =
await contract?.erc1155.claimConditions.getClaimIneligibilityReasons(
"{{token_id}}",
"{{quantity}}",
"{{wallet_address}}",
);
Configuration
getClaimTransaction
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.
const claimTransaction =
await contract.erc1155.claimConditions.getClaimTransaction(
"{{wallet_address}}",
"{{token_id}}",
"{{quantity}}",
);
Configuration
getClaimerProofs
Returns allowlist information and merkle proofs for a given wallet address.
const claimerProofs = await contract.erc1155.claimConditions.getClaimerProofs(
"{{token_id}}",
"{{wallet_address}}",
);
Configuration
set
Overwrite the claim conditions for a specific token ID.
All properties of a phase are optional, with the default being a free, open, unlimited claim, in the native currency, starting immediately.
const txResult = await contract.erc1155.claimConditions.set(
"{{token_id}}", // ID of the token to set the claim conditions for
[
{
metadata: {
name: "Phase 1", // The name of the phase
},
currencyAddress: "0x...", // The address of the currency you want users to pay in
price: 1, // The price of the token in the currency specified above
maxClaimablePerWallet: 1, // The maximum number of tokens a wallet can claim
maxClaimableSupply: 100, // The total number of tokens that can be claimed in this phase
startTime: new Date(), // When the phase starts (i.e. when users can start claiming tokens)
waitInSeconds: 60 * 60 * 24 * 7, // The period of time users must wait between repeat claims
snapshot: [
{
address: "0x...", // The address of the wallet
currencyAddress: "0x...", // Override the currency address this wallet pays in
maxClaimable: 5, // Override the maximum number of tokens this wallet can claim
price: 0.5, // Override the price this wallet pays
},
],
merkleRootHash: "0x...", // The merkle root hash of the snapshot
},
],
false, // Whether to resetClaimEligibilityForAll (i.e. reset state of claims for previous claimers)
);
Configuration
setBatch
Allows you to set
claim conditions for multiple token IDs in a single transaction.
All properties of a phase are optional, with the default being a free, open, unlimited claim, in the native currency, starting immediately.
const txResult = await contract?.erc1155.claimConditions.setBatch([
{
claimConditions: [
{
metadata: {
name: "Phase 1", // The name of the phase
},
currencyAddress: "0x...", // The address of the currency you want users to pay in
price: 1, // The price of the token in the currency specified above
maxClaimablePerWallet: 1, // The maximum number of tokens a wallet can claim
maxClaimableSupply: 100, // The total number of tokens that can be claimed in this phase
startTime: new Date(), // When the phase starts (i.e. when users can start claiming tokens)
waitInSeconds: 60 * 60 * 24 * 7, // The period of time users must wait between repeat claims
snapshot: [
{
address: "0x...", // The address of the wallet
currencyAddress: "0x...", // Override the currency address this wallet pays in
maxClaimable: 5, // Override the maximum number of tokens this wallet can claim
price: 0.5, // Override the price this wallet pays
},
],
merkleRootHash: "0x...", // The merkle root hash of the snapshot
},
],
tokenId: 1,
},
]);
Configuration
update
Update a single claim phase on a specific token ID, by providing the index of the claim phase and the new phase configuration.
The index
is the position of the phase in the list of phases you have made, starting from zero.
e.g. if you have two phases, the first phase has an index of 0
and the second phase has an index of 1
.
All properties of a phase are optional, with the default being a free, open, unlimited claim, in the native currency, starting immediately.
const txResult = await contract?.erc1155.claimConditions.update(
"{{token_id}}", // Token ID to update claim phase for
0, // Index of the claim phase to update
{
metadata: {
name: "Phase 1", // The name of the phase
},
currencyAddress: "0x...", // The address of the currency you want users to pay in
price: 1, // The price of the token in the currency specified above
maxClaimablePerWallet: 1, // The maximum number of tokens a wallet can claim
maxClaimableSupply: 100, // The total number of tokens that can be claimed in this phase
startTime: new Date(), // When the phase starts (i.e. when users can start claiming tokens)
waitInSeconds: 60 * 60 * 24 * 7, // The period of time users must wait between repeat claims
snapshot: [
{
address: "0x...", // The address of the wallet
currencyAddress: "0x...", // Override the currency address this wallet pays in
maxClaimable: 5, // Override the maximum number of tokens this wallet can claim
price: 0.5, // Override the price this wallet pays
},
],
merkleRootHash: "0x...", // The merkle root hash of the snapshot
},
);