@funkit/connect
Version:
Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.
27 lines (26 loc) • 2.22 kB
TypeScript
/**
* See Design Doc
* We have three types of accounts in our system:
* - Frog SubAccounts: it is used to store data in fun database.
* - Bridge Accounts: created by Bridge, our third party fiat provider
* - Bridge Bank Account: corresponds to a payment route for a user
* https://docs.google.com/document/d/1A0GVWMIe1aLHtblMYJZfFP3C-DybMo47l4vvoxcbpcs/edit?tab=t.0
*/
import { type BaseApiRequest, type BridgeCustomer, BridgeCustomerStatus, BridgeKycStatus, type BridgeSubAccount, type BridgeVirtualBankAccount, type CreateBridgeBankAccountRequest, type FunAddress } from '@funkit/api-base';
/** Bridge only supports a handful of chains so we need to normalize other chains to the supported chain*/
export declare const findBridgeSupportedChain: (chainId: string) => CreateBridgeBankAccountRequest["chainName"];
export interface AllFiatAccounts {
bridgeCustomer?: BridgeCustomer;
bankAccounts?: BridgeVirtualBankAccount[];
}
export declare function fetchFrogAccounts(walletAddress: string, params: BaseApiRequest): Promise<import("@funkit/api-base").SubAccount[] | null>;
export declare function fetchAllFiatAccounts(bridgeSubAccount: BridgeSubAccount | undefined, params: BaseApiRequest): Promise<AllFiatAccounts>;
export declare function getMatchingBankAccount(accounts: AllFiatAccounts, targetChain: string, targetAddress: FunAddress): BridgeVirtualBankAccount | undefined;
export declare const getFiatAccountLabel: (defaultLabel: string, account?: BridgeVirtualBankAccount) => string;
export declare const mapBridgeCustomerStatusToKycStatus: (customerStatus?: BridgeCustomerStatus) => BridgeKycStatus | undefined;
export declare function isKycUninitialized(customerStatus: BridgeCustomerStatus): customerStatus is BridgeCustomerStatus.AWAITING_QUESTIONNAIRE | BridgeCustomerStatus.AWAITING_UBO | BridgeCustomerStatus.INCOMPLETE | BridgeCustomerStatus.NOT_STARTED;
/**
* When KYC is in the initial state (passed KYC that has to be retried doesn't have a special customer state) but we already get some rejection reasons from bridge
*/
export declare const isSoftRejected: (customer: BridgeCustomer | undefined) => boolean | undefined;
export declare const FIAT_PROCESSING_TIME = "1-2 business days";