import { LazyMintERC1155 as BundleDrop } from "@3rdweb/contracts"; import { TransactionReceipt } from "@ethersproject/providers"; import { BigNumber, BigNumberish, BytesLike } from "ethers"; import { ModuleType, Role } from "../common"; import { NFTMetadata } from "../common/nft"; import { ModuleWithRoles } from "../core/module"; import { MetadataURIOrObject } from "../core/types"; import { ClaimEligibility } from "../enums"; import ClaimConditionFactory from "../factories/ClaimConditionFactory"; import { ITransferable } from "../interfaces/contracts/ITransferable"; import { ClaimCondition } from "../types/claim-conditions/PublicMintCondition"; /** * @beta */ export interface BundleDropCreateClaimCondition { startTimestamp?: BigNumberish; maxClaimableSupply: BigNumberish; quantityLimitPerTransaction?: BigNumberish; waitTimeInSecondsBetweenClaims?: BigNumberish; pricePerToken?: BigNumberish; currency?: string; merkleRoot?: BytesLike; } /** * @beta */ export interface BundleDropMetadata { supply: BigNumber; metadata: NFTMetadata; } /** * Setup a collection of NFTs with a customizable number of each NFT that are minted as users claim them. * * @example * * ```javascript * import { ThirdwebSDK } from "@3rdweb/sdk"; * * // You can switch out this provider with any wallet or provider setup you like. * const provider = ethers.Wallet.createRandom(); * const sdk = new ThirdwebSDK(provider); * const module = sdk.getBundleDropModule("{{module_address}}"); * ``` * * @public */ export declare class BundleDropModule extends ModuleWithRoles implements ITransferable { private _shouldCheckVersion; private _isNewClaim; static moduleType: ModuleType; static roles: readonly ["admin", "minter", "transfer"]; /** * @override * @internal */ protected getModuleRoles(): readonly Role[]; /** * @internal */ protected connectContract(): BundleDrop; /** * @internal */ protected getModuleType(): ModuleType; private transformResultToClaimCondition; private getTokenMetadata; get(tokenId: string): Promise; /** * Get NFT Data * * @remarks Get data associated with NFTs in this module. * * @example * ```javascript * // Get data associated with every NFT in the module * const nfts = await module.getAll(); * console.log(nfts); * ``` * * @returns The NFT metadata for all NFTs in the module. */ getAll(): Promise; /** * `getOwned` is a convenience method for getting all owned tokens * for a particular wallet. * * @param _address - The address to check for token ownership * @returns An array of BundleMetadata objects that are owned by the address */ getOwned(_address?: string): Promise; getActiveClaimCondition(tokenId: BigNumberish): Promise; getAllClaimConditions(tokenId: BigNumberish): Promise; getDefaultSaleRecipient(): Promise; getSaleRecipient(tokenId: BigNumberish): Promise; /** * Get NFT Balance * * @remarks Get a wallets NFT balance (number of a specific NFT in this module owned by the wallet). * * @example * ```javascript * // Address of the wallet to check NFT balance * const address = "{{wallet_address}}"; * // The token ID of the NFT you want to check the wallets balance of * const tokenId = "0" * * const balance = await module.balanceOf(address, tokenId); * console.log(balance); * ``` */ balanceOf(address: string, tokenId: BigNumberish): Promise; balance(tokenId: BigNumberish): Promise; isApproved(address: string, operator: string): Promise; lazyMintBatch(metadatas: MetadataURIOrObject[]): Promise; /** * Create Many NFTs * * @remarks Create and mint NFTs. * * @example * ```javascript * // 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"), // This can be an image url or file * }]; * * await module.createBatch(metadatas); * ``` */ createBatch(metadatas: MetadataURIOrObject[]): Promise; setSaleRecipient(tokenId: BigNumberish, recipient: string): Promise; setDefaultSaleRecipient(recipient: string): Promise; setApproval(operator: string, approved?: boolean): Promise; /** * Transfer NFT * * @remarks Transfer an NFT from the connected wallet to another wallet. * * @example * ```javascript * // Address of the wallet you want to send the NFT to * const toAddress = "0x..."; * * // The token ID of the NFT you want to send * const tokenId = "0"; * * // The number of NFTs you want to send * const amount = 1; * * await module.transfer(toAddress, tokenId, amount); * ``` */ transfer(to: string, tokenId: BigNumberish, amount: BigNumberish, data?: BytesLike): Promise; /** * Sets public claim conditions for the next minting using the * claim condition factory. * * @param factory - The claim condition factory. */ setClaimCondition(tokenId: BigNumberish, factory: ClaimConditionFactory): Promise; updateClaimConditions(tokenId: BigNumberish, factory: ClaimConditionFactory): Promise; /** * Creates a claim condition factory * * @returns - A new claim condition factory */ getClaimConditionFactory(): ClaimConditionFactory; /** * @deprecated - Use the ClaimConditionFactory instead. */ setPublicClaimConditions(tokenId: BigNumberish, conditions: BundleDropCreateClaimCondition[]): Promise; /** * Returns proofs and the overrides required for the transaction. * * @returns - `overrides` and `proofs` as an object. */ private prepareClaim; /** * Claim a token to yourself * * @param tokenId - Id of the token you want to claim * @param quantity - Quantity of the tokens you want to claim * @param proofs - Array of proofs * * @returns - Receipt for the transaction */ claim(tokenId: BigNumberish, quantity: BigNumberish, proofs?: BytesLike[]): Promise; /** * Claim NFTs to Wallet * * @remarks Let the a specified wallet claim NFTs. * * @example * ```javascript * // Address of the wallet you want to claim the NFTs * const address = "{{wallet_address}}"; * * // The number of NFTs to claim * const quantity = 1; * * // The token ID of the NFT you want to claim * const tokenId = "0" * * await module.claimTo(tokenId, quantity, address); * ``` * * @param tokenId - Id of the token you want to claim * @param quantity - Quantity of the tokens you want to claim * @param addressToClaim - Address you want to send the token to * @param proofs - Array of proofs * * @returns - Receipt for the transaction */ claimTo(tokenId: BigNumberish, quantity: BigNumberish, addressToClaim: string, proofs?: BytesLike[]): Promise; burn(tokenId: BigNumberish, amount: BigNumberish): Promise; transferFrom(from: string, to: string, tokenId: BigNumberish, amount: BigNumberish, data?: BytesLike): Promise; setModuleMetadata(metadata: MetadataURIOrObject): Promise; setRoyaltyBps(amount: number): Promise; /** * Gets the royalty BPS (basis points) of the contract * * @returns - The royalty BPS */ getRoyaltyBps(): Promise; /** * Gets the address of the royalty recipient * * @returns - The royalty BPS */ getRoyaltyRecipientAddress(): Promise; getClaimConditionsFactory(): ClaimConditionFactory; /** * Returns the total supply of a specific token * * @param tokenId - The token ID to get the total supply of */ totalSupply(tokenId: BigNumberish): Promise; /** * Pulls the list of all addresses that have claimed a particular token * * @beta - This can be very slow for large numbers of token holders * * @param tokenId - The token id to get the claimers of * @returns - A unique list of addresses that claimed the token */ getAllClaimerAddresses(tokenId: BigNumberish): Promise; /** * 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. * * @param tokenId - The token id that would be claimed. * @param quantity - The desired quantity that would be claimed. * @param addressToCheck - The address that would be claiming the token. */ getClaimIneligibilityReasons(tokenId: BigNumberish, quantity: BigNumberish, addressToCheck?: string): Promise; canClaim(tokenId: BigNumberish, quantity: BigNumberish, addressToCheck?: string): Promise; /** * Fetches the proof for the current signer for a particular wallet. * * @param merkleRoot - The merkle root of the condition to check. * @returns - The proof for the current signer for the specified condition. */ private getClaimerProofs; isTransferRestricted(): Promise; setRestrictedTransfer(restricted?: boolean): Promise; /** * @internal */ private isNewClaim; /** * @internal */ private checkVersion; }