import { Token } from "@betswirl/sdk-core"; import { Address } from "viem"; type UseTokenAllowanceProps = { token?: Token; spender: Address; amount: bigint; enabled?: boolean; }; /** * Hook to check and manage token allowances for betting. * Automatically prompts for approval when allowance is insufficient. * * @param props.token - Token to check allowance for * @param props.spender - Contract address that will spend the tokens * @param props.amount - Amount of tokens needed * @param props.enabled - Whether to enable the hook (default: true) * @returns * - allowance: Current allowance amount * - needsApproval: Whether approval is needed * - approve: Function to approve max amount * - isApprovePending: Whether user needs to sign the approval transaction * - isApproveConfirming: Whether approval transaction is being confirmed on-chain * - isSuccess: Whether approval was successful * * @example * ```ts * const { needsApproval, approve, isApprovePending, isApproveConfirming } = useTokenAllowance({ * token: selectedToken, * spender: gameContractAddress, * amount: betAmount * }) * * if (needsApproval) { * await approve() * } * ``` */ export declare function useTokenAllowance(props: UseTokenAllowanceProps): { allowance: bigint; needsApproval: boolean; approve: () => Promise; effectiveToken: Token | undefined; resetApprovalState: () => void; approveWriteWagmiHook: import("wagmi").UseWriteContractReturnType; approveWaitingWagmiHook: import("wagmi").UseWaitForTransactionReceiptReturnType[]; logsBloom: import("viem").Hex; root?: `0x${string}` | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: import("viem").Hash; transactionIndex: number; type: import("viem").TransactionType; chainId: number; }>; allowanceReadWagmiHook: import("wagmi").UseReadContractReturnType; }; export {};