UNPKG

@funkit/connect

Version:

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

35 lines (34 loc) 1.77 kB
import type { TFunction } from 'i18next'; import type { Address } from 'viem'; import type { FunkitCheckoutConfig } from '~/providers/FunkitCheckoutContext'; import type { AssetHoldingsItem } from '~/utils/assets'; import { PaymentMethod } from '../domains/paymentMethods'; export declare const isStablecoin: (symbol: string) => string | undefined; export declare function isPreferredChain(chainId: number, additionalChains?: number[]): boolean; export declare function isNativeTokenAddress(address: Address): boolean; export declare function isDefaultToken(asset: AssetHoldingsItem, checkoutConfig: FunkitCheckoutConfig): boolean; export declare const isPolygonEcosystemToken: (chainId: string, tokenAddress: string) => boolean; interface AssetUsableToPayParms { config: FunkitCheckoutConfig; payerAddress: string; paymentMethod: PaymentMethod; targetChainId: string; targetTokenAddress: string; assetChainId: string; assetTokenAddress: string; assetUsdAmount: number | null; isAllowedForCheckout: boolean; minUsdRequired?: number; t: TFunction; } export declare const isAssetUsableToPayForCheckout: ({ config, payerAddress, paymentMethod, targetChainId, targetTokenAddress, assetChainId, assetTokenAddress, assetUsdAmount, isAllowedForCheckout, minUsdRequired, t, }: AssetUsableToPayParms) => { isUsable: boolean; reason: string; minUsdRequired?: number; }; export declare function getUsdAvailableAmount(targetChainId: string, assetChainId: string | undefined, assetUsdAmount: number | null | undefined, paymentMethod: PaymentMethod | undefined): number | null; /** * Attempt to safeguard user from irrecoverable losses */ export declare function isBlacklistedWithdrawAddress(address: string): boolean; export {};