@funkit/connect 9.12.0 → 9.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +21 -0
  3. package/dist/__generated__/default_configs.d.ts +3 -0
  4. package/dist/clients/lighter.js +4 -0
  5. package/dist/clients/polymarket.js +6 -0
  6. package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
  7. package/dist/components/FunPayments/FunPaymentMethods.d.ts +16 -0
  8. package/dist/components/Icons/CashAppIcon.d.ts +4 -0
  9. package/dist/consts/customers.d.ts +8 -0
  10. package/dist/domains/paymentMethods.d.ts +9 -1
  11. package/dist/hooks/queries/useRecentDeposits.d.ts +39 -49
  12. package/dist/hooks/usePaymentSources.d.ts +1 -0
  13. package/dist/index.css +11 -11
  14. package/dist/index.js +3081 -2627
  15. package/dist/modals/CheckoutModal/SourceChange/FlatList.d.ts +31 -0
  16. package/dist/modals/CheckoutModal/SourceChange/GroupedList.d.ts +25 -0
  17. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +8 -0
  18. package/dist/modals/CheckoutModal/SourceChange/SourceList.d.ts +23 -9
  19. package/dist/modals/CheckoutModal/SourceChange/buildSourceGroups.d.ts +70 -0
  20. package/dist/modals/CheckoutModal/TransferToken/types.d.ts +1 -2
  21. package/dist/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.css.d.ts +1 -1
  22. package/dist/modals/WithdrawalModal/ErrorMessage.d.ts +4 -0
  23. package/dist/modals/WithdrawalModal/RecipientAddress.d.ts +11 -0
  24. package/dist/modals/WithdrawalModal/WithdrawAmountInput.d.ts +10 -4
  25. package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +32 -1
  26. package/dist/providers/FunkitCheckoutContext/types.d.ts +1 -0
  27. package/dist/providers/FunkitConfigContext.d.ts +4 -0
  28. package/dist/providers/GeneralWalletProvider.d.ts +2 -4
  29. package/dist/utils/userInfo.d.ts +36 -0
  30. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  31. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  32. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  33. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  34. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  35. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  36. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  37. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  38. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  39. package/dist/wallets/walletConnectors/index.js +44 -44
  40. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  41. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  42. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  43. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  44. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  45. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  46. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  47. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  48. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  49. package/package.json +9 -5
  50. package/dist/wallets/walletConnectors/{chunk-5TN5Z2WY.js → chunk-3ZJN3PXP.js} +3 -3
  51. package/dist/wallets/walletConnectors/{chunk-V6UOWTEZ.js → chunk-55VS2NKG.js} +3 -3
  52. package/dist/wallets/walletConnectors/{chunk-DEFRRPXB.js → chunk-7IEUTLHY.js} +3 -3
  53. package/dist/wallets/walletConnectors/{chunk-LCIPVVH5.js → chunk-AZYMJ4C6.js} +3 -3
  54. package/dist/wallets/walletConnectors/{chunk-T4ROGPMF.js → chunk-FWM4KTOV.js} +3 -3
  55. package/dist/wallets/walletConnectors/{chunk-YIEASHLS.js → chunk-IMNI4AGV.js} +3 -3
  56. package/dist/wallets/walletConnectors/{chunk-7V33VJAL.js → chunk-IRHK6SOW.js} +3 -3
  57. package/dist/wallets/walletConnectors/{chunk-UDTBQV4Q.js → chunk-J3PJOMO7.js} +3 -3
  58. package/dist/wallets/walletConnectors/{chunk-VJZWNQOF.js → chunk-LEAZMT5Y.js} +3 -3
  59. package/dist/wallets/walletConnectors/{chunk-6DRCY52E.js → chunk-OD6B2ISG.js} +3 -3
  60. package/dist/wallets/walletConnectors/{chunk-FG2LDVXL.js → chunk-OSOB6QYX.js} +3 -3
  61. package/dist/wallets/walletConnectors/{chunk-XVBSJCW5.js → chunk-RZQ4B4Z7.js} +3 -3
  62. package/dist/wallets/walletConnectors/{chunk-KWX2SYU2.js → chunk-UFYNHHDU.js} +3 -3
  63. package/dist/wallets/walletConnectors/{chunk-HXWUH73P.js → chunk-UYW6MV74.js} +3 -3
  64. package/dist/wallets/walletConnectors/{chunk-34HACM5U.js → chunk-VMMROPXK.js} +3 -3
  65. package/dist/wallets/walletConnectors/{chunk-ZPSPK6LH.js → chunk-YGMU5VWD.js} +3 -3
  66. package/dist/wallets/walletConnectors/{chunk-APHCF4DT.js → chunk-ZJJWGKB6.js} +3 -3
  67. package/dist/wallets/walletConnectors/{chunk-HRDPUW3V.js → chunk-ZL6XCMV5.js} +3 -3
@@ -0,0 +1,31 @@
1
+ import React, { type ReactNode } from 'react';
2
+ import type { SourceGroup } from './buildSourceGroups';
3
+ interface FlatListProps {
4
+ groups: SourceGroup[];
5
+ /**
6
+ * Class name applied to the outer Box that holds the groups.
7
+ * Caller decides between standard / compact styling so the renderer
8
+ * doesn't reach into FunkitConfig.
9
+ */
10
+ boxClassName: string;
11
+ /**
12
+ * Label rendered on the `FunDivider` between adjacent groups.
13
+ * Omit to render the divider without a label.
14
+ */
15
+ dividerLabel?: string;
16
+ /**
17
+ * Trailing content rendered after the groups, inside the outer Box.
18
+ * Used by the source-list flat layout to place PayPal at the
19
+ * bottom of the box.
20
+ */
21
+ footer?: ReactNode;
22
+ /** Applied as `data-testid` on the outer Box for snapshot scoping. */
23
+ testId?: string;
24
+ }
25
+ /**
26
+ * Pure presentational primitive: a single column of group bodies with
27
+ * a divider between adjacent groups and an optional footer. No
28
+ * provider/context dependencies — composition lives in the caller.
29
+ */
30
+ export declare function FlatList({ groups, boxClassName, dividerLabel, footer, testId, }: FlatListProps): React.JSX.Element;
31
+ export {};
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import type { SourceGroup } from './buildSourceGroups';
3
+ interface GroupedListProps {
4
+ groups: SourceGroup[];
5
+ /**
6
+ * Render each group's `label` as a section header when true. False
7
+ * skips the headers but keeps the grouped container styling.
8
+ */
9
+ showLabels: boolean;
10
+ /**
11
+ * Class name applied to the inner box that holds each group's
12
+ * children. Caller decides between standard / compact styling so the
13
+ * renderer doesn't reach into FunkitConfig.
14
+ */
15
+ boxClassName: string;
16
+ /** Applied as `data-testid` on the outer Box for snapshot scoping. */
17
+ testId?: string;
18
+ }
19
+ /**
20
+ * Pure presentational primitive: groups rendered as separate boxes
21
+ * inside a grouped container, with optional section labels. No
22
+ * provider/context dependencies — composition lives in the caller.
23
+ */
24
+ export declare function GroupedList({ groups, showLabels, boxClassName, testId, }: GroupedListProps): React.JSX.Element;
25
+ export {};
@@ -35,6 +35,14 @@ export type SourceChangeNext = {
35
35
  selectedPaymentOption: SwappedFormOfPayment;
36
36
  /** Payment method type filter to restore when returning */
37
37
  paymentMethodTypeFilter: PaymentMethodType;
38
+ } | {
39
+ /**
40
+ * Skip the asset-select screen; land on InputAmount with the
41
+ * source asset pre-set on the checkout context. Used by the
42
+ * Native fast-path row.
43
+ */
44
+ skipAssetSelect: true;
45
+ paymentMethodInfo: ConnectablePaymentMethodInfo;
38
46
  };
39
47
  export declare const SourceChangeInfo: ModalStepInfo<FunCheckoutStep.SOURCE_CHANGE>;
40
48
  export declare function SourceChange({ modalState, onClose, onNext, setModalState, }: ModalStepComponentProps<FunCheckoutStep.SOURCE_CHANGE>): React.JSX.Element;
@@ -1,13 +1,27 @@
1
- import React from 'react';
2
- import type { ConnectablePaymentMethodInfo, PaymentMethod } from '../../../domains/paymentMethods';
3
- import { type UnavailablePaymentSource } from '../../../hooks/usePaymentSources';
1
+ import React, { type ReactNode } from 'react';
4
2
  interface SourceListProps {
5
- preferred: (ConnectablePaymentMethodInfo | PaymentMethod)[];
6
- moreSources: (ConnectablePaymentMethodInfo | PaymentMethod)[];
7
- unavailable: UnavailablePaymentSource[];
3
+ preferred: ReactNode[];
4
+ moreSources: ReactNode[];
5
+ unavailable: ReactNode[];
8
6
  isFallback: boolean;
9
- renderSource: (source: ConnectablePaymentMethodInfo | PaymentMethod) => React.ReactNode;
10
- renderUnavailable: (source: UnavailablePaymentSource) => React.ReactNode;
7
+ /**
8
+ * Pre-rendered Native fast-path row, threaded through to
9
+ * `buildSourceGroups`. Caller (SourceChange) owns the row's click
10
+ * handler since it depends on the modal's `onNext` callback.
11
+ */
12
+ nativeRow?: ReactNode;
13
+ testId?: string;
11
14
  }
12
- export declare function SourceList({ preferred, moreSources, unavailable, isFallback, renderSource, renderUnavailable, }: SourceListProps): React.JSX.Element;
15
+ /**
16
+ * Contextual composer for the source-change payment-method list.
17
+ * Reads translation, funkit config, and the source-list-relevant
18
+ * Statsig flags directly; runs `buildSourceGroups`; dispatches to the
19
+ * matching layout primitive — `FlatList` for the non-Swapped path
20
+ * (with a PayPal footer + "more" divider label) or `GroupedList` for
21
+ * the Swapped path (with optional section labels).
22
+ *
23
+ * `SourceList` has no DOM of its own; the primitive it returns owns
24
+ * the outer `data-testid` element.
25
+ */
26
+ export declare function SourceList({ preferred, moreSources, unavailable, isFallback, nativeRow, testId, }: SourceListProps): React.JSX.Element;
13
27
  export {};
@@ -0,0 +1,70 @@
1
+ import type { TFunction } from 'i18next';
2
+ import { type ReactNode } from 'react';
3
+ export interface SourceGroup {
4
+ /** Section header. Omit to render the group's body without a header. */
5
+ label?: string;
6
+ /**
7
+ * Optional tooltip surfaced via an info icon next to the label.
8
+ * Only renders when `showLabels` and `label` are both set.
9
+ */
10
+ labelTooltip?: string;
11
+ children: ReactNode;
12
+ }
13
+ interface BuildSourceGroupsArgs {
14
+ /** Customer identity — used to dispatch to per-customer section composition. */
15
+ apiKey: string;
16
+ preferred: ReactNode[];
17
+ moreSources: ReactNode[];
18
+ unavailable: ReactNode[];
19
+ isFallback: boolean;
20
+ isSwappedEnabled: boolean;
21
+ enableSourceGroupLabels: boolean;
22
+ t: TFunction;
23
+ /**
24
+ * Pre-rendered Native fast-path row. Caller resolves the customer's
25
+ * native asset, looks up the wallet holding, and constructs the row
26
+ * component; this function decides where in the Aave section
27
+ * structure it belongs. Only the Aave branch consumes it; the
28
+ * default branch ignores it.
29
+ */
30
+ nativeRow?: ReactNode;
31
+ }
32
+ export type BuildSourceGroupsResult = {
33
+ layout: 'flat';
34
+ groups: SourceGroup[];
35
+ } | {
36
+ layout: 'grouped';
37
+ groups: SourceGroup[];
38
+ showLabels: boolean;
39
+ };
40
+ /**
41
+ * Composes source-list sections from `usePaymentSources` buckets +
42
+ * the relevant Statsig flags + the customer identity. Returns a
43
+ * discriminated layout shape; the composer (`SourceList`) dispatches
44
+ * to the matching layout primitive.
45
+ *
46
+ * **Default branch** (most customers) mirrors SourceList's prior
47
+ * output:
48
+ * - `isSwappedEnabled=false` → flat layout. One group for `preferred`
49
+ * (if any), one combined group for `moreSources + unavailable` (if
50
+ * any), with a single divider between them. (`SourceList` places
51
+ * `<PayPal />` as the flat footer.)
52
+ * - `isSwappedEnabled=true` → grouped layout. Same two groups, but
53
+ * rendered in separate boxes with `showLabels` toggling the section
54
+ * headers ("Connected" / "Most popular" / "Other options"). The
55
+ * "Other options" header is suppressed when no preferred group
56
+ * precedes it.
57
+ *
58
+ * **Aave branch** (per Figma, [ENG-3743](https://linear.app/funxyz/issue/ENG-3743)
59
+ * + [ENG-3747](https://linear.app/funxyz/issue/ENG-3747)
60
+ * + [ENG-3755](https://linear.app/funxyz/issue/ENG-3755)):
61
+ * - "Native" section with the user's underlying-asset row when
62
+ * `nativeRow` is provided.
63
+ * - Second section flattens preferred + moreSources + unavailable
64
+ * into "Use other assets" (with native present) or "Use any asset"
65
+ * (without). Header carries a tooltip via `labelTooltip`.
66
+ * - Layout is always `grouped` with `showLabels=true` for Aave so the
67
+ * section headers render.
68
+ */
69
+ export declare function buildSourceGroups(args: BuildSourceGroupsArgs): BuildSourceGroupsResult;
70
+ export {};
@@ -6,11 +6,10 @@ export type NotificationItem = (MergedMultiStepDirectExecution & {
6
6
  }) | (CheckoutHistoryItem & {
7
7
  isDirectExecution: false;
8
8
  });
9
- type NotificationVariant = 'withdrawal' | 'token_transfer';
9
+ export type NotificationVariant = 'deposit' | 'withdrawal' | 'token_transfer';
10
10
  export interface CheckoutNotificationsProps {
11
11
  onHelp: (depositAddress: Address) => void;
12
12
  /** To control notifications visibility on specific pages, without changing internal dismissal state */
13
13
  isVisible: boolean;
14
14
  variant: NotificationVariant | undefined;
15
15
  }
16
- export {};
@@ -1,2 +1,2 @@
1
1
  export declare const baseStyles: string;
2
- export declare const homeCheckoutDisplayRowStyle: Record<"hoverBackground" | "defaultBorder" | "defaultBackground", string>;
2
+ export declare const homeCheckoutDisplayRowStyle: Record<"defaultBorder" | "defaultBackground" | "hoverBackground", string>;
@@ -0,0 +1,4 @@
1
+ import type { TFunction } from 'i18next';
2
+ import type { ErrorNotification } from '../../components/FunNotification/FunNotification';
3
+ import type { CheckoutConfirmationError } from '../CheckoutModal/ConfirmationStep/useCheckoutConfirmation';
4
+ export declare function getErrorNotification(quoteErrorObject: Error | null, withdrawalError: CheckoutConfirmationError | null, targetAssetFetchError: Error | null, t: TFunction): ErrorNotification | null;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { FunkitWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
3
+ export declare function WithdrawRecipientAddress({ config, recipientAddress, setRecipientAddress, selectedChainId, selectedToken, isValidAddress, isRiskyAddress, }: {
4
+ config: FunkitWithdrawalConfig;
5
+ recipientAddress: string;
6
+ setRecipientAddress: (s: string) => void;
7
+ selectedChainId: number | undefined;
8
+ selectedToken: string | undefined;
9
+ isValidAddress: boolean;
10
+ isRiskyAddress: boolean;
11
+ }): React.JSX.Element;
@@ -6,14 +6,20 @@ export interface SourceTokenOption {
6
6
  label: string;
7
7
  iconSrc?: string;
8
8
  }
9
- export declare function WithdrawAmountInput({ withdrawalUSD, setWithdrawalUSD, sourceTokenBalance, isWithdrawAmountTooLow, isWithdrawAmountValid, minWithdrawalUsd, config, sourceTokenOptions, onSourceTokenChange, selectedSourceToken, sourceTokenUsdPrice, }: {
9
+ export declare function WithdrawAmountInput({ withdrawalInputAmount, setWithdrawalInputAmount, sourceTokenBalance, isWithdrawAmountTooLow, isWithdrawAmountValid, minWithdrawalDisplayValue, config, sourceTokenOptions, onSourceTokenChange, selectedSourceToken, sourceTokenUsdPrice, }: {
10
10
  config: Exclude<FunkitWithdrawalConfig, MultiMethodWithdrawalConfig>;
11
11
  sourceTokenBalance: string;
12
- withdrawalUSD: string;
13
- setWithdrawalUSD: (s: string) => void;
12
+ /** User-entered amount in source-token units (e.g. "0.5" for 0.5 ETH). */
13
+ withdrawalInputAmount: string;
14
+ setWithdrawalInputAmount: (s: string) => void;
14
15
  isWithdrawAmountTooLow: boolean;
15
16
  isWithdrawAmountValid: boolean;
16
- minWithdrawalUsd: number;
17
+ /**
18
+ * Minimum-withdrawal value formatted for display. Token units when the
19
+ * config provides `getMinWithdrawalAmount` (Lighter Secure); USD otherwise.
20
+ * The component picks the rendering style from `isLighter`.
21
+ */
22
+ minWithdrawalDisplayValue: number;
17
23
  sourceTokenOptions?: SourceTokenOption[];
18
24
  onSourceTokenChange?: (opt: SourceTokenOption) => void;
19
25
  /** Currently selected source token symbol (drives chip label + icon). */
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { Hex } from 'viem';
3
- import type { CustomWithdrawalConfig, FunkitActiveWithdrawalItem, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
3
+ import type { CustomWithdrawalConfig, FunkitActiveWithdrawalItem, FunkitCheckoutConfig, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
4
4
  import { type WithdrawalFormData } from './useWithdrawal';
5
5
  /**
6
6
  * WithdrawalContent only operates on concrete single-method withdrawal configs.
@@ -12,6 +12,37 @@ interface WithdrawContentProps {
12
12
  config: FunkitWithdrawalConfig;
13
13
  withdrawalItem: FunkitActiveWithdrawalItem | null;
14
14
  }
15
+ /**
16
+ * Converts a source-token amount string to its USD value using the given unit
17
+ * price. Returns `undefined` when the price is not yet loaded so callers can
18
+ * differentiate "still loading" from "actually $0".
19
+ *
20
+ * Exported for testing.
21
+ */
22
+ export declare function toUsdValue(sourceAmount: string, sourceTokenUsdPrice: number | undefined): number | undefined;
23
+ export declare function isValidWithdrawal({ config, checkoutConfig, withdrawalInputAmount, sourceTokenUsdPrice, recipientAddress, selectedChainId, sourceTokenBalance, selectedSourceToken, }: {
24
+ config: FunkitWithdrawalConfig;
25
+ checkoutConfig: FunkitCheckoutConfig | undefined;
26
+ /** User-entered amount in source-token units (e.g. "0.5" for 0.5 ETH). */
27
+ withdrawalInputAmount: string;
28
+ /**
29
+ * USD price per unit of the source token. Hardcoded to 1 for stablecoin
30
+ * sources; only Lighter Secure resolves a live spot price, and that path
31
+ * uses `getMinWithdrawalAmount` (per-token) which takes priority over the
32
+ * USD-min branch — so this field is only meaningfully consumed when it's 1.
33
+ */
34
+ sourceTokenUsdPrice: number;
35
+ sourceTokenBalance: string;
36
+ recipientAddress: string;
37
+ selectedChainId: number | undefined;
38
+ selectedSourceToken: string | undefined;
39
+ }): {
40
+ isValidAddress: boolean;
41
+ isValidAddressAndChain: boolean;
42
+ isWithdrawAmountTooLow: boolean;
43
+ isWithdrawAmountValid: boolean;
44
+ minWithdrawalDisplayValue: number;
45
+ };
15
46
  /**
16
47
  * Builds the source-token options list for the Lighter compound input dropdown.
17
48
  * Currently returns a single option per config; expands when Lighter exposes
@@ -196,6 +196,7 @@ export interface MultiMethodWithdrawalConfig {
196
196
  sectionTitle?: string;
197
197
  /** The methods the user can choose between. Order is preserved in the UI. */
198
198
  methods: WithdrawalMethodOption[];
199
+ disableConnectedWallet?: boolean;
199
200
  }
200
201
  export type FunkitWithdrawalConfig = WalletWithdrawalConfig | CustomWithdrawalConfig | MultiMethodWithdrawalConfig;
201
202
  export interface FunkitCheckoutValidationResult {
@@ -11,6 +11,7 @@ export interface FunkitTextCustomizationsConfig {
11
11
  sourceMethodTitle: string;
12
12
  tokensListTitle: string;
13
13
  transferTokens: string;
14
+ bitcoinLightning: string;
14
15
  receiveDropdownTitle: string;
15
16
  receiveDropdownLabel: string;
16
17
  txStatus?: {
@@ -58,6 +59,7 @@ export interface FunkitTextCustomizationsConfig {
58
59
  debitOrCredit?: string;
59
60
  paypal?: string;
60
61
  transferTokens?: string;
62
+ bitcoinLightning?: string;
61
63
  virtualFiat?: string;
62
64
  };
63
65
  }
@@ -184,6 +186,8 @@ export interface FunkitUiCustomizationsConfig {
184
186
  showTargetAssetSelection?: boolean;
185
187
  /** Whether to show wallet option when balance is insufficient - defaults to false (hides wallet) */
186
188
  showWalletOnInsufficientBalance?: boolean;
189
+ /** Whether to show the wallet connect payment option - defaults to true */
190
+ showWalletConnect?: boolean;
187
191
  /** Function that returns a custom React component to render before other UIs in the source change screen */
188
192
  customTopComponent?: () => ReactNode;
189
193
  paymentMethodIcons?: {
@@ -3,15 +3,13 @@ import React, { type ReactNode } from 'react';
3
3
  import type { Address } from 'viem';
4
4
  import { type UseDisconnectReturnType, type UseReconnectReturnType } from '../wagmi/hooks';
5
5
  import { type FunkitUserInfo } from '../consts/funkit';
6
+ import { LoginType } from '../utils/userInfo';
6
7
  /** AssetBalanceInfo with known price and totalUsdValue */
7
8
  export interface KnownAssetBalanceInfo extends AssetBalanceInfo {
8
9
  price: number;
9
10
  totalUsdValue: number;
10
11
  }
11
- export declare enum LoginType {
12
- Web3 = "web3",
13
- Guest = "guest"
14
- }
12
+ export { LoginType } from '../utils/userInfo';
15
13
  export interface GeneralWalletContextProps {
16
14
  walletAddress: Address | '';
17
15
  isUserLoggedIn: boolean;
@@ -0,0 +1,36 @@
1
+ import type { Address } from 'viem';
2
+ import { type FunkitUserInfo } from '../consts/funkit';
3
+ export declare enum LoginType {
4
+ Web3 = "web3",
5
+ Guest = "guest"
6
+ }
7
+ /**
8
+ * Whether externalUserId should be treated as a trusted wallet address.
9
+ * Currently only Lighter mobile QR flow passes externalUserId as an L1 address.
10
+ */
11
+ export declare function getIsExternalUserIdAddress(apiKey: string, externalUserId: string | undefined): boolean;
12
+ /**
13
+ * Resolve the wallet address, preferring wagmi's connected address.
14
+ * When `isExternalUserIdAddress` is true, externalUserId is treated as a trusted
15
+ * wallet address and used as fallback when wagmi is not connected.
16
+ * Currently used by Lighter mobile QR flow where the L1 address is passed via externalUserId.
17
+ */
18
+ export declare function resolveWalletAddress(address: Address | undefined, externalUserId: string | undefined, isExternalUserIdAddress: boolean): Address | undefined;
19
+ /**
20
+ * Resolve the userId for the current session.
21
+ */
22
+ export declare function resolveUserId(address: Address | undefined, externalUserId: string | undefined, apiKey: string, isExternalUserIdAddress: boolean): string;
23
+ /**
24
+ * Build the FunkitUserInfo for the current session.
25
+ */
26
+ export declare function buildUserInfo({ address, effectiveAddress, externalUserId, apiKey, isExternalUserIdAddress, loginType, connectorName, ensName, ensAvatar, }: {
27
+ address: Address | undefined;
28
+ effectiveAddress: Address | undefined;
29
+ externalUserId: string | undefined;
30
+ apiKey: string;
31
+ isExternalUserIdAddress: boolean;
32
+ loginType: LoginType;
33
+ connectorName: string | undefined;
34
+ ensName: string | null | undefined;
35
+ ensAvatar: string | null | undefined;
36
+ }): FunkitUserInfo;
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  bifrostWallet
4
- } from "../chunk-6DRCY52E.js";
5
- import "../chunk-YYYRPQHB.js";
4
+ } from "../chunk-OD6B2ISG.js";
6
5
  import "../chunk-FMVNQKZL.js";
6
+ import "../chunk-YYYRPQHB.js";
7
7
  import "../chunk-3K2MFXCO.js";
8
8
  export {
9
9
  bifrostWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  bitgetWallet
4
- } from "../chunk-YIEASHLS.js";
5
- import "../chunk-YYYRPQHB.js";
4
+ } from "../chunk-IMNI4AGV.js";
6
5
  import "../chunk-FMVNQKZL.js";
6
+ import "../chunk-YYYRPQHB.js";
7
7
  import "../chunk-3K2MFXCO.js";
8
8
  export {
9
9
  bitgetWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  bybitWallet
4
- } from "../chunk-DEFRRPXB.js";
5
- import "../chunk-YYYRPQHB.js";
4
+ } from "../chunk-7IEUTLHY.js";
6
5
  import "../chunk-FMVNQKZL.js";
6
+ import "../chunk-YYYRPQHB.js";
7
7
  import "../chunk-3K2MFXCO.js";
8
8
  export {
9
9
  bybitWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  clvWallet
4
- } from "../chunk-5TN5Z2WY.js";
5
- import "../chunk-YYYRPQHB.js";
4
+ } from "../chunk-3ZJN3PXP.js";
6
5
  import "../chunk-FMVNQKZL.js";
6
+ import "../chunk-YYYRPQHB.js";
7
7
  import "../chunk-3K2MFXCO.js";
8
8
  export {
9
9
  clvWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  coin98Wallet
4
- } from "../chunk-XVBSJCW5.js";
5
- import "../chunk-YYYRPQHB.js";
4
+ } from "../chunk-RZQ4B4Z7.js";
6
5
  import "../chunk-FMVNQKZL.js";
6
+ import "../chunk-YYYRPQHB.js";
7
7
  import "../chunk-3K2MFXCO.js";
8
8
  export {
9
9
  coin98Wallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  coreWallet
4
- } from "../chunk-V6UOWTEZ.js";
5
- import "../chunk-YYYRPQHB.js";
4
+ } from "../chunk-55VS2NKG.js";
6
5
  import "../chunk-FMVNQKZL.js";
6
+ import "../chunk-YYYRPQHB.js";
7
7
  import "../chunk-3K2MFXCO.js";
8
8
  export {
9
9
  coreWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  foxWallet
4
- } from "../chunk-ZPSPK6LH.js";
5
- import "../chunk-YYYRPQHB.js";
4
+ } from "../chunk-YGMU5VWD.js";
6
5
  import "../chunk-FMVNQKZL.js";
6
+ import "../chunk-YYYRPQHB.js";
7
7
  import "../chunk-3K2MFXCO.js";
8
8
  export {
9
9
  foxWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  frontierWallet
4
- } from "../chunk-UDTBQV4Q.js";
5
- import "../chunk-YYYRPQHB.js";
4
+ } from "../chunk-J3PJOMO7.js";
6
5
  import "../chunk-FMVNQKZL.js";
6
+ import "../chunk-YYYRPQHB.js";
7
7
  import "../chunk-3K2MFXCO.js";
8
8
  export {
9
9
  frontierWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  gateWallet
4
- } from "../chunk-VJZWNQOF.js";
5
- import "../chunk-YYYRPQHB.js";
4
+ } from "../chunk-LEAZMT5Y.js";
6
5
  import "../chunk-FMVNQKZL.js";
6
+ import "../chunk-YYYRPQHB.js";
7
7
  import "../chunk-3K2MFXCO.js";
8
8
  export {
9
9
  gateWallet