UNPKG

@funkit/connect

Version:

Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.

34 lines (33 loc) 1.7 kB
/** * Aave native-supply domain logic: pure constants and predicates shared by * the InputAmount fast-path hook and `FunkitQuoteContext` (toggle gating). * The `@aave/client` SDK singleton stays in * `~/modals/CheckoutModal/InputAmount/aaveClient.ts` — importing it here * would run SDK init for every consumer of this module. */ import type { Address } from 'viem'; import type { FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext'; export declare const AAVE_MARKET_ADDRESS_BY_CHAIN: Record<string, Address>; interface AaveNativeSupplyContextArgs { apiKey: string; sourceAsset: { chainId: string | number; address: string | null; } | undefined; checkoutConfig: Pick<FunkitCheckoutConfig, 'targetChain' | 'targetAsset'> | undefined; } /** * The single check for "is this an Aave native supply" (same chain + same token * as the target, on a chain with an Aave market, for a native-supply-enabled * customer). Tolerates missing source/config — returns false — so callers pass * possibly-undefined checkout state directly without their own guards. */ export declare function isAaveNativeSupplyContext({ apiKey, sourceAsset, checkoutConfig, }: AaveNativeSupplyContextArgs): boolean; /** * Wraps an integrator-provided `resolveHealthFactor` so a throw degrades to a * hidden row (`null`) instead of crashing the confirmation screen — the SDK * never trusts the callback to be total. Returns `undefined` when no resolver * is configured, so callers keep gating on presence. */ export declare function wrapResolveHealthFactor(resolve: FunkitCheckoutConfig['resolveHealthFactor']): FunkitCheckoutConfig['resolveHealthFactor']; export {};