UNPKG

@funkit/connect

Version:

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

56 lines (55 loc) 2.05 kB
import type { OAuthProviderType } from '@privy-io/js-sdk-core'; import type { Address } from 'viem'; /** * NATIVE_TOKEN is a special address in Fun to represent different native currency tokens on different chains * e.g. on Base it is ETH, but on Polygon it is MATIC/POL. It is not one specific real token address. **/ export declare const NATIVE_TOKEN = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; export declare const FUNKIT_CONNECT_WALLET_ID = "funkitConnectWallet"; export declare const RESERVED_GROUP_NAME = "funkit-web2"; export declare const DEFAULT_FUNWALLET_INDEX = 0; export declare const FUN_ORG_NAME = "Fun.xyz"; export declare const FUN_TERMS_URL = "https://fun.xyz/terms"; export declare enum PrivyLoginMethod { email = "email", farcaster = "farcaster", google_oauth = "google_oauth", twitter_oauth = "twitter_oauth", apple_oauth = "apple_oauth" } export declare enum FunkitSocialLoginMethod { GOOGLE = "google_oauth", TWITTER = "twitter_oauth", APPLE = "apple_oauth", FARCASTER = "farcaster" } export type SocialLoginOption = { funkitKey: FunkitSocialLoginMethod; provider: OAuthProviderType | 'farcaster'; getIcon: (size?: number) => React.ReactNode; name: string; }; export type FunkitLoginType = 'web2' | 'web3'; export type FunkitPrioritizedLoginType = 'none' | FunkitLoginType; export interface FunkitUserInfoBase { /** Unique identifier of the user **/ id: string | Address; /** Friendly name of the user **/ name: string; /** Friendly name of the user, truncated for display **/ nameTruncated: string; /** The user's login type **/ type: 'unknown' | 'eoa' | PrivyLoginMethod; /** Friendly name of the user's login type **/ typeLabel: string; /** Profile picture url **/ iconSrc: string; } export interface FunkitUserInfo extends FunkitUserInfoBase { address: Address; } export declare const PLACEHOLDER_FUNKIT_USER_INFO: FunkitUserInfo; export declare enum DepositTokenSymbol { USDC = "USDC", ETH = "ETH" }