/** * Nado withdrawals — the public integration surface. * * Pass the returned config to the withdrawal modal; the SDK renders the Nado * enter-amount screen, signs Nado's gasless `withdraw_collateral_v2` against a * Fun deposit address, and routes the settled funds to the user's destination. * * Everything an integrator touches is exported from this file and nowhere else — * not the root entry. Anything they don't stays in `clients/internal/nado/`. * * @example * ```tsx * const nado = useNadoWithdrawalConfig( * isConnected * ? { sourceTokens: NADO_SOURCE_TOKENS, sourceTokenSymbol: 'USDT0' } * : null, * ) * ``` */ import type { SourceTokenOption, TokenInfo } from '../providers/FunkitCheckoutContext/types'; import type { NadoWithdrawalConfig } from './internal/nado/withdrawalConfig'; export interface NadoWithdrawalOptions { /** * Nado's withdrawable assets. Each option must carry * `customData: { type: 'nado', productId }` and `asset.decimals` — the product * id addresses the subaccount balance and the decimals scale the signed * amount, so an option missing either is skipped. */ sourceTokens: SourceTokenOption[]; /** Symbol of the initially selected option; must match one in {@link sourceTokens}. */ sourceTokenSymbol: string; /** * Active subaccount's name as your subaccount state holds it (`default`, * `default_1`, …) — not the profile label the user sees, and not a decoded * engine value. The SDK packs it with the connected wallet. Defaults to * `default`; `''` is a different subaccount, and over 12 bytes disables the * config. */ subaccountName?: string; modalTitle?: string; iconSrc?: null | string; disableConnectedWallet?: boolean; /** Token pre-selected in the receive dropdown. Defaults to the source token. */ defaultReceiveToken?: string; /** Awaited after the user commits, before any nonce fetch or signature. Throw to abort. */ onBeforeSign?: () => Promise | void; getMinWithdrawalUSD?: (asset: TokenInfo) => number; getMaxWithdrawalUSD?: (asset: TokenInfo) => number; /** * Minimum withdrawal in token units per source symbol. Preferred over * {@link NadoWithdrawalOptions.getMinWithdrawalUSD} here — the floor is the * sequencer fee, which Nado charges per asset, not per dollar. */ getMinWithdrawalAmount?: (symbol: string) => number; /** Initial state of the borrow (spot leverage) toggle */ defaultSpotLeverage?: boolean; } /** * Withdrawal config for a Nado subaccount, or `null` while one can't be built — * keep the withdraw entry point disabled until it resolves. * * Null means the wallet is disconnected, `options` is null, or * `sourceTokenSymbol` names no entry in `sourceTokens` that carries an `asset`. * The last is a wiring bug and is not logged, so check it first if the button * never enables. */ export declare function useNadoWithdrawalConfig(options: NadoWithdrawalOptions | null): NadoWithdrawalConfig | null; export type { NadoWithdrawalConfig } from './internal/nado/withdrawalConfig'; export type { NadoWithdrawalCustomerConfig, NadoWithdrawalCustomerData, } from '@funkit/connect-core/clients/nado';