import { type AllowedRecipientListState, type AllowedRecipientOption } from '../../domains/withdrawalAllowlist'; import type { TokenTransferSourceChainsAndAssets } from '../../modals/CheckoutModal/TransferToken/TransferToken'; import { type SingleWithdrawalConfig } from '../../providers/FunkitCheckoutContext'; /** The recipient picker's rows and the row the checkout item pays. */ export interface WithdrawalRecipientAllowlist { options: AllowedRecipientOption[]; listState: AllowedRecipientListState; /** The row for the item's `customRecipient` on the receive chain. */ selected: AllowedRecipientOption | undefined; /** Sends to `recipient`: its address to the item, its chain to the dropdown. */ pick: (recipient: AllowedRecipientOption) => void; } /** * The form a pick keeps in step with the item: the receive chain dropdown, * moved to the address's chain, and the typed address field, which shows the * address if the list goes away. */ interface WithdrawalForm { /** The receive tokens by chain, once loaded. A listed address on a chain with none is dropped. */ receiveAssets: TokenTransferSourceChainsAndAssets | undefined; chainId: number | undefined; handleChainChange: (chainId: number, autoUpdate: boolean) => unknown; setTypedRecipientAddress: (address: string) => void; } /** * The enforced allowlist and its picker. The pick lives only in the checkout * item's `customRecipient`, which the quote pays, so the form can't show one * address and pay another. `allowlist` is undefined with the gate off or * without a list. */ export declare function useWithdrawalRecipientAllowlist(config: SingleWithdrawalConfig, { receiveAssets, chainId, handleChainChange, setTypedRecipientAddress, }: WithdrawalForm): { allowedRecipients: readonly import("../../domains/withdrawalAllowlist").AllowedRecipient[] | undefined; allowlist: WithdrawalRecipientAllowlist | undefined; }; /** * Writes the first usable listed address to the item on open, unless it * already holds one. Like main's connected-wallet prefill, it runs until the * form shows a usable listed address, then stops, so a pick that later * becomes blocked stays. */ export declare function useAutoSelectAllowedRecipient(allowlist: WithdrawalRecipientAllowlist | undefined, /** Whether a pick may write the item now. */ canPick: boolean): void; export {};