import type { AbiParameterToPrimitiveType, Address } from "abitype"; import { type Hex } from "viem"; import type { ThirdwebContract } from "../../../contract/contract.js"; import type { BaseTransactionOptions } from "../../../transaction/types.js"; import type { NFTInput } from "../../../utils/nft/parseNft.js"; import type { Account } from "../../../wallets/interfaces/wallet.js"; /** * Mints a new ERC721 token with the given minter signature * This method is only available on the `TokenERC721` contract. * * @param options - The transaction options. * @example * ```ts * import { mintWithSignature, generateMintSignature } from "thirdweb/extensions/erc721"; * import { sendTransaction } from "thirdweb"; * * const { payload, signature } = await generateMintSignature(...) * * const transaction = mintWithSignature({ * contract, * payload, * signature, * }); * * await sendTransaction({ transaction, account }); * ``` * @extension ERC721 * @returns A promise that resolves to the transaction result. */ export declare function mintWithSignature(options: BaseTransactionOptions<{ payload: PayloadTypeV2; signature: Hex; } | { payload: PayloadType; signature: Hex; }>): import("../../../transaction/prepare-transaction.js").PreparedTransaction; export type GenerateMintSignatureOptions = { account: Account; contract: ThirdwebContract; mintRequest: GeneratePayloadInput; contractType?: T; }; /** * Generates the payload and signature for minting an ERC721 token. * @param options - The options for the minting process. * @example * ```ts * import { mintWithSignature, generateMintSignature } from "thirdweb/extensions/erc721"; * * const { payload, signature } = await generateMintSignature({ * account, * contract, * mintRequest: { * to: "0x...", * metadata: { * name: "My NFT", * description: "This is my NFT", * image: "https://example.com/image.png", * }, * }, * }); * * const transaction = mintWithSignature({ * contract, * payload, * signature, * }); * await sendTransaction({ transaction, account }); * ``` * @extension ERC721 * @returns A promise that resolves to the payload and signature. */ export declare function generateMintSignature(options: GenerateMintSignatureOptions): Promise>; declare function signPayloadV1({ mintRequest, account, contract, uri, currency, uid, price, royaltyRecipient, primarySaleRecipient, startTime, endTime, }: { mintRequest: GeneratePayloadInput; account: Account; contract: ThirdwebContract; uri: string; currency: Address; uid: Hex; price: bigint; royaltyRecipient: Address; primarySaleRecipient: Address; startTime: Date; endTime: Date; }): Promise<{ payload: PayloadType; signature: Hex; }>; declare function signPayloadV2({ mintRequest, account, contract, uri, currency, uid, price, royaltyRecipient, primarySaleRecipient, startTime, endTime, }: { mintRequest: GeneratePayloadInput; account: Account; contract: ThirdwebContract; uri: string; currency: Address; uid: Hex; price: bigint; royaltyRecipient: Address; primarySaleRecipient: Address; startTime: Date; endTime: Date; }): Promise<{ payload: PayloadTypeV2; signature: Hex; }>; type SignPayloadResult = T extends "LoyaltyCard" ? Awaited> : Awaited>; type PayloadType = AbiParameterToPrimitiveType<{ type: "tuple"; name: "payload"; components: typeof MintRequest721; }>; type PayloadTypeV2 = AbiParameterToPrimitiveType<{ type: "tuple"; name: "payload"; components: typeof MintRequest721_V2; }>; type GeneratePayloadInput = { to: string; metadata: NFTInput | string; royaltyRecipient?: Address; royaltyBps?: number; primarySaleRecipient?: Address; price?: string; priceInWei?: bigint; currency?: Address; validityStartTimestamp?: Date; validityEndTimestamp?: Date; uid?: string; }; declare const MintRequest721: readonly [{ readonly name: "to"; readonly type: "address"; }, { readonly name: "royaltyRecipient"; readonly type: "address"; }, { readonly name: "royaltyBps"; readonly type: "uint256"; }, { readonly name: "primarySaleRecipient"; readonly type: "address"; }, { readonly name: "uri"; readonly type: "string"; }, { readonly name: "price"; readonly type: "uint256"; }, { readonly name: "currency"; readonly type: "address"; }, { readonly name: "validityStartTimestamp"; readonly type: "uint128"; }, { readonly name: "validityEndTimestamp"; readonly type: "uint128"; }, { readonly name: "uid"; readonly type: "bytes32"; }]; declare const MintRequest721_V2: readonly [{ readonly name: "to"; readonly type: "address"; }, { readonly name: "royaltyRecipient"; readonly type: "address"; }, { readonly name: "royaltyBps"; readonly type: "uint256"; }, { readonly name: "primarySaleRecipient"; readonly type: "address"; }, { readonly name: "uri"; readonly type: "string"; }, { readonly name: "quantity"; readonly type: "uint256"; }, { readonly name: "pricePerToken"; readonly type: "uint256"; }, { readonly name: "currency"; readonly type: "address"; }, { readonly name: "validityStartTimestamp"; readonly type: "uint128"; }, { readonly name: "validityEndTimestamp"; readonly type: "uint128"; }, { readonly name: "uid"; readonly type: "bytes32"; }]; export {}; //# sourceMappingURL=sigMint.d.ts.map