@funkit/connect 13.1.1 → 13.2.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 (51) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/clients/aave.d.ts +1 -1
  3. package/dist/clients/{chunk-AJGDTTRJ.js → chunk-3NHG6UYS.js} +1 -1
  4. package/dist/clients/{chunk-ZBBYOJWK.js → chunk-4LM2J6AX.js} +8 -0
  5. package/dist/clients/{chunk-NNMZMHO6.js → chunk-AN6A4SB5.js} +2 -2
  6. package/dist/clients/{chunk-D6EY2WW4.js → chunk-LNUR7YLW.js} +1 -1
  7. package/dist/clients/{chunk-ZEXIDBIZ.js → chunk-PNYV3G5M.js} +1 -1
  8. package/dist/clients/internal/nado/withdrawalCallback.js +3 -3
  9. package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
  10. package/dist/clients/internal/nado/withdrawalForm.js +3 -3
  11. package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
  12. package/dist/clients/lighter.js +3 -3
  13. package/dist/clients/mallard.d.ts +9 -3
  14. package/dist/clients/mallard.js +5 -3
  15. package/dist/clients/nado.js +3 -3
  16. package/dist/components/Dropdown/BaseDropdownItem.d.ts +1 -1
  17. package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +2 -3
  18. package/dist/components/FunTransactionSummary/PaymentFeesSummary.track.d.ts +2 -3
  19. package/dist/components/ModalErrorState/ModalErrorState.d.ts +2 -3
  20. package/dist/consts/customers.d.ts +1 -1
  21. package/dist/consts/polymarket.d.ts +1 -1
  22. package/dist/domains/clientMetadata.d.ts +1 -1
  23. package/dist/domains/convert/hostTimeout.d.ts +1 -1
  24. package/dist/domains/destinationAssetBalance.d.ts +1 -1
  25. package/dist/hooks/queries/useWithdrawalQuote.d.ts +2 -3
  26. package/dist/hooks/statsig/index.d.ts +1 -0
  27. package/dist/hooks/track/analytics/mappers.d.ts +11 -1
  28. package/dist/hooks/track/analytics/swappedErrorCode.d.ts +1 -0
  29. package/dist/hooks/track/analytics/useTrackErrorShown.d.ts +2 -3
  30. package/dist/hooks/useConvertBalances.d.ts +6 -1
  31. package/dist/hooks/useFunkitMaxCheckoutUsdInfo.d.ts +3 -3
  32. package/dist/hooks/useModalStateValueWithProp.d.ts +1 -1
  33. package/dist/hooks/useRefreshBalancesOnDeposit.d.ts +20 -0
  34. package/dist/index.js +1412 -1006
  35. package/dist/interfaces/solanaWallet.d.ts +2 -2
  36. package/dist/modals/CheckoutModal/FiatV2/FiatV2Step.d.ts +17 -0
  37. package/dist/modals/CheckoutModal/FiatV2/fiatV2PaymentSelectionEffects.d.ts +26 -0
  38. package/dist/modals/CheckoutModal/FiatV2/useFiatV2PaymentSelectionHost.d.ts +22 -0
  39. package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +3 -1
  40. package/dist/modals/CheckoutModal/InputAmount/useCheckoutAmountLimits.d.ts +3 -3
  41. package/dist/modals/CheckoutModal/SourceChange/AddCardItem.d.ts +9 -0
  42. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +3 -0
  43. package/dist/modals/CheckoutModal/SourceChange/useAddCardRow.d.ts +12 -0
  44. package/dist/modals/CheckoutModal/stepTransition.d.ts +3 -0
  45. package/dist/modals/PolymarketPerpsTransfer/TransferActionButton.d.ts +5 -5
  46. package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +2 -3
  47. package/dist/providers/FunkitQuoteContext.track.d.ts +2 -3
  48. package/dist/utils/checkout.d.ts +2 -2
  49. package/dist/v2/screens/fiat/FiatPlaceholderScreen.d.ts +9 -0
  50. package/dist/wallets/walletConnectors/index.js +38 -38
  51. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 13.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 23488c3: Mallard deposit configs can set a maximum deposit amount.
8
+ - 7415bd7: Add a gated "Add a card" row to the checkout picker that opens the new web fiat deposit flow.
9
+
10
+ ### Patch Changes
11
+
12
+ - e6d36b4: Use American spelling in comments, docs and test titles; no behavior change
13
+ - a16d619: Refresh Convert and deposit destination balances after a deposit or conversion completes.
14
+ - 92087b8: Convert no longer sends a quote request with a stale amount.
15
+ - 23488c3: When a limit changes the starting amount, the token amount now follows it instead of keeping the configured target amount.
16
+ - 467566c: The gated FiatV2 deposit step now opens on card entry.
17
+ - 95bd504: Categorize recognized Swapped payment failures with stable analytics error codes.
18
+ - Updated dependencies [d9e94a2]
19
+ - Updated dependencies [cc02a32]
20
+ - Updated dependencies [e6d36b4]
21
+ - Updated dependencies [23488c3]
22
+ - Updated dependencies [237a4fd]
23
+ - Updated dependencies [c98a9dd]
24
+ - Updated dependencies [d18f3b6]
25
+ - Updated dependencies [185d42d]
26
+ - Updated dependencies [b04bda5]
27
+ - Updated dependencies [42aefcc]
28
+ - Updated dependencies [4f86e84]
29
+ - Updated dependencies [93d8e79]
30
+ - Updated dependencies [1dbd787]
31
+ - Updated dependencies [fcae59b]
32
+ - Updated dependencies [edfce1a]
33
+ - Updated dependencies [c3381da]
34
+ - Updated dependencies [5ce3f30]
35
+ - Updated dependencies [abec6e3]
36
+ - Updated dependencies [dbe5758]
37
+ - Updated dependencies [a8dd627]
38
+ - Updated dependencies [f19b360]
39
+ - Updated dependencies [85ca13d]
40
+ - Updated dependencies [2adb0f2]
41
+ - Updated dependencies [f874e72]
42
+ - Updated dependencies [3bf6603]
43
+ - Updated dependencies [af75d9a]
44
+ - Updated dependencies [af75d9a]
45
+ - Updated dependencies [6d54660]
46
+ - @funkit/connect-core@17.1.0
47
+ - @funkit/api-base@10.5.0
48
+
3
49
  ## 13.1.1
4
50
 
5
51
  ### Patch Changes
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { type Address } from 'viem';
17
17
  import type { FunkitCheckoutActionParams, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext/types';
18
- /** Action type signalling an Aave v3 Core supply, executed server-side after a UDA deposit lands. */
18
+ /** Action type signaling an Aave v3 Core supply, executed server-side after a UDA deposit lands. */
19
19
  export declare const AAVE_SUPPLY_ACTION_TYPE = "AAVE_SUPPLY";
20
20
  /** Returns true if Fun has a VaultDepositor deployment on `chainId` ready to route Aave supplies. */
21
21
  export declare function isAaveSupplySupported(chainId: number): boolean;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useFunkitTranslation
4
- } from "./chunk-ZEXIDBIZ.js";
4
+ } from "./chunk-PNYV3G5M.js";
5
5
 
6
6
  // src/providers/FunkitConfigContext.tsx
7
7
  import {
@@ -551,6 +551,7 @@ var en_default = {
551
551
  unableToCreateAccount: "Unable to create account. Please try again or contact us for assistance."
552
552
  },
553
553
  sourceChange: {
554
+ addCard: "Add a card",
554
555
  native: "Native",
555
556
  supplyNativeAsset: "Supply {{ticker}}",
556
557
  useOtherAssets: "Use other assets",
@@ -1186,6 +1187,7 @@ var es_default = {
1186
1187
  unableToCreateAccount: "No se pudo crear la cuenta. Por favor, int\xE9ntalo de nuevo o cont\xE1ctanos para obtener ayuda."
1187
1188
  },
1188
1189
  sourceChange: {
1190
+ addCard: "A\xF1adir una tarjeta",
1189
1191
  native: "Nativo",
1190
1192
  supplyNativeAsset: "Suministrar {{ticker}}",
1191
1193
  useOtherAssets: "Usar otros activos",
@@ -1824,6 +1826,7 @@ var fr_default = {
1824
1826
  unableToCreateAccount: "Impossible de cr\xE9er le compte. Veuillez r\xE9essayer ou contactez-nous pour obtenir de l'aide."
1825
1827
  },
1826
1828
  sourceChange: {
1829
+ addCard: "Ajouter une carte",
1827
1830
  native: "Natif",
1828
1831
  supplyNativeAsset: "Fournir {{ticker}}",
1829
1832
  useOtherAssets: "Utiliser d'autres actifs",
@@ -2462,6 +2465,7 @@ var ja_default = {
2462
2465
  unableToCreateAccount: "\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u3044\u305F\u3060\u304F\u304B\u3001\u304A\u554F\u3044\u5408\u308F\u305B\u304F\u3060\u3055\u3044\u3002"
2463
2466
  },
2464
2467
  sourceChange: {
2468
+ addCard: "\u30AB\u30FC\u30C9\u3092\u8FFD\u52A0",
2465
2469
  native: "\u30CD\u30A4\u30C6\u30A3\u30D6",
2466
2470
  supplyNativeAsset: "{{ticker}}\u3092\u4F9B\u7D66",
2467
2471
  useOtherAssets: "\u4ED6\u306E\u8CC7\u7523\u3092\u4F7F\u7528",
@@ -3100,6 +3104,7 @@ var ko_default = {
3100
3104
  unableToCreateAccount: "\uACC4\uC815\uC744 \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD558\uAC70\uB098 \uBB38\uC758\uD574 \uC8FC\uC138\uC694."
3101
3105
  },
3102
3106
  sourceChange: {
3107
+ addCard: "\uCE74\uB4DC \uCD94\uAC00",
3103
3108
  native: "\uB124\uC774\uD2F0\uBE0C",
3104
3109
  supplyNativeAsset: "{{ticker}} \uACF5\uAE09",
3105
3110
  useOtherAssets: "\uB2E4\uB978 \uC790\uC0B0 \uC0AC\uC6A9",
@@ -3738,6 +3743,7 @@ var ru_default = {
3738
3743
  unableToCreateAccount: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0430\u043A\u043A\u0430\u0443\u043D\u0442. \u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437 \u0438\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438."
3739
3744
  },
3740
3745
  sourceChange: {
3746
+ addCard: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u0430\u0440\u0442\u0443",
3741
3747
  native: "\u041D\u0430\u0442\u0438\u0432\u043D\u044B\u0439",
3742
3748
  supplyNativeAsset: "\u041F\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u044C {{ticker}}",
3743
3749
  useOtherAssets: "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0434\u0440\u0443\u0433\u0438\u0435 \u0430\u043A\u0442\u0438\u0432\u044B",
@@ -4376,6 +4382,7 @@ var tr_default = {
4376
4382
  unableToCreateAccount: "Hesap olu\u015Fturulamad\u0131. L\xFCtfen tekrar deneyin veya bizimle ileti\u015Fime ge\xE7in."
4377
4383
  },
4378
4384
  sourceChange: {
4385
+ addCard: "Kart ekle",
4379
4386
  native: "Yerel",
4380
4387
  supplyNativeAsset: "{{ticker}} Sa\u011Fla",
4381
4388
  useOtherAssets: "Di\u011Fer varl\u0131klar\u0131 kullan",
@@ -5014,6 +5021,7 @@ var zh_default = {
5014
5021
  unableToCreateAccount: "\u65E0\u6CD5\u521B\u5EFA\u8D26\u6237\u3002\u8BF7\u91CD\u8BD5\u6216\u8054\u7CFB\u6211\u4EEC\u5BFB\u6C42\u5E2E\u52A9\u3002"
5015
5022
  },
5016
5023
  sourceChange: {
5024
+ addCard: "\u6DFB\u52A0\u5361\u7247",
5017
5025
  native: "\u539F\u751F",
5018
5026
  supplyNativeAsset: "\u4F9B\u5E94 {{ticker}}",
5019
5027
  useOtherAssets: "\u4F7F\u7528\u5176\u4ED6\u8D44\u4EA7",
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  isExpectedNadoWithdrawalFailure,
7
7
  toNadoWithdrawalErrorMessage
8
- } from "./chunk-D6EY2WW4.js";
8
+ } from "./chunk-LNUR7YLW.js";
9
9
  import {
10
10
  toWithdrawalAmountBaseUnit
11
11
  } from "./chunk-LICTGZXW.js";
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-OODIKHYE.js";
17
17
  import {
18
18
  i18n_default
19
- } from "./chunk-ZBBYOJWK.js";
19
+ } from "./chunk-4LM2J6AX.js";
20
20
  import {
21
21
  logger
22
22
  } from "./chunk-B67ESBGC.js";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  i18n_default
4
- } from "./chunk-ZBBYOJWK.js";
4
+ } from "./chunk-4LM2J6AX.js";
5
5
 
6
6
  // src/clients/internal/nado/withdrawalErrors.ts
7
7
  import {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  i18n_default
4
- } from "./chunk-ZBBYOJWK.js";
4
+ } from "./chunk-4LM2J6AX.js";
5
5
 
6
6
  // src/hooks/useFunkitTranslation.ts
7
7
  import { useTranslation } from "react-i18next";
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import {
3
3
  createNadoWithdrawalCallback
4
- } from "../../chunk-NNMZMHO6.js";
4
+ } from "../../chunk-AN6A4SB5.js";
5
5
  import "../../chunk-44LV4GCX.js";
6
- import "../../chunk-D6EY2WW4.js";
6
+ import "../../chunk-LNUR7YLW.js";
7
7
  import "../../chunk-LICTGZXW.js";
8
8
  import "../../chunk-OODIKHYE.js";
9
- import "../../chunk-ZBBYOJWK.js";
9
+ import "../../chunk-4LM2J6AX.js";
10
10
  import "../../chunk-B67ESBGC.js";
11
11
  export {
12
12
  createNadoWithdrawalCallback
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  isExpectedNadoWithdrawalFailure,
4
4
  toNadoWithdrawalErrorMessage
5
- } from "../../chunk-D6EY2WW4.js";
6
- import "../../chunk-ZBBYOJWK.js";
5
+ } from "../../chunk-LNUR7YLW.js";
6
+ import "../../chunk-4LM2J6AX.js";
7
7
  export {
8
8
  isExpectedNadoWithdrawalFailure,
9
9
  toNadoWithdrawalErrorMessage
@@ -5,13 +5,13 @@ import {
5
5
  import "../../chunk-PZSKO3BJ.js";
6
6
  import {
7
7
  useFunkitConfig
8
- } from "../../chunk-AJGDTTRJ.js";
8
+ } from "../../chunk-3NHG6UYS.js";
9
9
  import {
10
10
  useFunkitTranslation
11
- } from "../../chunk-ZEXIDBIZ.js";
11
+ } from "../../chunk-PNYV3G5M.js";
12
12
  import "../../chunk-LICTGZXW.js";
13
13
  import "../../chunk-2W2P3OS6.js";
14
- import "../../chunk-ZBBYOJWK.js";
14
+ import "../../chunk-4LM2J6AX.js";
15
15
  import {
16
16
  logger
17
17
  } from "../../chunk-B67ESBGC.js";
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import {
3
3
  useFunkitConfig
4
- } from "../../chunk-AJGDTTRJ.js";
5
- import "../../chunk-ZEXIDBIZ.js";
4
+ } from "../../chunk-3NHG6UYS.js";
5
+ import "../../chunk-PNYV3G5M.js";
6
6
  import {
7
7
  useAccount
8
8
  } from "../../chunk-2W2P3OS6.js";
9
- import "../../chunk-ZBBYOJWK.js";
9
+ import "../../chunk-4LM2J6AX.js";
10
10
  import {
11
11
  logger
12
12
  } from "../../chunk-B67ESBGC.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-PZSKO3BJ.js";
7
7
  import {
8
8
  useFunkitConfig
9
- } from "./chunk-AJGDTTRJ.js";
9
+ } from "./chunk-3NHG6UYS.js";
10
10
  import {
11
11
  Box,
12
12
  hasRemoteImageLoaded,
@@ -15,10 +15,10 @@ import {
15
15
  } from "./chunk-JXTKKLVA.js";
16
16
  import {
17
17
  useFunkitTranslation
18
- } from "./chunk-ZEXIDBIZ.js";
18
+ } from "./chunk-PNYV3G5M.js";
19
19
  import "./chunk-OODIKHYE.js";
20
20
  import "./chunk-2W2P3OS6.js";
21
- import "./chunk-ZBBYOJWK.js";
21
+ import "./chunk-4LM2J6AX.js";
22
22
  import {
23
23
  logger
24
24
  } from "./chunk-B67ESBGC.js";
@@ -17,7 +17,7 @@
17
17
  import { type ReactNode } from 'react';
18
18
  import { type Address } from 'viem';
19
19
  import type { GetDestinationAssetBalances } from '../domains/destinationAssetBalance';
20
- import type { DynamicTargetAssetCandidate, FunkitCheckoutActionParams, FunkitCheckoutConfig, TokenInfo, WalletWithdrawalConfig } from '../providers/FunkitCheckoutContext/types';
20
+ import type { DynamicTargetAssetCandidate, FunkitCheckoutActionParams, FunkitCheckoutConfig, ModalTitleContext, TokenInfo, WalletWithdrawalConfig } from '../providers/FunkitCheckoutContext/types';
21
21
  /** Mallard deposit contract to credit a Mallard (perps) account. */
22
22
  export declare const MALLARD_DEPOSIT_ADDRESS: `0x${string}`;
23
23
  /** VaultDepositooor on Zorro chain. */
@@ -113,12 +113,18 @@ export interface CreateMallardDepositConfigParams {
113
113
  * the menu without balances.
114
114
  */
115
115
  getAssetBalances?: GetDestinationAssetBalances;
116
+ /**
117
+ * Maximum USD the user may deposit for the selected asset. Called with the
118
+ * asset's chain, address and routing id. Return a negative number for no
119
+ * maximum. Must not be below the asset's minimum.
120
+ */
121
+ getMaxDepositUSD?: (asset: ModalTitleContext) => number;
116
122
  }
117
123
  /**
118
- * Builds routing and deposit actions for the integrator's complete catalogue.
124
+ * Builds routing and deposit actions for the integrator's complete catalog.
119
125
  * For translated modal titles, spread the result and override `modalTitle`
120
126
  * with a string or a resolver keyed by `dynamicRoutingId`.
121
127
  */
122
- export declare function createMallardDepositConfig({ address, accounts, getAssetBalances, }: CreateMallardDepositConfigParams): FunkitCheckoutConfig & {
128
+ export declare function createMallardDepositConfig({ address, accounts, getAssetBalances, getMaxDepositUSD, }: CreateMallardDepositConfigParams): FunkitCheckoutConfig & {
123
129
  dynamicTargetAssetCandidates: DynamicTargetAssetCandidate[];
124
130
  };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useFunkitTranslation
4
- } from "./chunk-ZEXIDBIZ.js";
4
+ } from "./chunk-PNYV3G5M.js";
5
5
  import {
6
6
  getAccount,
7
7
  sendTransaction,
@@ -14,7 +14,7 @@ import {
14
14
  useAccount,
15
15
  useConfig
16
16
  } from "./chunk-2W2P3OS6.js";
17
- import "./chunk-ZBBYOJWK.js";
17
+ import "./chunk-4LM2J6AX.js";
18
18
  import {
19
19
  logger
20
20
  } from "./chunk-B67ESBGC.js";
@@ -298,7 +298,8 @@ function getMallardAssets({
298
298
  function createMallardDepositConfig({
299
299
  address,
300
300
  accounts,
301
- getAssetBalances
301
+ getAssetBalances,
302
+ getMaxDepositUSD
302
303
  }) {
303
304
  const candidates = getMallardAssets({ address, accounts });
304
305
  const destinationAccountConfig = {
@@ -334,6 +335,7 @@ function createMallardDepositConfig({
334
335
  dynamicRoutingId: initialCandidate.dynamicRoutingId,
335
336
  destinationAccountConfig,
336
337
  dynamicTargetAssetCandidates: candidates,
338
+ getMaxDepositUSD,
337
339
  // Route-specific UDA settings take precedence, including Spot's absent action.
338
340
  qrcodeActionType: "MALLARD_PERPS",
339
341
  generateActionsParams: initialCandidate.generateActionsParams
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  createNadoWithdrawalCallback
4
- } from "./chunk-NNMZMHO6.js";
4
+ } from "./chunk-AN6A4SB5.js";
5
5
  import "./chunk-44LV4GCX.js";
6
- import "./chunk-D6EY2WW4.js";
6
+ import "./chunk-LNUR7YLW.js";
7
7
  import "./chunk-LICTGZXW.js";
8
8
  import "./chunk-OODIKHYE.js";
9
9
  import {
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-2W2P3OS6.js";
13
13
  import {
14
14
  i18n_default
15
- } from "./chunk-ZBBYOJWK.js";
15
+ } from "./chunk-4LM2J6AX.js";
16
16
  import {
17
17
  logger
18
18
  } from "./chunk-B67ESBGC.js";
@@ -16,7 +16,7 @@ interface BaseDropdownItemProps {
16
16
  borderRadius?: BoxProps['borderRadius'];
17
17
  horizontalPadding?: BoxProps['paddingX'];
18
18
  verticalPadding?: BoxProps['paddingY'];
19
- /** Inline style on the row, e.g. to undo the disabled fade on a row that mutes its own colours. */
19
+ /** Inline style on the row, e.g. to undo the disabled fade on a row that mutes its own colors. */
20
20
  style?: React.CSSProperties;
21
21
  }
22
22
  /**
@@ -2,8 +2,7 @@ import React, { type ReactNode } from 'react';
2
2
  import type { CheckoutFees } from '../../domains/fees';
3
3
  import type { FunkitCheckoutQuoteResult } from '../../domains/quote';
4
4
  import { type FunTooltipProps } from '../FunTooltip/FunTooltip';
5
- import type { FunCheckoutStep } from '../../modals/CheckoutModal/FunCheckoutStep';
6
- import type { WithdrawalModalStep } from '../../modals/WithdrawalModal/types';
5
+ import type { AnalyticsNamedStep } from '../../hooks/track/analytics/mappers';
7
6
  export declare const NO_DATA_VALUE = "-";
8
7
  interface PaymentFeesSummaryProps {
9
8
  isLoading: boolean;
@@ -14,7 +13,7 @@ interface PaymentFeesSummaryProps {
14
13
  valuesNotAvailable?: boolean;
15
14
  isWithdrawal: boolean;
16
15
  extraSourceChainGasUsd?: number;
17
- step: FunCheckoutStep | WithdrawalModalStep;
16
+ step: AnalyticsNamedStep;
18
17
  /**
19
18
  * Integrator rows rendered before the SDK's own rows.
20
19
  * - Display-only: excluded from the total, expandability and analytics.
@@ -1,16 +1,15 @@
1
1
  import type { PaymentMethodInfo } from '../../domains/paymentMethods';
2
2
  import type { FunkitCheckoutQuoteResult } from '../../domains/quote';
3
3
  import type { TransactionBreakdownClickedProperties } from '../../hooks/track/analytics/events';
4
+ import { type AnalyticsNamedStep } from '../../hooks/track/analytics/mappers';
4
5
  import type { TrackEventData } from '../../hooks/track/useTrack';
5
6
  import type { FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
6
7
  import type { FeeItem } from './PaymentFeesSummary';
7
- import type { FunCheckoutStep } from '../../modals/CheckoutModal/FunCheckoutStep';
8
- import type { WithdrawalModalStep } from '../../modals/WithdrawalModal/types';
9
8
  export declare function buildTransactionBreakdownClickedProperties({ connectorId, extraSourceChainGasUsd, paymentMethodInfo, quote, step, }: {
10
9
  connectorId: string | undefined;
11
10
  extraSourceChainGasUsd: number;
12
11
  paymentMethodInfo: PaymentMethodInfo;
13
12
  quote: FunkitCheckoutQuoteResult | null | undefined;
14
- step: FunCheckoutStep | WithdrawalModalStep;
13
+ step: AnalyticsNamedStep;
15
14
  }): TransactionBreakdownClickedProperties;
16
15
  export declare const trackEventFromPaymentFeesSummary: (checkoutItem: FunkitActiveCheckoutItem, feeItems: FeeItem[], isWithdrawal: boolean) => TrackEventData;
@@ -2,8 +2,7 @@ import React, { type ReactNode } from 'react';
2
2
  import { type BoxProps } from '../Box/Box';
3
3
  import type { ErrorNotification } from '../FunNotification/FunNotification';
4
4
  import type { AnalyticsFlow } from '../../hooks/track/analytics/events';
5
- import type { FunCheckoutStep } from '../../modals/CheckoutModal/FunCheckoutStep';
6
- import type { WithdrawalModalStep } from '../../modals/WithdrawalModal/types';
5
+ import type { AnalyticsNamedStep } from '../../hooks/track/analytics/mappers';
7
6
  interface ModalErrorStateProps {
8
7
  /** Icon rendered inside a 32×32 circular `offBackground` container. Defaults to a filled InfoIcon. */
9
8
  icon?: ReactNode;
@@ -17,7 +16,7 @@ interface ModalErrorStateProps {
17
16
  /** Optional style for the container. */
18
17
  style?: React.CSSProperties;
19
18
  flow: AnalyticsFlow;
20
- step: FunCheckoutStep | WithdrawalModalStep;
19
+ step: AnalyticsNamedStep;
21
20
  track: Omit<ErrorNotification, 'message'> | null;
22
21
  }
23
22
  /**
@@ -47,7 +47,7 @@ export declare function isLighterEthSpot(apiKey: string, checkoutConfig: FunkitC
47
47
  * even when they share the same target token (the mainnet USDC new-user routes).
48
48
  *
49
49
  * Used to scope the token-entry-by-default treatment to spot deposits only —
50
- * perps deposits always open in fiat. A route without a recognisable spot id
50
+ * perps deposits always open in fiat. A route without a recognizable spot id
51
51
  * is treated as non-spot (the safe, fiat default).
52
52
  */
53
53
  export declare function isLighterSpot(apiKey: string, checkoutConfig: Pick<FunkitCheckoutConfig, 'dynamicRoutingId'> | undefined): boolean;
@@ -1,5 +1,5 @@
1
1
  import { type Address } from 'viem';
2
- /** Action type signalling a Polymarket Perps deposit (USDC.e → pUSD → Perps). */
2
+ /** Action type signaling a Polymarket Perps deposit (USDC.e → pUSD → Perps). */
3
3
  export declare const POLYMARKET_PERPS_DEPOSIT_ACTION_TYPE = "POLYMARKET_PERPS_DEPOSIT";
4
4
  /**
5
5
  * Polymarket pUSD on Polygon. Perps deposits must land in pUSD on-chain, so
@@ -43,7 +43,7 @@ export interface HistoricalCheckoutItem extends Pick<FunkitActiveCheckoutItem, H
43
43
  * stripped candidates;
44
44
  * - `modalTitle` is restored whenever a live config exists (falling back to the
45
45
  * serializable value) so validation passes;
46
- * - the remaining live-only fields (`getMinDepositUSD`,
46
+ * - the remaining live-only fields (`getMinDepositUSD`, `getMaxDepositUSD`,
47
47
  * `generateActionsParams`, `polymarketPerpsTransfer`, `headerTabs`,
48
48
  * `resolveHealthFactor`, `destinationAccountConfig`) are carried forward only
49
49
  * when re-starting the still-active checkout.
@@ -3,6 +3,6 @@ export declare const HOST_TIMEOUT_MS = 10000;
3
3
  /**
4
4
  * Rejects if the host's promise hasn't settled in time, so a callback that
5
5
  * never answers shows as a failure the user can retry, not endless loading.
6
- * The host's own work isn't cancelled; its late answer is ignored.
6
+ * The host's own work isn't canceled; its late answer is ignored.
7
7
  */
8
8
  export declare function withHostTimeout<T>(promise: Promise<T>, timeoutMs?: number): Promise<T>;
@@ -17,7 +17,7 @@ export type DestinationAssetBalance = ConvertAssetBalance;
17
17
  * Reads wallet balances for the destination asset menu, in one call.
18
18
  * - Called when the menu opens, then every 60s while it stays open.
19
19
  * - Answer for exactly the assets passed; leave out any you can't read or
20
- * don't want labelled. Don't throw.
20
+ * don't want labeled. Don't throw.
21
21
  * @experimental
22
22
  */
23
23
  export type GetDestinationAssetBalances = (params: {
@@ -1,8 +1,7 @@
1
- import type { FunCheckoutStep } from '../../modals/CheckoutModal/FunCheckoutStep';
2
- import type { WithdrawalModalStep } from '../../modals/WithdrawalModal/types';
3
1
  import { type FunkitWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
2
+ import type { AnalyticsNamedStep } from '../../hooks/track/analytics/mappers';
4
3
  interface CheckoutQuoteParams {
5
- analyticsStep: FunCheckoutStep | WithdrawalModalStep;
4
+ analyticsStep: AnalyticsNamedStep;
6
5
  recipientAddress: string;
7
6
  selectedChainId: string | undefined;
8
7
  selectedTokenAddress: string | null | undefined;
@@ -2,3 +2,4 @@ export { useDynamicConfig } from './useDynamicConfig';
2
2
  export { useExperiment } from './useExperiment';
3
3
  export { useExperimentV2 } from '@funkit/connect-core';
4
4
  export { useFeatureGate } from './useFeatureGate';
5
+ export { useFeatureGateV2 } from '@funkit/connect-core';
@@ -6,7 +6,17 @@ import { WithdrawalModalStep } from '../../../modals/WithdrawalModal/types';
6
6
  import type { AnalyticsFlow, AnalyticsStep, PaymentMethodProperties } from './events';
7
7
  /** Round analytics amounts before Statsig stringifies event metadata. */
8
8
  export declare function formatAnalyticsAmount(amount: number | null): string | null;
9
- export declare function formatAnalyticsStep(step: FunCheckoutStep | WithdrawalModalStep): AnalyticsStep;
9
+ /**
10
+ * Steps that only host another renderer. Every V2 screen renders under
11
+ * FIAT_V2, so a step name for it would merge them all; V2 screens report
12
+ * their own shared names instead.
13
+ */
14
+ export type AnalyticsHostStep = FunCheckoutStep.FIAT_V2;
15
+ export type AnalyticsNamedStep = Exclude<FunCheckoutStep, AnalyticsHostStep> | WithdrawalModalStep;
16
+ export declare function isAnalyticsHostStep(step: FunCheckoutStep | WithdrawalModalStep): step is AnalyticsHostStep;
17
+ export declare function formatAnalyticsStep(step: AnalyticsNamedStep): AnalyticsStep;
18
+ /** `prev_step` after a host step is unknown to web V1, so it is reported as none. */
19
+ export declare function formatPrevAnalyticsStep(step: FunCheckoutStep | null): AnalyticsStep | null;
10
20
  export declare function getCheckoutModalAnalyticsFlow(modalState: CheckoutModalState): AnalyticsFlow;
11
21
  export declare function getHistoricalSourceAddress(sourceOfFund: string | null | undefined): string | null;
12
22
  /** Selected checkout provider, such as a wallet connector or Meld provider. */
@@ -0,0 +1 @@
1
+ export declare function getSwappedErrorCode(error: unknown): string;
@@ -1,11 +1,10 @@
1
1
  import type { ErrorNotification } from '../../../components/FunNotification/FunNotification';
2
- import type { FunCheckoutStep } from '../../../modals/CheckoutModal/FunCheckoutStep';
3
- import type { WithdrawalModalStep } from '../../../modals/WithdrawalModal/types';
4
2
  import { type AnalyticsFlow } from './events';
3
+ import { type AnalyticsNamedStep } from './mappers';
5
4
  type TrackErrorShownArgs = {
6
5
  error: ErrorNotification | null;
7
6
  flow: AnalyticsFlow;
8
- step: FunCheckoutStep | WithdrawalModalStep;
7
+ step: AnalyticsNamedStep;
9
8
  };
10
9
  /** Emits once for each continuous episode in which an error is displayed. */
11
10
  export declare function useTrackErrorShown({ error, flow, step }: TrackErrorShownArgs): void;
@@ -1,6 +1,11 @@
1
+ import { type QueryClient } from '@tanstack/react-query';
1
2
  import { type ConvertBalances } from '../domains/convert/balances';
2
3
  import type { ConvertRecipientAddresses, ConvertResolvedAsset, GetConvertBalances } from '../domains/convert/types';
3
- export declare const BALANCES_QUERY_KEY: readonly ['convert', 'balances'];
4
+ /**
5
+ * Marks every reader of the host's `getBalances` stale after funds land.
6
+ * Readers on screen read again now, the rest when they next show.
7
+ */
8
+ export declare function invalidateHostBalances(queryClient: QueryClient): void;
4
9
  interface UseConvertBalancesParams {
5
10
  /** Scopes reads to one checkout, whose `getBalances` may differ from the last. */
6
11
  checkoutId: string | undefined;
@@ -2,9 +2,9 @@
2
2
  * Retrieves the maximum checkout amount in USD and formats the limit text.
3
3
  *
4
4
  * @description
5
- * This hook uses a Statsig dynamic config to determine the maximum checkout amount.
6
- * If the amount is negative (e.g. -1), it returns 'no' as the limit text (no limit).
7
- * Otherwise, it formats the amount as a currency string with specific formatting options.
5
+ * The Statsig `maxcheckoutusd` config, lowered by the active checkout's
6
+ * `getMaxDepositUSD` (only while a checkout is active). A negative value
7
+ * means no limit, and the hook returns 'no' as the limit text.
8
8
  *
9
9
  * @returns {Object} An object containing:
10
10
  * - `value`: The maximum checkout amount in USD (number). Defaults to Number.MAX_VALUE (no limit).
@@ -2,7 +2,7 @@
2
2
  * Modal open state plus a prop that outlives the close animation.
3
3
  *
4
4
  * The prop keys the modal component, so clearing it is delayed until the
5
- * animation finishes — and cancelled if the owner unmounts first, which would
5
+ * animation finishes — and canceled if the owner unmounts first, which would
6
6
  * otherwise set state on a torn-down tree.
7
7
  */
8
8
  export declare function useModalStateValueWithProp<T = string>(): {
@@ -0,0 +1,20 @@
1
+ import { type CheckoutHistoryItem } from '@funkit/api-base';
2
+ import type { MergedMultiStepDirectExecution } from '../domains/checkoutNotifications';
3
+ import type { NotificationItem } from '../modals/CheckoutModal/TransferToken/types';
4
+ /**
5
+ * Marks the host's balances stale once per completed deposit. Feed it every
6
+ * history update; polls keep reporting a deposit as completed. Each caller
7
+ * keeps its own record of the deposits it has refreshed for.
8
+ */
9
+ export declare function useRefreshBalancesOnDeposit(): (historyItem: NotificationItem) => void;
10
+ /**
11
+ * Marks the host's balances stale when a deposit in the recent deposit queries
12
+ * completes. Deposits already complete when a list first loads are recorded
13
+ * without a refresh. Reads the raw query data, so it doesn't depend on which
14
+ * notifications are on screen. Keeps its own record, separate from
15
+ * useRefreshBalancesOnDeposit.
16
+ */
17
+ export declare function useRefreshBalancesOnRecentDeposits({ checkouts, mergedDirectExecutions, }: {
18
+ checkouts: CheckoutHistoryItem[] | undefined;
19
+ mergedDirectExecutions: MergedMultiStepDirectExecution[] | undefined;
20
+ }): void;