@funkit/connect 9.25.0 → 9.26.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 (30) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/clients/{chunk-7G3QEQFB.js → chunk-2NBYHUIW.js} +1 -1
  3. package/dist/clients/{chunk-SQ2RX7WY.js → chunk-4IWQ2UT5.js} +11 -8
  4. package/dist/clients/{chunk-VJZW3MA3.js → chunk-F4SCUKY6.js} +1 -1
  5. package/dist/clients/{chunk-7UIDHSYG.js → chunk-LUHEVXPD.js} +1 -8
  6. package/dist/clients/chunk-STLOQEN7.js +11 -0
  7. package/dist/clients/chunk-UPZNKPYU.js +27 -0
  8. package/dist/clients/{chunk-MXPZTW2H.js → chunk-VT3ERWXE.js} +4 -2
  9. package/dist/clients/fanatics.js +5 -3
  10. package/dist/clients/lighter.js +7 -4
  11. package/dist/clients/mallard.d.ts +43 -1
  12. package/dist/clients/mallard.js +112 -3
  13. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +7 -5
  14. package/dist/clients/polymarket/createPolymarketDepositConfig.js +2 -2
  15. package/dist/clients/polymarket/index.js +7 -5
  16. package/dist/clients/polymarket/polymarket.js +1 -1
  17. package/dist/domains/clientMetadata.d.ts +21 -0
  18. package/dist/index.js +567 -242
  19. package/dist/modals/CheckoutModal/SourceChange/FormOfPaymentsList.d.ts +1 -1
  20. package/dist/modals/CheckoutModal/SourceChange/buildSourceGroups.d.ts +2 -2
  21. package/dist/modals/WithdrawalModal/RecipientAddress.d.ts +12 -0
  22. package/dist/modals/WithdrawalModal/WithdrawalSwappedIframeController.d.ts +3 -1
  23. package/dist/modals/WithdrawalModal/useFiatWithdrawal.d.ts +40 -0
  24. package/dist/modals/WithdrawalModal/useWithdrawal.d.ts +2 -2
  25. package/dist/providers/FunkitCheckoutContext/types.d.ts +18 -0
  26. package/dist/utils/swappedRouteOverride.d.ts +27 -0
  27. package/dist/wagmi/actions.d.ts +1 -1
  28. package/dist/wallets/walletConnectors/index.js +26 -26
  29. package/package.json +3 -3
  30. /package/dist/clients/{chunk-ME4OAQIY.js → chunk-O5CTDT3L.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 9.26.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 907d703: Add `useMallardWithdrawalConfig` (+ `MALLARD_USDG_ADDRESS`, `MALLARD_USDG_ICON_SRC`, `MallardWithdrawalConfig`) for Mallard (Robinhood chain) withdrawals: builds a `WalletWithdrawalConfig` for USDG signed by the user's connected wallet.
8
+
9
+ Also relaxes the withdrawal modal's "Use connected wallet" recipient shortcut to show for connected-wallet withdrawals (where the source is the connected wallet), not just proxy-based flows.
10
+
11
+ - b836b7c: Add a Statsig-driven source-route override (`swappedwithdrawalsourceoverrides`) for Swapped fiat withdrawals: when the requested target asset isn't supported by Swapped, enforce a known-good accepted route keyed on the user's source asset. Empty config leaves existing behavior unchanged.
12
+ - b8c578e: Type and validate Swapped sell order data on receipt; order execution lands in a follow-up
13
+ - ab7c4b9: Execute Swapped withdrawals via the Relay route through `useWithdrawal` (EXACT_OUT quote with real fees)
14
+
15
+ ### Patch Changes
16
+
17
+ - 5d6146d: Update the "Use other assets" tooltip copy in the source-change list
18
+ - 0db2b47: Fix a new deposit started off the active checkout keeping the prior route's behavior: switching destination (e.g. Mallard USDG spot → perps) now re-binds the per-route deposit actions instead of dropping them, so the perps source token is selectable again.
19
+ - 9ff1e58: Initialize the relay client from the active wagmi config (`useConfig`), sourcing each chain's RPC from its configured transport. Fixes `WaitForTransactionReceiptTimeoutError` on chains whose default RPC isn't reachable.
20
+ - 8c0afe8: Rename the "Other options" source/payment section header to "More options" for consistency
21
+ - Updated dependencies [86d2a31]
22
+ - Updated dependencies [a24681e]
23
+ - Updated dependencies [b8c578e]
24
+ - @funkit/connect-core@1.4.0
25
+ - @funkit/fun-relay@2.8.5
26
+
3
27
  ## 9.25.0
4
28
 
5
29
  ### Minor Changes
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Box
4
- } from "./chunk-7UIDHSYG.js";
4
+ } from "./chunk-LUHEVXPD.js";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-AHYOV7AV.js";
@@ -2,25 +2,27 @@
2
2
  import {
3
3
  usePolymarketAccountBalances
4
4
  } from "./chunk-ZEXZQOAO.js";
5
- import {
6
- POLYMARKET_PERPS_ROUTING_ID,
7
- POLYMARKET_PREDICTIONS_ROUTING_ID
8
- } from "./chunk-VJZW3MA3.js";
9
5
  import {
10
6
  FunInput,
11
7
  FunSkeletonBlock,
12
8
  TooltipAnchorRefContext
13
- } from "./chunk-MXPZTW2H.js";
9
+ } from "./chunk-VT3ERWXE.js";
14
10
  import {
15
11
  Box,
16
12
  Text,
17
- themeVars,
13
+ themeVars
14
+ } from "./chunk-LUHEVXPD.js";
15
+ import {
18
16
  useFunkitTranslation
19
- } from "./chunk-7UIDHSYG.js";
17
+ } from "./chunk-STLOQEN7.js";
18
+ import {
19
+ POLYMARKET_PERPS_ROUTING_ID,
20
+ POLYMARKET_PREDICTIONS_ROUTING_ID
21
+ } from "./chunk-F4SCUKY6.js";
20
22
  import {
21
23
  POLYGON_USDCE,
22
24
  PUSD_TOKEN
23
- } from "./chunk-ME4OAQIY.js";
25
+ } from "./chunk-O5CTDT3L.js";
24
26
  import {
25
27
  logger
26
28
  } from "./chunk-AHYOV7AV.js";
@@ -96,6 +98,7 @@ var useScrollDivider = () => {
96
98
  };
97
99
 
98
100
  // src/providers/FunkitProvider.tsx
101
+ import { LogLevel, initializeRelayClient } from "@funkit/fun-relay";
99
102
  import { QueryClientProvider } from "@tanstack/react-query";
100
103
  import React8, {
101
104
  createContext,
@@ -8,7 +8,7 @@ import {
8
8
  VAULT_DEPOSITOR_ABI,
9
9
  VAULT_DEPOSITOR_POLYGON,
10
10
  createPerpsGenerateActionParams
11
- } from "./chunk-ME4OAQIY.js";
11
+ } from "./chunk-O5CTDT3L.js";
12
12
 
13
13
  // src/clients/polymarket/createPolymarketDepositConfig.ts
14
14
  import { encodeFunctionData, erc20Abi, maxUint256 } from "viem";
@@ -102,15 +102,8 @@ var Text = React2.forwardRef(
102
102
  );
103
103
  Text.displayName = "Text";
104
104
 
105
- // src/hooks/useFunkitTranslation.ts
106
- import { useTranslation } from "react-i18next";
107
- function useFunkitTranslation() {
108
- return useTranslation();
109
- }
110
-
111
105
  export {
112
106
  themeVars,
113
107
  Box,
114
- Text,
115
- useFunkitTranslation
108
+ Text
116
109
  };
@@ -0,0 +1,11 @@
1
+ "use client";
2
+
3
+ // src/hooks/useFunkitTranslation.ts
4
+ import { useTranslation } from "react-i18next";
5
+ function useFunkitTranslation() {
6
+ return useTranslation();
7
+ }
8
+
9
+ export {
10
+ useFunkitTranslation
11
+ };
@@ -0,0 +1,27 @@
1
+ "use client";
2
+
3
+ // src/wagmi/hooks.ts
4
+ import {
5
+ useAccount,
6
+ useAccountEffect,
7
+ useBalance,
8
+ useConfig,
9
+ useConnect,
10
+ useDisconnect,
11
+ useEnsAvatar,
12
+ useEnsName,
13
+ useGasPrice,
14
+ useReconnect,
15
+ useSendTransaction,
16
+ useSwitchChain,
17
+ useWalletClient,
18
+ useWatchAsset,
19
+ useWriteContract
20
+ } from "wagmi";
21
+ import { WagmiProvider } from "wagmi";
22
+ import { createConfig, createConnector, http } from "wagmi";
23
+
24
+ export {
25
+ useAccount,
26
+ useConfig
27
+ };
@@ -2,9 +2,11 @@
2
2
  import {
3
3
  Box,
4
4
  Text,
5
- themeVars,
5
+ themeVars
6
+ } from "./chunk-LUHEVXPD.js";
7
+ import {
6
8
  useFunkitTranslation
7
- } from "./chunk-7UIDHSYG.js";
9
+ } from "./chunk-STLOQEN7.js";
8
10
 
9
11
  // src/providers/FunkitConfigContext.tsx
10
12
  import {
@@ -2,12 +2,14 @@
2
2
  import {
3
3
  AsyncImage,
4
4
  preloadRemoteImages
5
- } from "./chunk-7G3QEQFB.js";
5
+ } from "./chunk-2NBYHUIW.js";
6
6
  import {
7
7
  Box,
8
- Text,
8
+ Text
9
+ } from "./chunk-LUHEVXPD.js";
10
+ import {
9
11
  useFunkitTranslation
10
- } from "./chunk-7UIDHSYG.js";
12
+ } from "./chunk-STLOQEN7.js";
11
13
  import "./chunk-AHYOV7AV.js";
12
14
 
13
15
  // src/clients/fanatics.tsx
@@ -1,14 +1,17 @@
1
1
  "use client";
2
2
  import {
3
3
  AsyncImage
4
- } from "./chunk-7G3QEQFB.js";
4
+ } from "./chunk-2NBYHUIW.js";
5
5
  import {
6
6
  useFunkitConfig
7
- } from "./chunk-MXPZTW2H.js";
7
+ } from "./chunk-VT3ERWXE.js";
8
+ import {
9
+ Box
10
+ } from "./chunk-LUHEVXPD.js";
11
+ import "./chunk-UPZNKPYU.js";
8
12
  import {
9
- Box,
10
13
  useFunkitTranslation
11
- } from "./chunk-7UIDHSYG.js";
14
+ } from "./chunk-STLOQEN7.js";
12
15
  import {
13
16
  logger
14
17
  } from "./chunk-AHYOV7AV.js";
@@ -15,7 +15,7 @@
15
15
  * verified on-chain (owner = the Fun deployer).
16
16
  */
17
17
  import { type Address } from 'viem';
18
- import type { FunkitCheckoutActionParams } from '../providers/FunkitCheckoutContext/types';
18
+ import type { FunkitCheckoutActionParams, TokenInfo, WalletWithdrawalConfig } from '../providers/FunkitCheckoutContext/types';
19
19
  /** Mallard deposit contract to credit a Mallard (perps) account. */
20
20
  export declare const MALLARD_DEPOSIT_ADDRESS: `0x${string}`;
21
21
  /** VaultDepositooor on Zorro chain. */
@@ -47,3 +47,45 @@ export interface MallardDepositActionsConfig {
47
47
  * ```
48
48
  */
49
49
  export declare function createMallardDepositActions(config: MallardDepositActionsConfig): () => Promise<FunkitCheckoutActionParams[]>;
50
+ /** USDG (the perps/spot collateral token) on the Robinhood chain. */
51
+ export declare const MALLARD_USDG_ADDRESS: `0x${string}`;
52
+ /** USDG logo served from the Fun CDN. */
53
+ export declare const MALLARD_USDG_ICON_SRC = "https://sdk-cdn.fun.xyz/images/usdg.svg";
54
+ export interface MallardWithdrawalConfig {
55
+ /**
56
+ * Source token to withdraw. Defaults to USDG ({@link MALLARD_USDG_ADDRESS})
57
+ * on the Robinhood chain.
58
+ */
59
+ sourceTokenAddress?: Address;
60
+ /** Source chain id. Defaults to the Robinhood mainnet chain. */
61
+ sourceChainId?: number;
62
+ /** Symbol shown for the source token. Defaults to `'USDG'`. */
63
+ sourceTokenSymbol?: string;
64
+ /** Title shown in the withdrawal modal. Defaults to the localized "Withdraw". */
65
+ modalTitle?: string;
66
+ /** Disable the connected-wallet option for email-login users. */
67
+ disableConnectedWallet?: boolean;
68
+ /** Token logo (50px). Defaults to {@link MALLARD_USDG_ICON_SRC}. */
69
+ iconSrc?: string;
70
+ /** Default token to preselect in the receive-token dropdown. */
71
+ defaultReceiveToken?: string;
72
+ /** Minimum USD value required to withdraw, evaluated per receive-token. */
73
+ getMinWithdrawalUSD?: (asset: TokenInfo) => number;
74
+ /** Maximum USD value allowed for a single withdrawal. */
75
+ getMaxWithdrawalUSD?: (asset: TokenInfo) => number;
76
+ /** Async hook fired after the withdraw CTA but before any wallet signature. */
77
+ onBeforeSign?: () => Promise<void> | void;
78
+ }
79
+ /**
80
+ * React entry point for Mallard withdrawals. Returns a
81
+ * {@link WalletWithdrawalConfig} (executing wallet = the connected wallet, via
82
+ * {@link createConnectedWalletWithdrawalClient}), or `null` until a config is
83
+ * passed and a wallet is connected. Balance isn't read here — the modal sources
84
+ * it from the checkout config's `withdrawalSourceTokenBalance`, like
85
+ * Lighter/Polymarket.
86
+ *
87
+ * ```tsx
88
+ * const mallard = useMallardWithdrawalConfig(isConnected ? {} : null)
89
+ * ```
90
+ */
91
+ export declare function useMallardWithdrawalConfig(config: MallardWithdrawalConfig | null): WalletWithdrawalConfig | null;
@@ -1,13 +1,46 @@
1
1
  "use client";
2
+ import {
3
+ useAccount,
4
+ useConfig
5
+ } from "./chunk-UPZNKPYU.js";
6
+ import {
7
+ useFunkitTranslation
8
+ } from "./chunk-STLOQEN7.js";
9
+ import {
10
+ logger
11
+ } from "./chunk-AHYOV7AV.js";
2
12
 
3
13
  // src/clients/mallard.tsx
14
+ import { ROBINHOOD_MAINNET_CHAIN_ID } from "@funkit/chains";
4
15
  import { VAULT_DEPOSITOR_ABI } from "@funkit/fun-relay";
16
+ import { useMemo } from "react";
5
17
  import {
6
18
  encodeFunctionData,
7
- erc20Abi,
19
+ erc20Abi as erc20Abi2,
8
20
  getAddress,
9
21
  maxUint256
10
22
  } from "viem";
23
+
24
+ // src/wagmi/actions.ts
25
+ import { erc20Abi, formatUnits } from "viem";
26
+ import {
27
+ getBalance as getBalanceCore,
28
+ multicall as multicallCore
29
+ } from "wagmi/actions";
30
+ import {
31
+ estimateGas,
32
+ getAccount,
33
+ getGasPrice,
34
+ getTransaction,
35
+ getWalletClient,
36
+ multicall,
37
+ readContract,
38
+ sendTransaction,
39
+ switchChain,
40
+ waitForTransactionReceipt
41
+ } from "wagmi/actions";
42
+
43
+ // src/clients/mallard.tsx
11
44
  var MALLARD_DEPOSIT_ADDRESS = getAddress(
12
45
  "0xb272c91D84d6538C8F31ab092A53Bfe8916B5449"
13
46
  );
@@ -62,7 +95,7 @@ function createMallardDepositActions(config) {
62
95
  // that's only needed for USDT-style tokens that require zeroing allowance first; USDG
63
96
  // is standard ERC-20.
64
97
  {
65
- contractAbi: erc20Abi,
98
+ contractAbi: erc20Abi2,
66
99
  contractAddress: token,
67
100
  functionName: "approve",
68
101
  functionArgs: [vaultDepositorAddress, maxUint256]
@@ -78,9 +111,85 @@ function createMallardDepositActions(config) {
78
111
  ];
79
112
  };
80
113
  }
114
+ var MALLARD_USDG_ADDRESS = getAddress(
115
+ "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168"
116
+ );
117
+ var MALLARD_USDG_ICON_SRC = "https://sdk-cdn.fun.xyz/images/usdg.svg";
118
+ function createConnectedWalletWithdrawalClient(config, ownerAddress, sourceChainId) {
119
+ const ensureOnChain = async (chainId) => {
120
+ if (getAccount(config).chainId !== chainId) {
121
+ await switchChain(config, { chainId });
122
+ }
123
+ };
124
+ return {
125
+ address: () => ownerAddress,
126
+ getChainId: async () => sourceChainId,
127
+ switchChain: async (chainId) => {
128
+ await ensureOnChain(chainId);
129
+ },
130
+ sendTransaction: async (chainId, transaction) => {
131
+ await ensureOnChain(chainId);
132
+ return sendTransaction(config, {
133
+ to: transaction.to,
134
+ data: transaction.data,
135
+ value: BigInt(transaction.value || "0"),
136
+ chainId
137
+ });
138
+ },
139
+ confirmTransaction: (txHash, chainId) => (
140
+ // wagmi-core's receipt (chain-formatter generics) is the same runtime
141
+ // shape as viem's `TransactionReceipt` but isn't structurally assignable
142
+ // to it; cast at this boundary. Using wagmi (not a viem publicClient) is
143
+ // deliberate — it reuses the connected wallet's configured transport
144
+ // instead of requiring a separate RPC endpoint.
145
+ waitForTransactionReceipt(config, {
146
+ hash: txHash,
147
+ chainId
148
+ })
149
+ )
150
+ };
151
+ }
152
+ function useMallardWithdrawalConfig(config) {
153
+ const { t } = useFunkitTranslation();
154
+ const wagmiConfig = useConfig();
155
+ const { address } = useAccount();
156
+ const sourceChainId = config?.sourceChainId ?? ROBINHOOD_MAINNET_CHAIN_ID;
157
+ const sourceTokenAddress = config?.sourceTokenAddress ?? MALLARD_USDG_ADDRESS;
158
+ return useMemo(() => {
159
+ if (!config || !address) {
160
+ return null;
161
+ }
162
+ const wallet = createConnectedWalletWithdrawalClient(
163
+ wagmiConfig,
164
+ address,
165
+ sourceChainId
166
+ );
167
+ logger.info("mallard:withdrawal:configBuilt", {
168
+ sourceChainId,
169
+ sourceTokenAddress,
170
+ owner: address
171
+ });
172
+ return {
173
+ modalTitle: config.modalTitle ?? t("withdrawal.withdraw"),
174
+ disableConnectedWallet: config.disableConnectedWallet,
175
+ onBeforeSign: config.onBeforeSign,
176
+ wallet,
177
+ sourceChainId: sourceChainId.toString(),
178
+ sourceTokenSymbol: config.sourceTokenSymbol ?? "USDG",
179
+ defaultReceiveToken: config.defaultReceiveToken,
180
+ sourceTokenAddress,
181
+ iconSrc: config.iconSrc ?? MALLARD_USDG_ICON_SRC,
182
+ getMinWithdrawalUSD: config.getMinWithdrawalUSD,
183
+ getMaxWithdrawalUSD: config.getMaxWithdrawalUSD
184
+ };
185
+ }, [config, address, wagmiConfig, sourceChainId, sourceTokenAddress, t]);
186
+ }
81
187
  export {
82
188
  AMOUNT_PLACEHOLDER,
83
189
  MALLARD_DEPOSIT_ADDRESS,
190
+ MALLARD_USDG_ADDRESS,
191
+ MALLARD_USDG_ICON_SRC,
84
192
  VAULT_DEPOSITOR_ZORRO,
85
- createMallardDepositActions
193
+ createMallardDepositActions,
194
+ useMallardWithdrawalConfig
86
195
  };
@@ -1,12 +1,14 @@
1
1
  "use client";
2
2
  import {
3
3
  PolymarketDepositAccountDropdown
4
- } from "../chunk-SQ2RX7WY.js";
4
+ } from "../chunk-4IWQ2UT5.js";
5
5
  import "../chunk-ZEXZQOAO.js";
6
- import "../chunk-VJZW3MA3.js";
7
- import "../chunk-MXPZTW2H.js";
8
- import "../chunk-7UIDHSYG.js";
9
- import "../chunk-ME4OAQIY.js";
6
+ import "../chunk-VT3ERWXE.js";
7
+ import "../chunk-LUHEVXPD.js";
8
+ import "../chunk-UPZNKPYU.js";
9
+ import "../chunk-STLOQEN7.js";
10
+ import "../chunk-F4SCUKY6.js";
11
+ import "../chunk-O5CTDT3L.js";
10
12
  import "../chunk-AHYOV7AV.js";
11
13
  export {
12
14
  PolymarketDepositAccountDropdown
@@ -4,8 +4,8 @@ import {
4
4
  POLYMARKET_PREDICTIONS_ROUTING_ID,
5
5
  createPolymarketDepositConfig,
6
6
  createPredictionsGenerateActionParams
7
- } from "../chunk-VJZW3MA3.js";
8
- import "../chunk-ME4OAQIY.js";
7
+ } from "../chunk-F4SCUKY6.js";
8
+ import "../chunk-O5CTDT3L.js";
9
9
  import "../chunk-AHYOV7AV.js";
10
10
  export {
11
11
  POLYMARKET_PERPS_ROUTING_ID,
@@ -1,16 +1,18 @@
1
1
  "use client";
2
2
  import {
3
3
  PolymarketDepositAccountDropdown
4
- } from "../chunk-SQ2RX7WY.js";
4
+ } from "../chunk-4IWQ2UT5.js";
5
5
  import "../chunk-ZEXZQOAO.js";
6
+ import "../chunk-VT3ERWXE.js";
7
+ import "../chunk-LUHEVXPD.js";
8
+ import "../chunk-UPZNKPYU.js";
9
+ import "../chunk-STLOQEN7.js";
6
10
  import {
7
11
  POLYMARKET_PERPS_ROUTING_ID,
8
12
  POLYMARKET_PREDICTIONS_ROUTING_ID,
9
13
  createPolymarketDepositConfig,
10
14
  createPredictionsGenerateActionParams
11
- } from "../chunk-VJZW3MA3.js";
12
- import "../chunk-MXPZTW2H.js";
13
- import "../chunk-7UIDHSYG.js";
15
+ } from "../chunk-F4SCUKY6.js";
14
16
  import {
15
17
  AMOUNT_PLACEHOLDER,
16
18
  COLLATERAL_ONRAMP_ABI,
@@ -21,7 +23,7 @@ import {
21
23
  VAULT_DEPOSITOR_POLYGON,
22
24
  createPerpsGenerateActionParams,
23
25
  createPolymarketWithdrawalConfig
24
- } from "../chunk-ME4OAQIY.js";
26
+ } from "../chunk-O5CTDT3L.js";
25
27
  import "../chunk-AHYOV7AV.js";
26
28
  export {
27
29
  AMOUNT_PLACEHOLDER,
@@ -9,7 +9,7 @@ import {
9
9
  VAULT_DEPOSITOR_POLYGON,
10
10
  createPerpsGenerateActionParams,
11
11
  createPolymarketWithdrawalConfig
12
- } from "../chunk-ME4OAQIY.js";
12
+ } from "../chunk-O5CTDT3L.js";
13
13
  import "../chunk-AHYOV7AV.js";
14
14
  export {
15
15
  AMOUNT_PLACEHOLDER,
@@ -33,6 +33,27 @@ export interface HistoricalCheckoutItem extends Pick<FunkitActiveCheckoutItem, H
33
33
  };
34
34
  isWithdrawal?: boolean;
35
35
  }
36
+ /**
37
+ * Build the checkout config for a deposit re-started from history (the
38
+ * "New deposit" CTA). Serialized history can't carry closures, so every
39
+ * function-valued field is only restorable from the live config:
40
+ * - candidates' per-route `generateActionsParams` (and `finalizedToken`) are
41
+ * stripped on serialize, so the still-active checkout takes the
42
+ * function-bearing candidates from `liveConfig` — otherwise a destination
43
+ * switch would re-bind `dynamicRoutingId` without its post-action; a
44
+ * non-active historical checkout has no live closures, so it keeps the
45
+ * stripped candidates;
46
+ * - `modalTitle` is restored whenever a live config exists (falling back to the
47
+ * serializable value) so validation passes;
48
+ * - the remaining live-only closures (`getMinDepositUSD`,
49
+ * `generateActionsParams`, `polymarketPerpsTransfer`, `resolveHealthFactor`)
50
+ * are carried forward only when re-starting the still-active checkout.
51
+ */
52
+ export declare function createNewCheckoutConfig({ serializedConfig, liveConfig, isActiveCheckout, }: {
53
+ serializedConfig: ServerCheckoutConfig;
54
+ liveConfig: FunkitCheckoutConfig | undefined;
55
+ isActiveCheckout: boolean;
56
+ }): FunkitCheckoutConfig;
36
57
  /**
37
58
  * Sanitizes checkoutItem to generate a clientMetadata object to be saved in backend.
38
59
  * Ensures that no react components get sent to backend and the object isn't too big as well.