import { UseQueryOptions } from '@tanstack/react-query'; import { ReactNode } from 'react'; import { Address, Hex, TransactionReceipt } from 'viem'; import { ContractType, GetMintDetailsParams, GetTokenDetailsParams, NFTError, NFTPrice } from '../api/types'; import { LifecycleStatusUpdate } from '../internal/types'; import { Call } from '../transaction/types'; export declare const MediaType: { readonly Image: "image"; readonly Video: "video"; readonly Audio: "audio"; readonly Unknown: "unknown"; }; export type MediaType = (typeof MediaType)[keyof typeof MediaType]; /** * Lifecycle Provider */ export declare const Lifecycle: { readonly VIEW: "view"; readonly MINT: "mint"; }; export type LifecycleType = (typeof Lifecycle)[keyof typeof Lifecycle]; export type NFTLifecycleProviderProps = { type: LifecycleType; onError?: (error: NFTError) => void; onStatus?: (lifecycleStatus: LifecycleStatus) => void; onSuccess?: (transactionReceipt?: TransactionReceipt) => void; children: ReactNode; }; export type NFTLifecycleContextType = { type: LifecycleType; lifecycleStatus: LifecycleStatus; updateLifecycleStatus: (status: LifecycleStatusUpdate) => void; }; /** * NFT Provider */ export type NFTContextType = { contractAddress: `0x${string}`; tokenId?: string; /** Optional boolean to determine if the mint is sponsored by paymaster */ isSponsored?: boolean; quantity: number; setQuantity: (quantity: string) => void; buildMintTransaction?: BuildMintTransaction; } & NFTData; export type NFTProviderProps = { children: ReactNode; contractAddress: `0x${string}`; tokenId?: string; /** Optional boolean to determine if the mint is sponsored by paymaster */ isSponsored?: boolean; useNFTData: UseNFTData; buildMintTransaction?: BuildMintTransaction; }; /** * Note: exported as public Type */ export type UseNFTData = ( /** Contract address of the NFT */ contractAddress: Hex, /** Token ID of the NFT */ tokenId?: string) => NFTData | NFTError; /** * Note: exported as public Type */ export type NFTData = { /** required for NFTTitle and NFTCollectionTitle */ name?: string; /** not currently used */ description?: string; /** required for NFTMedia */ imageUrl?: string; /** required for NFTMedia (audio and video types) */ animationUrl?: string; /** supported mimeTypes: * image = image/* * video = video/* * audio = audio/* | application/* */ /** required for NFTLastSoldPrice */ lastSoldPrice?: NFTPrice; /** required for NFTMedia (falls back to image) */ mimeType?: string; /** required for NFTOwner */ ownerAddress?: `0x${string}`; /** not currently used */ contractType?: ContractType; /** required for NFTMintDate */ mintDate?: Date; /** required for NFTAssetCost, NftTotalCost */ price?: NFTPrice; /** required for NFTTotalCost */ mintFee?: NFTPrice; /** required for NFTCreator */ creatorAddress?: Hex; /** required for NFTMintButton */ maxMintsPerWallet?: number; /** required for NFTMintButton */ isEligibleToMint?: boolean; /** required for NFTMinters */ totalOwners?: string; /** required for NFTMinters */ recentOwners?: Address[]; /** required for default BuildMintTransaction implementation */ network?: string; }; /** * Note: exported as public Type */ export type BuildMintTransaction = (props: BuildMintTransactionDataParams) => Promise; export type BuildMintTransactionDataParams = { /** Contract address of the NFT */ contractAddress: Hex; /** Address of the taker */ takerAddress: Address; /** Token ID of the NFT */ tokenId?: string; /** Quantity of the NFT to mint */ quantity: number; /** Network of the NFT */ network?: string; }; /** * Note: exported as public Type */ export type UseTokenDetailsParams = GetTokenDetailsParams & { queryOptions?: Omit, 'queryKey' | 'queryFn'>; }; /** * Note: exported as public Type */ export type UseMintDetailsParams = GetMintDetailsParams & { queryOptions?: Omit, 'queryKey' | 'queryFn'>; }; /** * Note: exported as public Type */ export type NFTCardProps = { children?: React.ReactNode; /** Optional className override for top div element. */ className?: string; /** Contract address of the NFT */ contractAddress: Hex; /** Required Token ID of the NFT */ tokenId: string; /** Optional hook to override the default useNftData hook */ useNFTData?: UseNFTData; /** An optional callback function that handles errors within the provider. */ onError?: (error: NFTError) => void; /** An optional callback function that exposes the component lifecycle state */ onStatus?: (lifecycleStatus: LifecycleStatus) => void; /** card will not pass transactionReceipt */ onSuccess?: (transactionReceipt?: TransactionReceipt) => void; }; /** * Note: exported as public Type * NFTMint must be used if the NFTMintButton is included */ export type NFTMintCardProps = { children?: ReactNode; /** Optional className override for top div element. */ className?: string; /** Contract address of the NFT */ contractAddress: Hex; /** Token ID of the NFT only required for ERC1155 */ tokenId?: string; /** Optional boolean to determine if the mint is sponsored by paymaster */ isSponsored?: boolean; /** Optional hook to override the default useNFTData hook */ useNFTData?: UseNFTData; /** Optional function to override the default function that builds the mint transaction */ buildMintTransaction?: BuildMintTransaction; /** An optional callback function that handles errors within the provider. */ onError?: (error: NFTError) => void; /** An optional callback function that exposes the component lifecycle state */ onStatus?: (lifecycleStatus: LifecycleStatus) => void; /** mint will pass transactionReceipt */ onSuccess?: (transactionReceipt?: TransactionReceipt) => void; }; export type LifecycleStatus = { statusName: 'init'; statusData: null; } | { statusName: 'error'; statusData: NFTError; } | { statusName: 'mediaLoading'; statusData: { mediaType: MediaType; mediaUrl: string; }; } | { statusName: 'mediaLoaded'; statusData: null; } | { statusName: 'transactionPending'; statusData: null; } | { statusName: 'transactionLegacyExecuted'; statusData: { transactionHashList: Address[]; }; } | { statusName: 'success'; statusData: { transactionReceipts?: TransactionReceipt[]; }; }; //# sourceMappingURL=types.d.ts.map