import type { ApiFunkitCheckoutActionParams } from '@funkit/utils'; import type { Address } from 'viem'; export interface TokenInfo { tokenAddress: Address; tokenChainId: string; } /** * Distinguishes tokens needing handling the default ERC-20 path doesn't cover — * how they're discovered, or where they can settle. */ export type AssetClass = 'xstock'; /** Shape mirrors `FunkitCheckoutConfig['generateActionsParams']` in connect. */ export type CandidateGenerateActionsParams = (targetAssetAmount: number, config?: { targetAsset: Address; targetChain: string; }) => Promise; /** * A candidate target asset for dynamic routing. Shared by `@funkit/connect` * (web) and `@funkit/connect-rn`; each resolves the active candidate from a * list of these with its own helper (web's lives in * `packages/connect/src/utils/assets.ts`). */ export interface DynamicTargetAssetCandidate extends TokenInfo { iconSrc: string; tokenSymbol: string; isDefault?: boolean; badgeText?: string; targetAssetMinAmount?: number; dynamicRoutingId?: string; /** * Recipient to point the checkout at when this candidate is selected. Set * when candidates represent destination *accounts* that share a target token * but differ by recipient (e.g. Polymarket Predictions vs Perps); selecting * one routes funds to its address. Omit for plain token candidates (the * recipient is unchanged). */ customRecipient?: Address; /** * Override the config's `generateActionsParams` when this candidate is * selected. Presence-keyed: omitting preserves the config's incumbent * actions; setting (even to `undefined`) overrides. * * Note: JSON round-trip drops `undefined` properties, which defeats the * presence check — do not deep-clone candidates via `JSON.stringify`. */ generateActionsParams?: CandidateGenerateActionsParams; /** * Asset class of this candidate. When set, the candidate's token is read * directly from the wallet on-chain and surfaced as a payable source (the * wallet-assets API doesn't index every token class). Does not affect routing. */ assetClass?: AssetClass; } //# sourceMappingURL=dynamicTargetAsset.d.ts.map