import { type CheckoutOptionsSalesContractArgs } from '@0xsequence/marketplace'; import type { SelectPaymentSettings } from '../contexts/SelectPaymentModal.js'; /** * Return type for the useERC1155SaleContractCheckout hook. * * @property Function to open the checkout modal `openCheckoutModal` * @property Function to close the checkout modal `closeCheckoutModal` * @property Current payment settings for the modal `selectPaymentSettings` * @property Whether the contract data is still loading `isLoading` * @property Whether there was an error loading the contract data `isError` */ interface UseERC1155SaleContractCheckoutReturnType { openCheckoutModal: () => void; closeCheckoutModal: () => void; selectPaymentSettings?: SelectPaymentSettings; isLoading: boolean; isError: boolean; } type SaleContractSettings = Omit; export declare const getERC1155SaleContractConfig: ({ chain, price, currencyAddress, recipientAddress, collectibles, collectionAddress, ...restProps }: Omit) => SelectPaymentSettings; /** * Hook for enabling ERC-1155 NFT purchases using a standard sale contract. * * This hook simplifies the process of purchasing ERC-1155 tokens by automatically: * - Fetching price information from the sale contract * - Determining payment options (crypto, credit card, etc.) * - Generating the proper transaction data * - Opening and managing the checkout modal * * @see {@link https://docs.sequence.xyz/sdk/web/checkout-sdk/hooks/useERC1155SaleContractCheckout} for more detailed documentation. * * @param {object} params - Configuration options for the ERC-1155 sale contract checkout * @param {number} params.chain - Chain ID where the sale contract is deployed * @param {string} params.contractAddress - Address of the ERC-1155 sale contract * @param {string} params.wallet - Address of the wallet that will receive the NFTs * @param {string} params.collectionAddress - Address of the ERC-1155 token contract * @param {Array<{tokenId: string, quantity: string}>} params.items - Array of token IDs and quantities to purchase * @param {function} [params.onSuccess] - Callback function when the transaction is successful * @param {function} [params.onError] - Callback function when an error occurs * @param {function} [params.onClose] - Callback function when the modal is closed * * @returns Object containing functions to control the checkout modal and state {@link UseERC1155SaleContractCheckoutReturnType} * * @example * ```tsx * import { useERC1155SaleContractCheckout } from "@0xsequence/checkout"; * import { useAccount } from "wagmi"; * * const MyComponent = () => { * const { address: userAddress } = useAccount(); * const { openCheckoutModal } = useERC1155SaleContractCheckout({ * chain: 80001, // chainId of the chain the collectible is on * contractAddress: "0x0327b2f274e04d292e74a06809bcd687c63a4ba4", // address of the contract handling the minting function * wallet: userAddress!, // address of the recipient * collectionAddress: "0x888a322db4b8033bac3ff84412738c096f87f9d0", // address of the collection contract * items: [ * // array of collectibles to purchase * { * tokenId: "0", * quantity: "1", * }, * ], * onSuccess: (txnHash: string) => { * console.log("success!", txnHash); * }, * onError: (error: Error) => { * console.error(error); * }, * }); * * const onClick = () => { * if (!userAddress) { * return; * } * openCheckoutModal(); * }; * * return ; * }; * ``` */ export declare const useERC1155SaleContractCheckout: ({ chain, contractAddress, wallet, collectionAddress, items, ...restArgs }: Omit & SaleContractSettings) => UseERC1155SaleContractCheckoutReturnType; interface UseSaleContractConfigArgs { chainId: number; contractAddress: string; tokenIds: string[]; } interface SaleConfig { tokenId: string; price: string; } interface UseSaleContractConfigData { currencyAddress: string; saleConfigs: SaleConfig[]; } interface UseSaleContractConfigReturn { data?: UseSaleContractConfigData; isLoading: boolean; isError: boolean; } export declare const useSaleContractConfig: ({ chainId, contractAddress, tokenIds }: UseSaleContractConfigArgs) => UseSaleContractConfigReturn; /** * @deprecated use useERC1155SaleContractPaymentModal instead */ export declare const useERC1155SaleContractPaymentModal: ({ chain, contractAddress, wallet, collectionAddress, items, ...restArgs }: Omit & SaleContractSettings) => UseERC1155SaleContractCheckoutReturnType; export {}; //# sourceMappingURL=useERC1155SaleContractCheckout.d.ts.map