@funkit/connect 9.24.0-next.0 → 9.25.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 (108) hide show
  1. package/CHANGELOG.md +50 -4
  2. package/dist/clients/aave.d.ts +9 -0
  3. package/dist/clients/aave.js +4 -1
  4. package/dist/clients/{chunk-4HCOSF4M.js → chunk-7G3QEQFB.js} +2 -2
  5. package/dist/clients/{chunk-7FIVHWNC.js → chunk-7UIDHSYG.js} +47 -0
  6. package/dist/clients/{chunk-UUHGOBKZ.js → chunk-AHYOV7AV.js} +2 -1
  7. package/dist/clients/{chunk-S7FRYR55.js → chunk-ME4OAQIY.js} +1 -1
  8. package/dist/clients/{chunk-CEBG7XQ5.js → chunk-MXPZTW2H.js} +212 -1126
  9. package/dist/clients/chunk-SQ2RX7WY.js +1110 -0
  10. package/dist/clients/{chunk-KWIR3HO4.js → chunk-VJZW3MA3.js} +1 -1
  11. package/dist/clients/{chunk-MRBN4XCA.js → chunk-ZEXZQOAO.js} +1 -1
  12. package/dist/clients/fanatics.css +1 -1
  13. package/dist/clients/fanatics.js +4 -6
  14. package/dist/clients/lighter.css +2816 -1
  15. package/dist/clients/lighter.js +44 -28
  16. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +217 -222
  17. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +7 -8
  18. package/dist/clients/polymarket/createPolymarketDepositConfig.js +3 -3
  19. package/dist/clients/polymarket/index.css +217 -222
  20. package/dist/clients/polymarket/index.js +7 -8
  21. package/dist/clients/polymarket/polymarket.js +2 -2
  22. package/dist/clients/polymarket/usePolymarketAccountBalances.js +2 -2
  23. package/dist/clients/rolly.js +1 -1
  24. package/dist/components/FunCheckoutHistory/FunCheckoutHistoryContent.d.ts +1 -2
  25. package/dist/components/FunTooltip/FunTooltip.d.ts +10 -5
  26. package/dist/components/FunTransactionSummary/DestinationHealthFactorRow.d.ts +15 -0
  27. package/dist/components/FunTransactionSummary/DestinationYieldRows.d.ts +1 -0
  28. package/dist/components/FunTransactionSummary/PaymentAmountSummary.d.ts +2 -1
  29. package/dist/components/FunTransactionSummary/PaymentMethodSummary.d.ts +8 -1
  30. package/dist/domains/aave.d.ts +14 -9
  31. package/dist/domains/nado.d.ts +9 -0
  32. package/dist/hooks/track/CheckoutModalEvent.d.ts +0 -1
  33. package/dist/hooks/track/WithdrawModalEvent.d.ts +9 -1
  34. package/dist/hooks/useGetAssetHoldingsFromRpc.d.ts +23 -0
  35. package/dist/hooks/useInjectedAssetHoldings.d.ts +23 -0
  36. package/dist/hooks/useXstockAssetHoldings.d.ts +15 -0
  37. package/dist/hooks/useXstocksWrappedTokenAddress.d.ts +16 -0
  38. package/dist/index.css +11 -16
  39. package/dist/index.js +4696 -4117
  40. package/dist/modals/CheckoutModal/CheckoutComplete/CheckoutComplete.d.ts +1 -1
  41. package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +0 -1
  42. package/dist/modals/CheckoutModal/InputAmount/useNadoDirectTransfer.d.ts +64 -0
  43. package/dist/modals/CheckoutModal/SelectAsset/SelectAsset.d.ts +1 -1
  44. package/dist/modals/CheckoutModal/stepTransition.d.ts +0 -3
  45. package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +25 -4
  46. package/dist/modals/WithdrawalModal/WithdrawAmountInput.d.ts +10 -1
  47. package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +8 -1
  48. package/dist/modals/WithdrawalModal/WithdrawalSwappedIframeController.d.ts +11 -0
  49. package/dist/modals/WithdrawalModal/types.d.ts +1 -0
  50. package/dist/providers/FunkitCheckoutContext/types.d.ts +29 -12
  51. package/dist/utils/assets.d.ts +7 -0
  52. package/dist/utils/checkoutHistory.d.ts +1 -5
  53. package/dist/utils/customer.d.ts +6 -0
  54. package/dist/wallets/walletConnectors/index.js +50 -50
  55. package/package.json +6 -6
  56. package/dist/__generated__/default_configs.d.ts +0 -901
  57. package/dist/__generated__/default_feature_gates.d.ts +0 -20
  58. package/dist/clients/chunk-25ICASD7.js +0 -2371
  59. package/dist/clients/chunk-3GO74QTP.js +0 -2382
  60. package/dist/clients/chunk-7GWX2ZS4.js +0 -69
  61. package/dist/clients/chunk-7HNGV6JU.js +0 -54
  62. package/dist/clients/chunk-A32VN2DX.js +0 -2382
  63. package/dist/clients/chunk-ELLXM7RO.js +0 -186
  64. package/dist/clients/chunk-GGXTLJ7J.js +0 -290
  65. package/dist/clients/chunk-GUWXVR5S.js +0 -186
  66. package/dist/clients/chunk-HRWCNZJA.js +0 -230
  67. package/dist/clients/chunk-JBWB54MX.js +0 -69
  68. package/dist/clients/chunk-JD3FIVZ7.js +0 -69
  69. package/dist/clients/chunk-JTGKAPID.js +0 -2382
  70. package/dist/clients/chunk-L7PABCF2.js +0 -54
  71. package/dist/clients/chunk-LII3SVUH.js +0 -230
  72. package/dist/clients/chunk-NCUPPJ2Z.js +0 -2382
  73. package/dist/clients/chunk-NPPIETHZ.js +0 -54
  74. package/dist/clients/chunk-NUJ6ZM5F.js +0 -186
  75. package/dist/clients/chunk-UVWNEQMD.js +0 -186
  76. package/dist/clients/chunk-VVTNR7YH.js +0 -2382
  77. package/dist/clients/chunk-YYMIRDCQ.js +0 -230
  78. package/dist/clients/chunk-ZNVFASTH.js +0 -54
  79. package/dist/clients/nado.d.ts +0 -78
  80. package/dist/clients/nado.js +0 -107
  81. package/dist/clients/polymarket.d.ts +0 -161
  82. package/dist/clients/polymarket.js +0 -688
  83. package/dist/components/FunCheckoutHistory/FunCheckoutHistoryHelp.d.ts +0 -10
  84. package/dist/interfaces/logTransport.d.ts +0 -51
  85. package/dist/interfaces/swapped-transport.d.ts +0 -78
  86. package/dist/modals/CheckoutModal/CheckoutHelp/CheckoutHelp.d.ts +0 -9
  87. package/dist/modals/CheckoutModal/SourceChange/EmptyFormOfPaymentsMessage.d.ts +0 -4
  88. package/dist/modals/CheckoutModal/SourceChange/useUpdateSourceAssetForCard.d.ts +0 -4
  89. package/dist/modals/CheckoutModal/SwappedIframe/SwappedErrorMessage.d.ts +0 -6
  90. package/dist/utils/flags/resolver.d.ts +0 -34
  91. package/dist/wallets/walletConnectors/chunk-4NV5BYRP.js +0 -95
  92. package/dist/wallets/walletConnectors/chunk-AVDUNQUW.js +0 -96
  93. package/dist/wallets/walletConnectors/chunk-GUQM4QSL.js +0 -66
  94. package/dist/wallets/walletConnectors/chunk-IULPZP2Q.js +0 -69
  95. package/dist/wallets/walletConnectors/chunk-JPN6TWIT.js +0 -92
  96. package/dist/wallets/walletConnectors/chunk-KCRO2AGO.js +0 -106
  97. package/dist/wallets/walletConnectors/chunk-KI5Y2BBF.js +0 -94
  98. package/dist/wallets/walletConnectors/chunk-NR2OGDHQ.js +0 -103
  99. package/dist/wallets/walletConnectors/chunk-OEEGYENV.js +0 -87
  100. package/dist/wallets/walletConnectors/chunk-OX37G4YT.js +0 -98
  101. package/dist/wallets/walletConnectors/chunk-SWFF3TWJ.js +0 -100
  102. package/dist/wallets/walletConnectors/chunk-TKB2OY6G.js +0 -99
  103. package/dist/wallets/walletConnectors/chunk-W2LCLDPX.js +0 -70
  104. package/dist/wallets/walletConnectors/chunk-WAHGI5L7.js +0 -96
  105. package/dist/wallets/walletConnectors/chunk-WKNQMP4A.js +0 -93
  106. package/dist/wallets/walletConnectors/chunk-XCNHV3HS.js +0 -110
  107. package/dist/wallets/walletConnectors/chunk-YO2K4MBH.js +0 -218
  108. package/dist/wallets/walletConnectors/chunk-YQFGVZGR.js +0 -92
@@ -10,4 +10,4 @@ export type ConfirmationStepNext = {
10
10
  };
11
11
  export declare const CheckoutCompleteInfo: ModalStepInfo<FunCheckoutStep.CHECKOUT_COMPLETE>;
12
12
  /** A checkout detail component to handle redirecting to the checkout history page */
13
- export declare function CheckoutComplete({ modalState, onClose, onNext, onAnimationComplete, }: ModalStepComponentProps<FunCheckoutStep.CHECKOUT_COMPLETE>): React.JSX.Element;
13
+ export declare function CheckoutComplete({ modalState, onClose, onAnimationComplete, }: ModalStepComponentProps<FunCheckoutStep.CHECKOUT_COMPLETE>): React.JSX.Element;
@@ -5,7 +5,6 @@ export declare enum FunCheckoutStep {
5
5
  CONFIRMATION = "confirmation",
6
6
  SELECT_ASSET = "select_asset",
7
7
  CHECKOUT_COMPLETE = "checkout_complete",
8
- CHECKOUT_HELP = "checkout_help",
9
8
  TRANSFER_TOKEN = "transfer_token",
10
9
  LIGHTNING_INVOICE = "lightning_invoice",
11
10
  CREATE_FIAT_ACCOUNT = "create_fiat_account",
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Nado direct-transfer fast-path: a same-token same-chain deposit is a single
3
+ * ERC-20 transfer to the subaccount DDA (`customRecipient`), bypassing
4
+ * Relay/quoteV2 (which can't price a QQQx → QQQx "route"). Signs the transfer
5
+ * and records a direct execution for history parity. Mirrors `useAaveNativeSupply`.
6
+ */
7
+ import type { Dnum } from 'dnum';
8
+ import { type Hex } from 'viem';
9
+ import { type CheckoutConfirmationError } from '../../../domains/checkoutErrors';
10
+ import type { FunkitCheckoutConfig } from '../../../providers/FunkitCheckoutContext';
11
+ /**
12
+ * Base-unit string for the transfer + DE record. Dnum present → exact;
13
+ * otherwise derive from `assetAmount` + `decimals`. Neither → `'0'` + warn.
14
+ */
15
+ export declare function getTransferAmountBaseUnit(tokenAmountBaseUnit: Dnum | null, fallbackAssetAmount: number | undefined, decimals: number | null): bigint;
16
+ interface UseNadoDirectTransferResult {
17
+ /** Reads the committed amount/source from `checkoutItem` and executes. */
18
+ submit: () => Promise<{
19
+ txHash: Hex;
20
+ } | null>;
21
+ isPending: boolean;
22
+ error: CheckoutConfirmationError | null;
23
+ /**
24
+ * Whether this checkout takes the direct-transfer fast-path. True when all
25
+ * hold: the customer is Nado, `customRecipient` is set, and the selected
26
+ * source token (`checkoutItem.selectedSourceAssetInfo`) is the target token
27
+ * or its wrapper on the same chain. False until a source is selected and,
28
+ * for a wrapper source, until the wrapper address resolves.
29
+ */
30
+ isApplicable: boolean;
31
+ }
32
+ interface NadoDirectTransferContextArgs {
33
+ apiKey: string;
34
+ sourceAsset: {
35
+ chainId: string | number;
36
+ address: string;
37
+ };
38
+ checkoutConfig: Pick<FunkitCheckoutConfig, 'targetChain' | 'targetAsset' | 'customRecipient'>;
39
+ /**
40
+ * The target token's wrapped version (xStocks `wrapperAddressV2`) on the target
41
+ * chain. A held wrapped-token balance (e.g. wSPYx for SPYx) is an equivalent
42
+ * direct-transfer source. Resolved by `useXstocksWrappedTokenAddress`; omit
43
+ * when there's none.
44
+ */
45
+ wrappedTokenAddress?: string;
46
+ }
47
+ /**
48
+ * True when: the customer is Nado, the checkout has an explicit recipient (the
49
+ * subaccount DDA), and the source matches the target token or its wrapper (same
50
+ * chain). When true the deposit is a direct ERC-20 transfer, not a Relay swap.
51
+ *
52
+ * Kept customer-gated (not purely config-driven) to bound blast radius — only
53
+ * Nado should route through the direct-transfer path until it's proven out.
54
+ */
55
+ export declare function isNadoDirectTransferContext({ apiKey, sourceAsset, checkoutConfig, wrappedTokenAddress, }: NadoDirectTransferContextArgs): boolean;
56
+ /**
57
+ * Predicate over a source asset: does it qualify for the Nado direct-transfer fast-path?
58
+ */
59
+ export declare function useIsNadoDirectTransferSource(): (source: {
60
+ chainId: string | number;
61
+ address: string;
62
+ }) => boolean;
63
+ export declare function useNadoDirectTransfer(): UseNadoDirectTransferResult;
64
+ export {};
@@ -15,4 +15,4 @@ export type SelectAssetNext = {
15
15
  };
16
16
  export declare const SelectAssetInfo: ModalStepInfo<FunCheckoutStep.SELECT_ASSET>;
17
17
  export declare function SelectAsset({ modalState, onNext, onClose, }: ModalStepComponentProps<FunCheckoutStep.SELECT_ASSET>): React.JSX.Element;
18
- export declare function isTreatedAsNativeToken(apiKey: string, asset: AssetHoldingsItem, dynamicTargetAssetCandidates: DynamicTargetAssetCandidate[], findDynamicPath: IndexedDynamicRoutingConfig[string]['findPath'], isUserSelected: boolean): boolean;
18
+ export declare function isTreatedAsNativeToken(apiKey: string, asset: AssetHoldingsItem, dynamicTargetAssetCandidates: DynamicTargetAssetCandidate[], findDynamicPath: IndexedDynamicRoutingConfig[string]['findPath'], isUserSelected: boolean, isDirectTokenTransfer?: boolean): boolean;
@@ -11,7 +11,6 @@ import { type BrokerageTwoFANext, type BrokerageTwoFAState } from './Brokerage/B
11
11
  import { type ConnectExchangeNext, type ConnectExchangeState } from './Brokerage/ConnectExchange';
12
12
  import { type SelectBrokerageNext, type SelectBrokerageState } from './Brokerage/SelectBrokerage';
13
13
  import { type CheckoutCompleteNext, type CheckoutCompleteState } from './CheckoutComplete/CheckoutComplete';
14
- import { type CheckoutHelpState } from './CheckoutHelp/CheckoutHelp';
15
14
  import { type ConfirmationStepNext, type ConfirmationStepState } from './ConfirmationStep/ConfirmationStep';
16
15
  import { FunCheckoutStep } from './FunCheckoutStep';
17
16
  import { type InputAmountNext, type InputAmountState } from './InputAmount/InputAmount';
@@ -102,7 +101,6 @@ export declare const CheckoutModalSteps: {
102
101
  export type CheckoutModalState<S extends FunCheckoutStep = FunCheckoutStep> = {
103
102
  [T in S]: {
104
103
  [FunCheckoutStep.CHECKOUT_COMPLETE]: CheckoutCompleteState;
105
- [FunCheckoutStep.CHECKOUT_HELP]: CheckoutHelpState;
106
104
  [FunCheckoutStep.CONFIRMATION]: ConfirmationStepState;
107
105
  [FunCheckoutStep.INPUT_AMOUNT]: InputAmountState;
108
106
  [FunCheckoutStep.LOADING_ACCOUNT]: LoadingAccountState;
@@ -133,7 +131,6 @@ export type CheckoutModalState<S extends FunCheckoutStep = FunCheckoutStep> = {
133
131
  };
134
132
  }[S];
135
133
  export type NextPayload<S extends FunCheckoutStep = FunCheckoutStep> = {
136
- [FunCheckoutStep.CHECKOUT_HELP]: null;
137
134
  [FunCheckoutStep.CHECKOUT_COMPLETE]: CheckoutCompleteNext;
138
135
  [FunCheckoutStep.CONFIRMATION]: ConfirmationStepNext;
139
136
  [FunCheckoutStep.INPUT_AMOUNT]: InputAmountNext;
@@ -8,6 +8,24 @@ import React from 'react';
8
8
  import type { CustomWithdrawalConfig, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
9
9
  import type { LighterShare } from '../../utils/customer';
10
10
  import type { SourceTokenOption } from './WithdrawAmountInput';
11
+ /** Stable method ids for the Fast / Secure options (used for tracking + switching). */
12
+ export declare const LIGHTER_FAST_METHOD_ID = "lighter-fast";
13
+ export declare const LIGHTER_SECURE_METHOD_ID = "lighter-secure";
14
+ /**
15
+ * Upper bound on a single Lighter Fast withdrawal, in USD. Amounts above this
16
+ * block the CTA and surface the "submit a Secure withdrawal" footer. Fast is
17
+ * USDC Perps only (price = 1), so this is also the token-unit cap.
18
+ * {@link LIGHTER_FAST_MAX_WITHDRAWAL_LABEL} must stay in sync with this value.
19
+ */
20
+ export declare const LIGHTER_FAST_MAX_WITHDRAWAL_USD = 3000000;
21
+ /**
22
+ * Footer shown beneath the CTA when a Lighter Fast amount exceeds the $3M cap.
23
+ * Renders as the `description` of a FunNotification, which supplies the shared
24
+ * notification typography; offers an inline link to switch to the Secure method.
25
+ */
26
+ export declare function LighterFastMaxExceededMessage({ onSwitchToSecure, }: {
27
+ onSwitchToSecure: () => void;
28
+ }): React.JSX.Element;
11
29
  /** Free (withdrawable) balance for a single Lighter asset: balance - locked. */
12
30
  export declare function freeBalance(balance: string, lockedBalance: string): string;
13
31
  /**
@@ -84,6 +102,7 @@ export declare function useLighterWithdrawal(config: FunkitWithdrawalConfig, set
84
102
  lighterBalances: Record<string, string>;
85
103
  lighterAssets: import("../../utils/customer").LighterAsset[];
86
104
  lighterFastUnstakedFee: number;
105
+ invalidateLighterAccount: () => void;
87
106
  };
88
107
  /**
89
108
  * Resolves the source-token dropdown options for a Lighter customer.
@@ -93,15 +112,17 @@ export declare function useLighterSourceTokenOptions(config: FunkitWithdrawalCon
93
112
  symbol: string;
94
113
  }[]): SourceTokenOption[] | undefined;
95
114
  /**
96
- * Lighter Secure: read-only recipient address display.
97
- * The address is locked to the connected wallet.
115
+ * Lighter Secure: recipient address, locked to the connected wallet. A
116
+ * read-only `FunInput` (not a `<div>`) keeps it focusable and announced by
117
+ * screen readers; the hover tooltip explains the lock.
98
118
  */
99
119
  export declare function LighterSecureAddressDisplay({ address }: {
100
120
  address: string;
101
121
  }): React.JSX.Element;
102
122
  /**
103
- * Lighter Secure: display-only receive token + chain. Both are locked —
104
- * token matches the source asset, chain is always Ethereum mainnet.
123
+ * Lighter Secure: display-only receive token + chain. Both are locked — the
124
+ * token always matches the source asset, and the destination chain is always
125
+ * Ethereum mainnet. Each field surfaces a hover tooltip explaining the lock.
105
126
  */
106
127
  export declare function LighterSecureReceiveDisplay({ sourceTokenSymbol, }: {
107
128
  sourceTokenSymbol: string;
@@ -6,13 +6,22 @@ export interface SourceTokenOption {
6
6
  label: string;
7
7
  iconSrc?: string;
8
8
  }
9
- export declare function WithdrawAmountInput({ withdrawalInputAmount, setWithdrawalInputAmount, sourceTokenBalance, isWithdrawAmountTooLow, isWithdrawAmountValid, minWithdrawalDisplayValue, config, sourceTokenOptions, onSourceTokenChange, selectedSourceToken, sourceTokenUsdPrice, }: {
9
+ export declare function WithdrawAmountInput({ withdrawalInputAmount, setWithdrawalInputAmount, sourceTokenBalance, isWithdrawAmountTooLow, isWithdrawAmountTooHigh, isWithdrawAmountAboveBalance, isWithdrawAmountValid, minWithdrawalDisplayValue, config, sourceTokenOptions, onSourceTokenChange, selectedSourceToken, sourceTokenUsdPrice, }: {
10
10
  config: Exclude<FunkitWithdrawalConfig, MultiMethodWithdrawalConfig>;
11
11
  sourceTokenBalance: string;
12
12
  /** User-entered amount in source-token units (e.g. "0.5" for 0.5 ETH). */
13
13
  withdrawalInputAmount: string;
14
14
  setWithdrawalInputAmount: (s: string) => void;
15
15
  isWithdrawAmountTooLow: boolean;
16
+ /**
17
+ * Amount exceeds the configured max. The over-cap explanation lives in the
18
+ * bottom-bar footer, so the inline input error is suppressed — but only when
19
+ * the amount is otherwise affordable. If it also exceeds the balance,
20
+ * "Insufficient balance" still shows (see below).
21
+ */
22
+ isWithdrawAmountTooHigh: boolean;
23
+ /** Amount exceeds the available balance — takes priority over the over-cap hint. */
24
+ isWithdrawAmountAboveBalance: boolean;
16
25
  isWithdrawAmountValid: boolean;
17
26
  /**
18
27
  * Minimum-withdrawal value formatted for display. Token units when the
@@ -11,6 +11,11 @@ interface WithdrawContentProps {
11
11
  onContinue: (withdrawal: WithdrawalFormData, txHash: Hex) => void;
12
12
  config: FunkitWithdrawalConfig;
13
13
  withdrawalItem: FunkitActiveWithdrawalItem | null;
14
+ /**
15
+ * Switch a Lighter Fast withdrawal to the Lighter Secure method. Wired by
16
+ * {@link WithdrawalModal}; used by the over-$3M footer.
17
+ */
18
+ onSwitchToSecure?: () => void;
14
19
  }
15
20
  /**
16
21
  * Converts a source-token amount string to its USD value using the given unit
@@ -40,6 +45,8 @@ export declare function isValidWithdrawal({ config, checkoutConfig, withdrawalIn
40
45
  isValidAddress: boolean;
41
46
  isValidAddressAndChain: boolean;
42
47
  isWithdrawAmountTooLow: boolean;
48
+ isWithdrawAmountTooHigh: boolean;
49
+ isWithdrawAmountAboveBalance: boolean;
43
50
  isWithdrawAmountValid: boolean;
44
51
  minWithdrawalDisplayValue: number;
45
52
  };
@@ -55,5 +62,5 @@ export declare const useFrozenSourceTokenBalance: ({ isWithdrawing, sourceTokenB
55
62
  * Currently returns a single option per config; expands when Lighter exposes
56
63
  * multi-asset API support.
57
64
  */
58
- export declare const WithdrawContent: ({ onContinue, config, withdrawalItem, }: WithdrawContentProps) => React.JSX.Element;
65
+ export declare const WithdrawContent: ({ onContinue, config, withdrawalItem, onSwitchToSecure, }: WithdrawContentProps) => React.JSX.Element;
59
66
  export {};
@@ -0,0 +1,11 @@
1
+ import type { SwappedFormOfPayment } from '@funkit/api-base';
2
+ import React from 'react';
3
+ interface WithdrawalSwappedIframeControllerProps {
4
+ selectedFop: SwappedFormOfPayment;
5
+ isError: boolean;
6
+ onError: () => void;
7
+ onBack: () => void;
8
+ onClose: () => void;
9
+ }
10
+ export declare function WithdrawalSwappedIframeController({ selectedFop, isError, onError, onBack, onClose, }: WithdrawalSwappedIframeControllerProps): React.JSX.Element;
11
+ export {};
@@ -1,6 +1,7 @@
1
1
  export declare enum WithdrawalModalStep {
2
2
  SELECT_METHOD = "SELECT_METHOD",
3
3
  ENTER_AMOUNT = "ENTER_AMOUNT",
4
+ SWAPPED_IFRAME = "SWAPPED_IFRAME",
4
5
  SUCCESS = "SUCCESS",
5
6
  PENDING_CALLBACK = "PENDING_CALLBACK"
6
7
  }
@@ -116,6 +116,20 @@ export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'gen
116
116
  /** Whether the supply is/will be enabled as collateral for the user. */
117
117
  collateralizationEnabled?: boolean;
118
118
  };
119
+ /**
120
+ * Integrator-provided health-factor resolver for a lending supply (e.g. Aave).
121
+ * The SDK never computes health factor — the integrator owns the math (run
122
+ * against live position data with the protocol's own library, e.g.
123
+ * `@aave/math-utils`) so it matches the protocol app exactly. The SDK calls
124
+ * this at the confirmation step with the live supply amount (the target
125
+ * asset, human units) and renders the result as a Health factor (before →
126
+ * after) row. Return `null` when the position data isn't ready, or for an
127
+ * infinite/no-debt health factor return `"-1"` (rendered as ∞).
128
+ */
129
+ resolveHealthFactor?: (targetAssetHumanAmount: string) => {
130
+ before: string | null;
131
+ after: string | null;
132
+ } | null;
119
133
  /** Icon to show in the checkout modal (50px x 50px). If not specified, no icon will be shown. **/
120
134
  iconSrc?: null | string;
121
135
  /** Title of the item being checked out. e.g. Staked Ether, XYZ Option, Solar Bond ABC **/
@@ -197,6 +211,12 @@ export interface WithdrawalConfigBase {
197
211
  * Used when the source token can vary (e.g. Lighter Secure withdrawal).
198
212
  */
199
213
  getMinWithdrawalAmount?: (symbol: string) => number;
214
+ /**
215
+ * Maximum USD value allowed for a single withdrawal. Amounts above this block
216
+ * the CTA (which switches to "Max amount exceeded"). Omit for no upper bound.
217
+ * Mirrors {@link getMinWithdrawalUSD}.
218
+ */
219
+ getMaxWithdrawalUSD?: (asset: TokenInfo) => number;
200
220
  /**
201
221
  * Returns the current withdrawable balance for the source token.
202
222
  * Called on every render — use a ref-backed stable callback so the value
@@ -204,19 +224,13 @@ export interface WithdrawalConfigBase {
204
224
  */
205
225
  withdrawalSourceTokenBalance?: () => string | number;
206
226
  /**
207
- * Optional async hook fired the moment the user commits to the withdrawal —
208
- * after they tap the withdraw CTA but **before** the SDK fetches any nonce,
209
- * prompts the wallet to sign, or submits the transaction. It is awaited, so
210
- * async work completes before signing begins.
211
- *
212
- * The motivating case is venues where automated activity shares the signing
213
- * account: cancelling in-flight strategies here guarantees the withdrawal's
214
- * signing nonce is still valid by the time the wallet prompt fires.
227
+ * Optional async hook fired when the user commits to the withdrawal — after
228
+ * the withdraw CTA, but before any nonce fetch, wallet signature, or tx
229
+ * submission. Awaited, so async work completes before signing begins.
215
230
  *
216
- * Throw to abort the withdrawal — the thrown error message is surfaced to the
217
- * user verbatim in the standard error UI, and no nonce is consumed. Runs on
218
- * every withdrawal method and before
219
- * {@link WalletWithdrawalConfig['preWithdrawalAction']}.
231
+ * Throw to abort: the error message is surfaced to the user verbatim and no
232
+ * nonce is consumed. Runs on every withdrawal method, before
233
+ * {@link WalletWithdrawalConfig.preWithdrawalAction}.
220
234
  */
221
235
  onBeforeSign?: () => Promise<void> | void;
222
236
  }
@@ -388,6 +402,9 @@ export interface FunkitActiveCheckoutItem extends Omit<ApiCheckoutClientMetadata
388
402
  symbol: string | null;
389
403
  chainId: string;
390
404
  iconSrc: string | null;
405
+ /** Source token decimals, when known — lets later screens reconstruct
406
+ * base-unit amounts. */
407
+ decimals?: number;
391
408
  };
392
409
  /** Time of completion of the active checkout item. For frontend use only. **/
393
410
  completedTimestampMs: number | null;
@@ -1,4 +1,11 @@
1
1
  import type { DynamicTargetAssetCandidate, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
2
2
  export type { AssetHoldingsItem, AssetHoldingsMap, KnownAssetHoldingsItem, } from '../domains/wallet';
3
3
  export declare const getNormalizedTokenBalance: (tokenBalance: bigint | number | string, decimals: number) => number;
4
+ /**
5
+ * The dynamic-target candidate matching the checkout's *active* target token
6
+ * (`targetAsset`/`targetChain`), by token-equivalence. Distinct from
7
+ * `getDefaultDynamicTargetAsset`, which resolves the *default to display* via
8
+ * routingId/ticker/isDefault
9
+ */
10
+ export declare const getActiveDynamicTargetAsset: (checkoutConfig: FunkitCheckoutConfig | undefined) => DynamicTargetAssetCandidate | undefined;
4
11
  export declare const getDefaultDynamicTargetAsset: (checkoutConfig: FunkitCheckoutConfig | undefined) => DynamicTargetAssetCandidate;
@@ -1,11 +1,7 @@
1
1
  import type { CheckoutHistoryItem } from '@funkit/api-base';
2
2
  export declare enum HistoryContentPages {
3
- DETAIL = "detail",
4
- HELP = "help"
3
+ DETAIL = "detail"
5
4
  }
6
- export declare function getLatestReportSubmitTime(): number;
7
- export declare function setLatestReportSubmitTime(timeMs: number): void;
8
- export declare function clearLatestWalletId(): void;
9
5
  /**
10
6
  * Get the checkout completion time in seconds
11
7
  * @param checkout
@@ -414,3 +414,9 @@ export declare function useLighterAccounts({ address, }: {
414
414
  fetchStatus: import("@tanstack/react-query").FetchStatus;
415
415
  promise: Promise<LighterAccountsByL1AddressResponse>;
416
416
  };
417
+ /**
418
+ * Returns a callback that invalidates the cached Lighter account queries so the
419
+ * balance refetches eagerly (e.g. right after a withdrawal). No-op for
420
+ * non-Lighter customers.
421
+ */
422
+ export declare function useInvalidateLighterAccount(): () => void;
@@ -1,136 +1,136 @@
1
1
  "use client";
2
+ import {
3
+ zealWallet
4
+ } from "./chunk-52QXXLDS.js";
2
5
  import {
3
6
  zerionWallet
4
7
  } from "./chunk-RVOY537T.js";
5
- import {
6
- xdefiWallet
7
- } from "./chunk-JN5I3DNC.js";
8
8
  import {
9
9
  tahoWallet
10
10
  } from "./chunk-7ZYCBDQ4.js";
11
+ import {
12
+ talismanWallet
13
+ } from "./chunk-4DCO3TGL.js";
11
14
  import {
12
15
  tokenPocketWallet
13
16
  } from "./chunk-HTHAK6XB.js";
17
+ import {
18
+ tokenaryWallet
19
+ } from "./chunk-VH3THHJY.js";
14
20
  import {
15
21
  trustWallet
16
22
  } from "./chunk-ZNX4EMPB.js";
17
- import {
18
- talismanWallet
19
- } from "./chunk-4DCO3TGL.js";
20
23
  import {
21
24
  uniswapWallet
22
25
  } from "./chunk-Z3PPW6NC.js";
23
- import {
24
- tokenaryWallet
25
- } from "./chunk-VH3THHJY.js";
26
26
  import {
27
27
  walletConnectWallet
28
28
  } from "./chunk-3FCWJRI4.js";
29
29
  import {
30
- zealWallet
31
- } from "./chunk-52QXXLDS.js";
32
- import {
33
- rainbowWallet
34
- } from "./chunk-2VP2F6EK.js";
30
+ xdefiWallet
31
+ } from "./chunk-JN5I3DNC.js";
35
32
  import {
36
33
  rabbyWallet
37
34
  } from "./chunk-RB66PKPA.js";
38
35
  import {
39
- roninWallet
40
- } from "./chunk-VAPGUPHO.js";
36
+ rainbowWallet
37
+ } from "./chunk-2VP2F6EK.js";
41
38
  import {
42
39
  ramperWallet
43
40
  } from "./chunk-OQB55QXP.js";
44
41
  import {
45
- safeWallet
46
- } from "./chunk-RCY66YHF.js";
42
+ roninWallet
43
+ } from "./chunk-VAPGUPHO.js";
47
44
  import {
48
45
  safeheronWallet
49
46
  } from "./chunk-76S7R2ND.js";
50
47
  import {
51
48
  safepalWallet
52
49
  } from "./chunk-VTM6EECM.js";
50
+ import {
51
+ safeWallet
52
+ } from "./chunk-RCY66YHF.js";
53
53
  import {
54
54
  subWallet
55
55
  } from "./chunk-X6CGV36L.js";
56
56
  import {
57
57
  metaMaskWallet
58
58
  } from "./chunk-CCQV2ZET.js";
59
- import {
60
- mewWallet
61
- } from "./chunk-MQM45ADF.js";
62
59
  import {
63
60
  oktoWallet
64
61
  } from "./chunk-YWOVAU6O.js";
65
62
  import {
66
63
  okxWallet
67
64
  } from "./chunk-STVVP43G.js";
68
- import {
69
- oneInchWallet
70
- } from "./chunk-QG6ZHI7B.js";
71
65
  import {
72
66
  omniWallet
73
67
  } from "./chunk-2CX7LX4J.js";
74
68
  import {
75
- phantomWallet
76
- } from "./chunk-QY53O7WG.js";
69
+ oneInchWallet
70
+ } from "./chunk-QG6ZHI7B.js";
71
+ import {
72
+ mewWallet
73
+ } from "./chunk-MQM45ADF.js";
77
74
  import {
78
75
  oneKeyWallet
79
76
  } from "./chunk-WVT6BBJH.js";
80
77
  import {
81
- desigWallet
82
- } from "./chunk-FW3WZETT.js";
78
+ phantomWallet
79
+ } from "./chunk-QY53O7WG.js";
83
80
  import {
84
- frameWallet
85
- } from "./chunk-BU3ZAT5X.js";
81
+ foxWallet
82
+ } from "./chunk-MIQTHJ6X.js";
86
83
  import {
87
84
  frontierWallet
88
85
  } from "./chunk-YEZM4CK4.js";
86
+ import {
87
+ frameWallet
88
+ } from "./chunk-BU3ZAT5X.js";
89
89
  import {
90
90
  gateWallet
91
91
  } from "./chunk-HNRB7KJU.js";
92
- import {
93
- injectedWallet
94
- } from "./chunk-T6LGKC3F.js";
95
- import {
96
- kresusWallet
97
- } from "./chunk-RICTB3FA.js";
98
92
  import {
99
93
  imTokenWallet
100
94
  } from "./chunk-WNAGGFMG.js";
95
+ import {
96
+ injectedWallet
97
+ } from "./chunk-T6LGKC3F.js";
101
98
  import {
102
99
  ledgerWallet
103
100
  } from "./chunk-RPV27V2Y.js";
101
+ import {
102
+ kresusWallet
103
+ } from "./chunk-RICTB3FA.js";
104
104
  import {
105
105
  braveWallet
106
106
  } from "./chunk-DS73TZ6O.js";
107
- import {
108
- clvWallet
109
- } from "./chunk-UK7C2JXW.js";
110
107
  import {
111
108
  coin98Wallet
112
109
  } from "./chunk-6BW3HLBG.js";
110
+ import {
111
+ bloomWallet
112
+ } from "./chunk-PJ7Y57EH.js";
113
113
  import {
114
114
  coinbaseWallet
115
115
  } from "./chunk-2DLDAZRH.js";
116
- import {
117
- dawnWallet
118
- } from "./chunk-G2PHTVL6.js";
119
116
  import {
120
117
  coreWallet
121
118
  } from "./chunk-RB3HR4R2.js";
122
119
  import {
123
- foxWallet
124
- } from "./chunk-MIQTHJ6X.js";
120
+ dawnWallet
121
+ } from "./chunk-G2PHTVL6.js";
122
+ import {
123
+ desigWallet
124
+ } from "./chunk-FW3WZETT.js";
125
125
  import {
126
126
  enkryptWallet
127
127
  } from "./chunk-HBQK5RD5.js";
128
- import {
129
- bifrostWallet
130
- } from "./chunk-4T6ZSRJF.js";
131
128
  import {
132
129
  argentWallet
133
130
  } from "./chunk-NTMBEOR2.js";
131
+ import {
132
+ bifrostWallet
133
+ } from "./chunk-4T6ZSRJF.js";
134
134
  import {
135
135
  bitgetWallet
136
136
  } from "./chunk-CPI4TD43.js";
@@ -140,12 +140,12 @@ import {
140
140
  import {
141
141
  bitverseWallet
142
142
  } from "./chunk-NSK6A7TI.js";
143
- import {
144
- bloomWallet
145
- } from "./chunk-PJ7Y57EH.js";
146
143
  import {
147
144
  bybitWallet
148
145
  } from "./chunk-F5XEEVG6.js";
146
+ import {
147
+ clvWallet
148
+ } from "./chunk-UK7C2JXW.js";
149
149
  import "./chunk-OLZ7626J.js";
150
150
  import "./chunk-N4IJLYFY.js";
151
151
  import "./chunk-IGKXZBTA.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "9.24.0-next.0",
3
+ "version": "9.25.0",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -111,11 +111,11 @@
111
111
  "ua-parser-js": "^1.0.37",
112
112
  "use-debounce": "^10.0.5",
113
113
  "uuid": "^11.1.1",
114
- "@funkit/api-base": "4.5.1",
115
- "@funkit/fun-relay": "2.8.3",
116
- "@funkit/utils": "3.1.0",
117
- "@funkit/connect-core": "1.1.0",
118
- "@funkit/chains": "2.1.1"
114
+ "@funkit/api-base": "5.0.0",
115
+ "@funkit/chains": "2.1.1",
116
+ "@funkit/connect-core": "1.3.0",
117
+ "@funkit/fun-relay": "2.8.4",
118
+ "@funkit/utils": "3.1.0"
119
119
  },
120
120
  "repository": {
121
121
  "type": "git",