import type { FunAddress } from '@funkit/api-base'; import type { Address } from 'viem'; /** * Pure, platform-agnostic helpers for the QR-code / Universal-Deposit-Address * token-transfer flow. The React hooks that consume these (`useUDAParams`, * `useCheckoutTransferInit`, `useTokenTransfer`) stay in `@funkit/connect` * because they read web providers and carry customer/i18n branches; only the * customer-agnostic param-shaping logic lives here so React Native can reuse it. */ /** * Platform-agnostic config slice that {@link getCheckoutTokenTransferParams} * reads. The web `FunkitCheckoutConfig` satisfies this structurally (it has * these fields plus many more); narrowing here keeps the function free of the * web-only provider type. (Same pattern as `getWalletLabel` in V1 PR9.) */ export interface CheckoutTokenTransferConfig { targetChain: string; targetAsset: Address; /** * Where the deposit ends up, when it is not the connected wallet — the same * field web's `FunkitCheckoutConfig` carries (e.g. a Polymarket proxy). */ customRecipient?: FunAddress; qrcodeActionType?: string; dynamicTargetAssetCandidates?: Array<{ tokenChainId: string; tokenAddress: Address; isDefault?: boolean; }>; } /** * Universal Deposit Address params. Pure data describing a dynamic-routing * target; the web `useUDAParams` hook resolves it from dynamic config and * re-exports this type. */ export interface UDAConfig { targetChain: string; targetAsset: Address; targetAssetTicker: string; iconSrc: string; qrcodeActionType?: string; defaultTokenSymbol?: string; defaultChainId?: string; } /** The chain, token and action one deposit actually resolves to. */ export interface DepositTarget { chainId: string; address: Address; /** A route the deposit has to run through, e.g. a customer action. */ actionType?: string; } /** * Where a deposit lands, resolved the way `/eoa` resolves it: UDA params win * over the config, and a dynamic candidate wins over `targetAsset`. * * Shared so callers that decide something about the destination — whether a * swap is needed, what to label — cannot answer for a different token than the * one the address is minted against. */ export declare function effectiveDepositTarget({ checkoutConfig, udaParams, targetAssetOverride, }: { checkoutConfig: CheckoutTokenTransferConfig | undefined; udaParams?: UDAConfig | undefined; targetAssetOverride?: Address; }): DepositTarget | undefined; export declare function getCheckoutTokenTransferParams({ checkoutConfig, userId, recipientAddr, apiKey, udaParams, targetAssetOverride, }: { checkoutConfig: CheckoutTokenTransferConfig | undefined; userId: string; recipientAddr: FunAddress; apiKey: string; udaParams?: UDAConfig | undefined; /** * Resolved customer-specific destination-token override for the default * flow. Web supplies it (e.g. Polymarket Perps deposits target pUSD) so this * function stays customer-agnostic. When undefined, the config's * `targetAsset` is used. */ targetAssetOverride?: Address; }): { userId: string; apiKey: string; recipientAddr: FunAddress; actionType: string | undefined; toChainId: string; toTokenAddress: `0x${string}`; } | undefined; export interface MinTransferConfig { default: number; chains: { [chainId: string]: number; }; } export declare function getMinTransferValueForChain(chainId: number, limits: MinTransferConfig | undefined): number; //# sourceMappingURL=checkoutTransfer.d.ts.map