@funkit/connect 7.1.0-next.15 → 7.1.0-next.18

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 7.1.0-next.18
4
+
5
+ ### Patch Changes
6
+
7
+ - e2b103e: Unified checkout item display logic to use same itemName derivation for both arbitrary action checkouts and basic buy checkouts
8
+
9
+ ## 7.1.0-next.17
10
+
11
+ ### Patch Changes
12
+
13
+ - a979216: remove target asset check in lighter
14
+ - 52406e3: feat(connect,fun-relay): add new lighter spot assets
15
+ - 57356c6: feat(connect): add SKY asset
16
+ - 2f57830: feat: implemented revoke/reset approval mechanics for tokens with non-standard approval implementation
17
+ - ab9c1e9: chore: update assets
18
+ - d7c0812: feat(connect): show payment sources in disabled state w/coming soon badge for unsupported target assets
19
+ - Updated dependencies [320236b]
20
+ - Updated dependencies [52406e3]
21
+ - Updated dependencies [2f57830]
22
+ - Updated dependencies [ab9c1e9]
23
+ - Updated dependencies [d4b9ea5]
24
+ - @funkit/fun-relay@2.2.0-next.6
25
+
26
+ ## 7.1.0-next.16
27
+
28
+ ### Patch Changes
29
+
30
+ - f490277: add cache for performance
31
+
3
32
  ## 7.1.0-next.15
4
33
 
5
34
  ### Patch Changes
@@ -137,6 +137,91 @@ declare const _default: {
137
137
  readonly path: "FUN_MAINNET_DEPOSIT";
138
138
  };
139
139
  }];
140
+ }, {
141
+ readonly routeId: "LIGHTER_LINK_SPOT_NEW_USER";
142
+ readonly rules: readonly [{
143
+ readonly when: {
144
+ readonly chainId: "1";
145
+ readonly tokenAddress: "0x514910771AF9Ca656af840dff83E8264EcF986CA";
146
+ };
147
+ readonly use: {
148
+ readonly path: "FUN_MAINNET_DEPOSIT";
149
+ readonly badge: "NATIVE";
150
+ };
151
+ }, {
152
+ readonly when: "*";
153
+ readonly use: {
154
+ readonly path: "FUN_MAINNET_DEPOSIT";
155
+ };
156
+ }];
157
+ }, {
158
+ readonly routeId: "LIGHTER_UNI_SPOT_NEW_USER";
159
+ readonly rules: readonly [{
160
+ readonly when: {
161
+ readonly chainId: "1";
162
+ readonly tokenAddress: "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984";
163
+ };
164
+ readonly use: {
165
+ readonly path: "FUN_MAINNET_DEPOSIT";
166
+ readonly badge: "NATIVE";
167
+ };
168
+ }, {
169
+ readonly when: "*";
170
+ readonly use: {
171
+ readonly path: "FUN_MAINNET_DEPOSIT";
172
+ };
173
+ }];
174
+ }, {
175
+ readonly routeId: "LIGHTER_AAVE_SPOT_NEW_USER";
176
+ readonly rules: readonly [{
177
+ readonly when: {
178
+ readonly chainId: "1";
179
+ readonly tokenAddress: "0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9";
180
+ };
181
+ readonly use: {
182
+ readonly path: "FUN_MAINNET_DEPOSIT";
183
+ readonly badge: "NATIVE";
184
+ };
185
+ }, {
186
+ readonly when: "*";
187
+ readonly use: {
188
+ readonly path: "FUN_MAINNET_DEPOSIT";
189
+ };
190
+ }];
191
+ }, {
192
+ readonly routeId: "LIGHTER_SKY_SPOT_NEW_USER";
193
+ readonly rules: readonly [{
194
+ readonly when: {
195
+ readonly chainId: "1";
196
+ readonly tokenAddress: "0x56072C95FAA701256059aa122697B133aDEd9279";
197
+ };
198
+ readonly use: {
199
+ readonly path: "FUN_MAINNET_DEPOSIT";
200
+ readonly badge: "NATIVE";
201
+ };
202
+ }, {
203
+ readonly when: "*";
204
+ readonly use: {
205
+ readonly path: "FUN_MAINNET_DEPOSIT";
206
+ };
207
+ }];
208
+ }, {
209
+ readonly routeId: "LIGHTER_LDO_SPOT_NEW_USER";
210
+ readonly rules: readonly [{
211
+ readonly when: {
212
+ readonly chainId: "1";
213
+ readonly tokenAddress: "0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32";
214
+ };
215
+ readonly use: {
216
+ readonly path: "FUN_MAINNET_DEPOSIT";
217
+ readonly badge: "NATIVE";
218
+ };
219
+ }, {
220
+ readonly when: "*";
221
+ readonly use: {
222
+ readonly path: "FUN_MAINNET_DEPOSIT";
223
+ };
224
+ }];
140
225
  }];
141
226
  };
142
227
  readonly enablebitcoin: {
@@ -146,6 +231,13 @@ declare const _default: {
146
231
  readonly value: false;
147
232
  };
148
233
  readonly enablefiatdeposit: {
234
+ readonly variants: readonly [{
235
+ readonly condition: {
236
+ readonly type: "country";
237
+ readonly countryCodes: readonly ["US"];
238
+ };
239
+ readonly value: false;
240
+ }];
149
241
  readonly value: true;
150
242
  };
151
243
  readonly enablemeldpayment: {
@@ -154,18 +246,6 @@ declare const _default: {
154
246
  readonly enabletokentransfer: {
155
247
  readonly value: true;
156
248
  };
157
- readonly enabletokentransfertest: {
158
- readonly variants: readonly [{
159
- readonly conditions: {
160
- readonly all: readonly [{
161
- readonly type: "allowedCountries";
162
- readonly countries: readonly ["SG", "DE"];
163
- }];
164
- };
165
- readonly value: true;
166
- }];
167
- readonly value: false;
168
- };
169
249
  readonly ismexico: {
170
250
  readonly value: {
171
251
  readonly mexico: false;
@@ -193,6 +273,31 @@ declare const _default: {
193
273
  readonly SGD: readonly [130, 645, 1285];
194
274
  };
195
275
  };
276
+ readonly mintokentransfervalue: {
277
+ readonly variants: readonly [{
278
+ readonly condition: {
279
+ readonly type: "country";
280
+ readonly countryCodes: readonly ["CA"];
281
+ };
282
+ readonly value: {
283
+ readonly mainnet: 15;
284
+ readonly nonMainnet: 3;
285
+ };
286
+ }, {
287
+ readonly condition: {
288
+ readonly type: "country";
289
+ readonly countryCodes: readonly ["AU"];
290
+ };
291
+ readonly value: {
292
+ readonly mainnet: 15;
293
+ readonly nonMainnet: 3;
294
+ };
295
+ }];
296
+ readonly value: {
297
+ readonly mainnet: 10;
298
+ readonly nonMainnet: 2.5;
299
+ };
300
+ };
196
301
  readonly showinfobanner: {
197
302
  readonly value: {
198
303
  readonly message: "";
@@ -3,12 +3,14 @@ import type { DynamicTargetAssetCandidate } from '../../providers/FunkitCheckout
3
3
  import { type BaseDropdownProps } from './BaseDropdown';
4
4
  interface ReceiveTokenDropdownProps {
5
5
  chainId: number;
6
+ displayedChainId?: number;
6
7
  tokens: DynamicTargetAssetCandidate[];
7
8
  onTokenSelected: (token: DynamicTargetAssetCandidate) => void;
8
9
  selectedToken?: string;
9
10
  label?: string;
10
11
  activeItemLabel?: string;
11
12
  activeItemProps?: BaseDropdownProps['activeItemProps'];
13
+ maxDropdownHeight?: BaseDropdownProps['maxDropdownHeight'];
12
14
  }
13
- export declare const ReceiveTokenDropdown: ({ tokens, chainId, selectedToken, onTokenSelected, label, activeItemLabel, activeItemProps, }: ReceiveTokenDropdownProps) => React.JSX.Element;
15
+ export declare const ReceiveTokenDropdown: ({ tokens, chainId, selectedToken, onTokenSelected, label, activeItemLabel, activeItemProps, maxDropdownHeight, displayedChainId, }: ReceiveTokenDropdownProps) => React.JSX.Element;
14
16
  export {};
@@ -11,4 +11,5 @@ export declare function usePaymentMethodEnablement({ checkoutConfig, }: {
11
11
  export declare const usePaymentSources: (paymentMethodInfo: ConnectablePaymentMethodInfo | null, targetChainId: string, checkoutConfig?: FunkitCheckoutConfig) => {
12
12
  preferred: PaymentMethod[] | (import("../domains/paymentMethods").PaymentMethodBrokerageInfo | import("../domains/paymentMethods").PaymentMethodAccountInfo | import("../domains/paymentMethods").PaymentMethodVirtualBankInfo)[];
13
13
  moreSources: PaymentMethod[];
14
+ comingSoon: PaymentMethod[];
14
15
  };
package/dist/index.js CHANGED
@@ -779,7 +779,7 @@ var getRemoteImageStyles = (isRemoteImage, isRemoteImageLoaded, src) => {
779
779
  };
780
780
 
781
781
  // src/components/ConnectButton/ConnectButtonRenderer.tsx
782
- import { formatCurrencyAndStringify as formatCurrencyAndStringify15, isMobile as isMobile14, noop as noop9 } from "@funkit/utils";
782
+ import { formatCurrencyAndStringify as formatCurrencyAndStringify15, isMobile as isMobile14, noop as noop10 } from "@funkit/utils";
783
783
  import React240 from "react";
784
784
  import { useAccount as useAccount12, useBalance, useConfig as useConfig8 } from "wagmi";
785
785
 
@@ -859,7 +859,7 @@ import {
859
859
  isTokenEquivalent as isTokenEquivalent7,
860
860
  round as round4
861
861
  } from "@funkit/utils";
862
- import { arbitrum as arbitrum5, base as base7, mainnet as mainnet12, optimism, polygon as polygon6 } from "viem/chains";
862
+ import { arbitrum as arbitrum5, base as base7, mainnet as mainnet13, optimism, polygon as polygon6 } from "viem/chains";
863
863
 
864
864
  // src/modals/CheckoutModal/InputAmount/utils.ts
865
865
  import { formatCurrencyAndStringify } from "@funkit/utils";
@@ -1055,8 +1055,8 @@ import {
1055
1055
  isTokenEquivalent as isTokenEquivalent6,
1056
1056
  round as round3
1057
1057
  } from "@funkit/utils";
1058
- import { getBalance, readContract } from "@wagmi/core";
1059
- import { erc20Abi as erc20Abi3, isAddress as isAddress3 } from "viem";
1058
+ import { getBalance, readContract as readContract2 } from "@wagmi/core";
1059
+ import { erc20Abi as erc20Abi4, isAddress as isAddress3 } from "viem";
1060
1060
 
1061
1061
  // src/providers/FunkitCheckoutContext/index.tsx
1062
1062
  import {
@@ -1427,7 +1427,7 @@ function setFunkitConnectVersion({ version }) {
1427
1427
  localStorage.setItem(storageKey, version);
1428
1428
  }
1429
1429
  function getCurrentSdkVersion() {
1430
- return "7.1.0-next.15";
1430
+ return "7.1.0-next.18";
1431
1431
  }
1432
1432
  function useFingerprint() {
1433
1433
  const fingerprint = useCallback3(() => {
@@ -1701,8 +1701,10 @@ var useTrack = () => {
1701
1701
 
1702
1702
  // src/hooks/useCheckoutDirectExecution.ts
1703
1703
  import { DirectExecutionType, getCheckoutQuoteV2 } from "@funkit/api-base";
1704
- import { executeRelayQuote } from "@funkit/fun-relay";
1704
+ import { executeRelayQuote, shouldResetApproval } from "@funkit/fun-relay";
1705
1705
  import { useCallback as useCallback7 } from "react";
1706
+ import { decodeFunctionData, erc20Abi, getAddress } from "viem";
1707
+ import { readContract } from "viem/actions";
1706
1708
  import { useWalletClient } from "wagmi";
1707
1709
 
1708
1710
  // src/consts/checkout.ts
@@ -2461,6 +2463,111 @@ var default_configs_default = {
2461
2463
  }
2462
2464
  }
2463
2465
  ]
2466
+ },
2467
+ {
2468
+ routeId: "LIGHTER_LINK_SPOT_NEW_USER",
2469
+ rules: [
2470
+ {
2471
+ when: {
2472
+ chainId: "1",
2473
+ tokenAddress: "0x514910771AF9Ca656af840dff83E8264EcF986CA"
2474
+ },
2475
+ use: {
2476
+ path: "FUN_MAINNET_DEPOSIT",
2477
+ badge: "NATIVE"
2478
+ }
2479
+ },
2480
+ {
2481
+ when: "*",
2482
+ use: {
2483
+ path: "FUN_MAINNET_DEPOSIT"
2484
+ }
2485
+ }
2486
+ ]
2487
+ },
2488
+ {
2489
+ routeId: "LIGHTER_UNI_SPOT_NEW_USER",
2490
+ rules: [
2491
+ {
2492
+ when: {
2493
+ chainId: "1",
2494
+ tokenAddress: "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"
2495
+ },
2496
+ use: {
2497
+ path: "FUN_MAINNET_DEPOSIT",
2498
+ badge: "NATIVE"
2499
+ }
2500
+ },
2501
+ {
2502
+ when: "*",
2503
+ use: {
2504
+ path: "FUN_MAINNET_DEPOSIT"
2505
+ }
2506
+ }
2507
+ ]
2508
+ },
2509
+ {
2510
+ routeId: "LIGHTER_AAVE_SPOT_NEW_USER",
2511
+ rules: [
2512
+ {
2513
+ when: {
2514
+ chainId: "1",
2515
+ tokenAddress: "0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9"
2516
+ },
2517
+ use: {
2518
+ path: "FUN_MAINNET_DEPOSIT",
2519
+ badge: "NATIVE"
2520
+ }
2521
+ },
2522
+ {
2523
+ when: "*",
2524
+ use: {
2525
+ path: "FUN_MAINNET_DEPOSIT"
2526
+ }
2527
+ }
2528
+ ]
2529
+ },
2530
+ {
2531
+ routeId: "LIGHTER_SKY_SPOT_NEW_USER",
2532
+ rules: [
2533
+ {
2534
+ when: {
2535
+ chainId: "1",
2536
+ tokenAddress: "0x56072C95FAA701256059aa122697B133aDEd9279"
2537
+ },
2538
+ use: {
2539
+ path: "FUN_MAINNET_DEPOSIT",
2540
+ badge: "NATIVE"
2541
+ }
2542
+ },
2543
+ {
2544
+ when: "*",
2545
+ use: {
2546
+ path: "FUN_MAINNET_DEPOSIT"
2547
+ }
2548
+ }
2549
+ ]
2550
+ },
2551
+ {
2552
+ routeId: "LIGHTER_LDO_SPOT_NEW_USER",
2553
+ rules: [
2554
+ {
2555
+ when: {
2556
+ chainId: "1",
2557
+ tokenAddress: "0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32"
2558
+ },
2559
+ use: {
2560
+ path: "FUN_MAINNET_DEPOSIT",
2561
+ badge: "NATIVE"
2562
+ }
2563
+ },
2564
+ {
2565
+ when: "*",
2566
+ use: {
2567
+ path: "FUN_MAINNET_DEPOSIT"
2568
+ }
2569
+ }
2570
+ ]
2464
2571
  }
2465
2572
  ]
2466
2573
  },
@@ -2471,6 +2578,15 @@ var default_configs_default = {
2471
2578
  value: false
2472
2579
  },
2473
2580
  enablefiatdeposit: {
2581
+ variants: [
2582
+ {
2583
+ condition: {
2584
+ type: "country",
2585
+ countryCodes: ["US"]
2586
+ },
2587
+ value: false
2588
+ }
2589
+ ],
2474
2590
  value: true
2475
2591
  },
2476
2592
  enablemeldpayment: {
@@ -2479,22 +2595,6 @@ var default_configs_default = {
2479
2595
  enabletokentransfer: {
2480
2596
  value: true
2481
2597
  },
2482
- enabletokentransfertest: {
2483
- variants: [
2484
- {
2485
- conditions: {
2486
- all: [
2487
- {
2488
- type: "allowedCountries",
2489
- countries: ["SG", "DE"]
2490
- }
2491
- ]
2492
- },
2493
- value: true
2494
- }
2495
- ],
2496
- value: false
2497
- },
2498
2598
  ismexico: {
2499
2599
  value: {
2500
2600
  mexico: false
@@ -2522,6 +2622,34 @@ var default_configs_default = {
2522
2622
  SGD: [130, 645, 1285]
2523
2623
  }
2524
2624
  },
2625
+ mintokentransfervalue: {
2626
+ variants: [
2627
+ {
2628
+ condition: {
2629
+ type: "country",
2630
+ countryCodes: ["CA"]
2631
+ },
2632
+ value: {
2633
+ mainnet: 15,
2634
+ nonMainnet: 3
2635
+ }
2636
+ },
2637
+ {
2638
+ condition: {
2639
+ type: "country",
2640
+ countryCodes: ["AU"]
2641
+ },
2642
+ value: {
2643
+ mainnet: 15,
2644
+ nonMainnet: 3
2645
+ }
2646
+ }
2647
+ ],
2648
+ value: {
2649
+ mainnet: 10,
2650
+ nonMainnet: 2.5
2651
+ }
2652
+ },
2525
2653
  showinfobanner: {
2526
2654
  value: {
2527
2655
  message: "",
@@ -2617,15 +2745,18 @@ import {
2617
2745
  AVANTIS_API_KEY as AVANTIS_API_KEY2,
2618
2746
  BANKR_API_KEY as BANKR_API_KEY2,
2619
2747
  BASED_API_KEY as BASED_API_KEY2,
2748
+ BENTO_API_KEY,
2620
2749
  BULLPEN_API_KEY,
2621
2750
  ETHEREAL_API_KEY as ETHEREAL_API_KEY3,
2622
2751
  FELIX_API_KEY,
2752
+ GINZA_API_KEY,
2623
2753
  HYENA_API_KEY as HYENA_API_KEY2,
2624
2754
  HYPERBEAT_API_KEY as HYPERBEAT_API_KEY2,
2625
2755
  HYPERDASH_API_KEY as HYPERDASH_API_KEY2,
2626
2756
  HYPEREDGE_API_KEY,
2627
2757
  HYPERSWAP_API_KEY,
2628
2758
  KATANA_API_KEY as KATANA_API_KEY2,
2759
+ KURU_API_KEY,
2629
2760
  LIGHTERXYZ_API_KEY as LIGHTERXYZ_API_KEY2,
2630
2761
  MEGAPOT_API_KEY,
2631
2762
  MONAD_API_KEY as MONAD_API_KEY2,
@@ -2636,9 +2767,9 @@ import {
2636
2767
  SUSHI_API_KEY,
2637
2768
  VENTUALS_API_KEY
2638
2769
  } from "@funkit/api-base";
2639
- import { MONAD_CHAIN_ID, bitcoinChain } from "@funkit/chains";
2770
+ import { MONAD_CHAIN_ID } from "@funkit/chains";
2640
2771
  import { FlagKey } from "@funkit/utils";
2641
- import { arbitrum, base as base3, polygon } from "viem/chains";
2772
+ import { arbitrum, base as base3, mainnet as mainnet5, polygon } from "viem/chains";
2642
2773
  var FUN_INTERNAL_USERS = [
2643
2774
  "0x6ec0c2f25d323e7779925Cc20c3740101f990d9F",
2644
2775
  // Chloe
@@ -2738,8 +2869,9 @@ var QR_CODE_WITH_SOLANA = {
2738
2869
  1151111081099710: ["SOL", "USDC", "USDT", "TRUMP", "USDe"]
2739
2870
  };
2740
2871
  var QR_CODE_WITH_BITCOIN = {
2741
- ...QR_CODE_WITH_SOLANA,
2742
- [bitcoinChain.id]: ["BTC"]
2872
+ ...QR_CODE_WITH_SOLANA
2873
+ // uncomment to re-enable bitcoin
2874
+ // [bitcoinChain.id]: ['BTC'],
2743
2875
  };
2744
2876
  var QR_CODE_WITH_MONAD = {
2745
2877
  ...QR_CODE_WITH_BITCOIN,
@@ -3002,7 +3134,7 @@ var flagConfig = {
3002
3134
  values: [POLYMARKET_API_KEY2]
3003
3135
  }
3004
3136
  ],
3005
- value: bitcoinChain.id.toString()
3137
+ value: mainnet5.id.toString()
3006
3138
  }
3007
3139
  ]
3008
3140
  },
@@ -3189,13 +3321,16 @@ var flagConfig = {
3189
3321
  values: [
3190
3322
  AVANTIS_API_KEY2,
3191
3323
  BASED_API_KEY2,
3324
+ BENTO_API_KEY,
3192
3325
  BULLPEN_API_KEY,
3193
3326
  ETHEREAL_API_KEY3,
3194
3327
  FELIX_API_KEY,
3328
+ GINZA_API_KEY,
3195
3329
  HYENA_API_KEY2,
3196
3330
  HYPERBEAT_API_KEY2,
3197
3331
  HYPEREDGE_API_KEY,
3198
3332
  HYPERSWAP_API_KEY,
3333
+ KURU_API_KEY,
3199
3334
  LIGHTERXYZ_API_KEY2,
3200
3335
  MEGAPOT_API_KEY,
3201
3336
  MONAD_API_KEY2,
@@ -3293,7 +3428,7 @@ var flagConfig = {
3293
3428
  },
3294
3429
  [FlagKey.EnableBitcoin]: {
3295
3430
  type: "boolean",
3296
- default_value: true,
3431
+ default_value: false,
3297
3432
  overrides: [
3298
3433
  // Actually disable bitcoin for Ethereal
3299
3434
  {
@@ -3836,6 +3971,120 @@ function useCheckoutDirectExecution() {
3836
3971
  },
3837
3972
  [t, connector, switchChainAsync]
3838
3973
  );
3974
+ const resetApproval = useCallback7(
3975
+ async ({
3976
+ tokenAddress,
3977
+ spenderAddress
3978
+ }) => {
3979
+ const walletClient = _walletClient;
3980
+ if (!walletClient) {
3981
+ throw new Error("Viem wallet client is not defined");
3982
+ }
3983
+ const logPrefix3 = "resetApproval";
3984
+ const logData = { tokenAddress, spenderAddress };
3985
+ logger.info(logPrefix3, logData);
3986
+ const txHash = await walletClient.writeContract({
3987
+ address: tokenAddress,
3988
+ abi: erc20Abi,
3989
+ functionName: "approve",
3990
+ args: [spenderAddress, BigInt(0)]
3991
+ });
3992
+ logData.txHash = txHash;
3993
+ logger.info(`${logPrefix3}:success`, logData);
3994
+ return txHash;
3995
+ },
3996
+ [_walletClient]
3997
+ );
3998
+ const checkAllowance = useCallback7(
3999
+ async ({
4000
+ tokenAddress,
4001
+ ownerAddress,
4002
+ spenderAddress
4003
+ }) => {
4004
+ const walletClient = _walletClient;
4005
+ if (!walletClient) {
4006
+ throw new Error("Viem wallet client is not defined");
4007
+ }
4008
+ const logPrefix3 = "checkAllowance";
4009
+ const logData = {
4010
+ tokenAddress,
4011
+ ownerAddress,
4012
+ spenderAddress
4013
+ };
4014
+ logger.info(logPrefix3, logData);
4015
+ const allowance = await readContract(walletClient, {
4016
+ address: tokenAddress,
4017
+ abi: erc20Abi,
4018
+ functionName: "allowance",
4019
+ args: [ownerAddress, spenderAddress]
4020
+ });
4021
+ logData.allowance = allowance;
4022
+ logger.info(`${logPrefix3}:success`, logData);
4023
+ return allowance;
4024
+ },
4025
+ [_walletClient]
4026
+ );
4027
+ const resetApprovalIfNeeded = useCallback7(
4028
+ async (relayQuote) => {
4029
+ try {
4030
+ const currencyInMetadata = relayQuote.details?.currencyIn?.currency;
4031
+ const currencyInAddress = currencyInMetadata?.address ? getAddress(currencyInMetadata.address) : void 0;
4032
+ const approveAction = relayQuote.steps.find(
4033
+ (step) => currencyInAddress && step.id === "approve" && step.items[0]?.data && step.items[0].data.to.toLowerCase() === currencyInAddress.toLowerCase()
4034
+ );
4035
+ const approveActionItem = approveAction?.items[0];
4036
+ const resetApprovalNeeded = approveActionItem && currencyInAddress && shouldResetApproval(currencyInAddress);
4037
+ const logPrefix3 = "resetApprovalIfNeeded";
4038
+ const logData = {
4039
+ approveAction,
4040
+ approveActionItem,
4041
+ currencyInMetadata,
4042
+ currencyInAddress,
4043
+ resetApprovalNeeded
4044
+ };
4045
+ logger.info(logPrefix3, logData);
4046
+ if (!resetApprovalNeeded) {
4047
+ return;
4048
+ }
4049
+ const decodedFunctionData = decodeFunctionData({
4050
+ abi: erc20Abi,
4051
+ data: approveActionItem.data.data
4052
+ });
4053
+ logData.decodedFunctionData = decodedFunctionData;
4054
+ if (!decodedFunctionData) {
4055
+ logger.error(`${logPrefix3}:error:noData`, logData);
4056
+ return;
4057
+ }
4058
+ const spenderAddress = decodedFunctionData.args[0];
4059
+ logData.spenderAddress = spenderAddress;
4060
+ if (!spenderAddress) {
4061
+ logger.error(`${logPrefix3}:error:noSpenderAddress`, logData);
4062
+ return;
4063
+ }
4064
+ const allowance = await checkAllowance({
4065
+ tokenAddress: currencyInAddress,
4066
+ ownerAddress: approveActionItem.data.from,
4067
+ spenderAddress
4068
+ });
4069
+ logData.allowance = allowance;
4070
+ if (allowance === BigInt(0)) {
4071
+ logger.info(`${logPrefix3}:allowanceIsZero`, logData);
4072
+ return;
4073
+ }
4074
+ logger.info(`${logPrefix3}:resettingApproval`, logData);
4075
+ return await resetApproval({
4076
+ tokenAddress: currencyInAddress,
4077
+ spenderAddress
4078
+ });
4079
+ } catch (error) {
4080
+ logger.error("resetApprovalIfNeeded:error", error, {
4081
+ relayQuote
4082
+ });
4083
+ return;
4084
+ }
4085
+ },
4086
+ [resetApproval, checkAllowance]
4087
+ );
3839
4088
  const startRelayDirectExecution = useCallback7(
3840
4089
  async ({
3841
4090
  checkoutItem,
@@ -3858,6 +4107,7 @@ function useCheckoutDirectExecution() {
3858
4107
  throw new Error("Viem wallet client is not defined");
3859
4108
  }
3860
4109
  await checkAndSwitchChains({ executionChainId, stepMessageSetter });
4110
+ await resetApprovalIfNeeded(relayQuote);
3861
4111
  const translateRelayMessage = (message) => {
3862
4112
  const messageMap2 = {
3863
4113
  "Confirm transaction in your wallet": t("relay.confirmTransaction"),
@@ -3925,18 +4175,18 @@ function useCheckoutDirectExecution() {
3925
4175
  };
3926
4176
  return await waitForConfirmation();
3927
4177
  },
3928
- [_walletClient, checkAndSwitchChains, t]
4178
+ [_walletClient, checkAndSwitchChains, t, resetApprovalIfNeeded]
3929
4179
  );
3930
4180
  const getDirectExecutionInfo = useCallback7(
3931
4181
  (checkoutItem) => {
3932
- const noop10 = {
4182
+ const noop11 = {
3933
4183
  isDirectExecution: false,
3934
4184
  directExecutionType: null,
3935
4185
  getDirectExecutionQuote: getDirectExecutionQuoteNoop,
3936
4186
  executeDirectExecution: executeDirectExecutionNoop
3937
4187
  };
3938
4188
  if (!checkoutItem) {
3939
- return noop10;
4189
+ return noop11;
3940
4190
  }
3941
4191
  const isRelayDirectExecutionCase = getIsRelayEnabled({
3942
4192
  fromChainId: checkoutItem.selectedSourceAssetInfo.chainId,
@@ -3950,7 +4200,7 @@ function useCheckoutDirectExecution() {
3950
4200
  });
3951
4201
  const isDirectExecution = Boolean(isRelayDirectExecutionCase);
3952
4202
  if (!isDirectExecution) {
3953
- return noop10;
4203
+ return noop11;
3954
4204
  }
3955
4205
  return {
3956
4206
  isDirectExecution: true,
@@ -4717,8 +4967,8 @@ function getCheckoutStateBooleans(checkoutState, refundState) {
4717
4967
  }
4718
4968
 
4719
4969
  // src/utils/lighter.ts
4720
- import { getAddress } from "viem";
4721
- var LIGHTER_DEPOSIT_ADDRESS = getAddress(
4970
+ import { getAddress as getAddress2 } from "viem";
4971
+ var LIGHTER_DEPOSIT_ADDRESS = getAddress2(
4722
4972
  "0x3b4d794a66304f130a4db8f2551b0070dfcf5ca7"
4723
4973
  );
4724
4974
  var LIGHTER_NATIVE_FLOW_TIME_ESTIMATE_SECONDS = 60 * 2;
@@ -4727,13 +4977,23 @@ var LIGHTER_DYNAMIC_ROUTING_ID = {
4727
4977
  ETH_SPOT: "LIGHTER_ETH_SPOT",
4728
4978
  USDC_PERPS: "LIGHTER_USDC_PERPS",
4729
4979
  ETH_SPOT_NEW_USER: "LIGHTER_ETH_SPOT_NEW_USER",
4730
- USDC_PERPS_NEW_USER: "LIGHTER_USDC_PERPS_NEW_USER"
4980
+ USDC_PERPS_NEW_USER: "LIGHTER_USDC_PERPS_NEW_USER",
4981
+ LINK_SPOT_NEW_USER: "LIGHTER_LINK_SPOT_NEW_USER",
4982
+ UNI_SPOT_NEW_USER: "LIGHTER_UNI_SPOT_NEW_USER",
4983
+ AAVE_SPOT_NEW_USER: "LIGHTER_AAVE_SPOT_NEW_USER",
4984
+ SKY_SPOT_NEW_USER: "LIGHTER_SKY_SPOT_NEW_USER",
4985
+ LDO_SPOT_NEW_USER: "LIGHTER_LDO_SPOT_NEW_USER"
4731
4986
  };
4732
4987
  var LIGHTER_TOKEN_ADDRESS_BY_ROUTING_ID = {
4733
4988
  ["0x0000000000000000000000000000000000000001".toLowerCase()]: LIGHTER_DYNAMIC_ROUTING_ID.ETH_SPOT,
4734
4989
  ["0x0000000000000000000000000000000000000000".toLowerCase()]: LIGHTER_DYNAMIC_ROUTING_ID.USDC_PERPS,
4735
4990
  ["0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2".toLowerCase()]: LIGHTER_DYNAMIC_ROUTING_ID.ETH_SPOT_NEW_USER,
4736
- ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48".toLowerCase()]: LIGHTER_DYNAMIC_ROUTING_ID.USDC_PERPS_NEW_USER
4991
+ ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48".toLowerCase()]: LIGHTER_DYNAMIC_ROUTING_ID.USDC_PERPS_NEW_USER,
4992
+ ["0x514910771AF9Ca656af840dff83E8264EcF986CA".toLowerCase()]: LIGHTER_DYNAMIC_ROUTING_ID.LINK_SPOT_NEW_USER,
4993
+ ["0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984".toLowerCase()]: LIGHTER_DYNAMIC_ROUTING_ID.UNI_SPOT_NEW_USER,
4994
+ ["0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9".toLowerCase()]: LIGHTER_DYNAMIC_ROUTING_ID.AAVE_SPOT_NEW_USER,
4995
+ ["0x56072C95FAA701256059aa122697B133aDEd9279".toLowerCase()]: LIGHTER_DYNAMIC_ROUTING_ID.SKY_SPOT_NEW_USER,
4996
+ ["0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32".toLowerCase()]: LIGHTER_DYNAMIC_ROUTING_ID.LDO_SPOT_NEW_USER
4737
4997
  };
4738
4998
  var LIGHTER_ROUTING_ID_BY_TOKEN_ADDRESS = Object.fromEntries(
4739
4999
  Object.entries(LIGHTER_TOKEN_ADDRESS_BY_ROUTING_ID).map(
@@ -6238,7 +6498,7 @@ var ASSET_LOGO_SRCS = {
6238
6498
  IMX: "https://sdk-cdn.fun.xyz/images/imx.svg",
6239
6499
  INJ: "https://sdk-cdn.fun.xyz/images/inj.svg",
6240
6500
  LDO: "https://sdk-cdn.fun.xyz/images/ldo.svg",
6241
- LINK: "https://sdk-cdn.fun.xyz/images/link.svg",
6501
+ LINK: "https://sdk-cdn.fun.xyz/images/link.png",
6242
6502
  LUCK: "https://sdk-cdn.fun.xyz/images/luck.png",
6243
6503
  MATIC: "https://sdk-cdn.fun.xyz/images/matic.svg",
6244
6504
  MFER: "https://sdk-cdn.fun.xyz/images/mfer.png",
@@ -6256,7 +6516,7 @@ var ASSET_LOGO_SRCS = {
6256
6516
  SOL: "https://sdk-cdn.fun.xyz/images/sol.svg",
6257
6517
  SUSDS: "https://sdk-cdn.fun.xyz/images/susds.svg",
6258
6518
  TYBG: "https://sdk-cdn.fun.xyz/images/tybg.png",
6259
- UNI: "https://sdk-cdn.fun.xyz/images/uni.svg",
6519
+ UNI: "https://sdk-cdn.fun.xyz/images/uni.png",
6260
6520
  USDC: "https://sdk-cdn.fun.xyz/images/usdc.svg",
6261
6521
  "USDC.E": "https://sdk-cdn.fun.xyz/images/usdc.svg",
6262
6522
  USDE: "https://sdk-cdn.fun.xyz/images/usde.svg",
@@ -6298,7 +6558,8 @@ var ASSET_LOGO_SRCS = {
6298
6558
  WMON: "https://sdk-cdn.fun.xyz/images/wmon.svg",
6299
6559
  AUSD: "https://sdk-cdn.fun.xyz/images/ausd.svg",
6300
6560
  SUSHI: "https://sdk-cdn.fun.xyz/images/sushi.svg",
6301
- OP: "https://sdk-cdn.fun.xyz/images/optimism.svg"
6561
+ OP: "https://sdk-cdn.fun.xyz/images/optimism.svg",
6562
+ SKY: "https://sdk-cdn.fun.xyz/images/sky.svg"
6302
6563
  };
6303
6564
  var FALLBACK_ASSET = "https://sdk-cdn.fun.xyz/images/dollar_circle.png";
6304
6565
  function getAssetLogoSrc(symbol) {
@@ -7171,14 +7432,14 @@ import { createContext as createContext11 } from "react";
7171
7432
 
7172
7433
  // src/hooks/useTokenTransfer.ts
7173
7434
  import {
7174
- bitcoinChain as bitcoinChain2,
7435
+ bitcoinChain,
7175
7436
  hyperEvmChain,
7176
7437
  monadChain,
7177
7438
  solanaChain
7178
7439
  } from "@funkit/chains";
7179
7440
  import { FlagKey as FlagKey6 } from "@funkit/utils";
7180
7441
  import { useMemo as useMemo15 } from "react";
7181
- import { arbitrum as arbitrum2, mainnet as mainnet5, polygon as polygon2 } from "viem/chains";
7442
+ import { arbitrum as arbitrum2, mainnet as mainnet6, polygon as polygon2 } from "viem/chains";
7182
7443
 
7183
7444
  // src/utils/transfer.ts
7184
7445
  var getTransferTokenQrCodeUri = (props) => {
@@ -7234,12 +7495,12 @@ var useTokenTransfer = (selectedChainId, selectedToken, chainIds) => {
7234
7495
  const isUsdceOnPolygon = isPolygon && selectedToken === "USDC.e";
7235
7496
  const isUsdcOnPolygon = isPolygon && selectedToken === "USDC";
7236
7497
  const showOriginalRecipient = isBankrUsUser || !enableUniversal && (isUsdceOnPolygon || isUsdcOnPolygon);
7237
- const funDepositAddress = selectedChainId === solanaChain.id ? transferInit?.solanaAddr : selectedChainId === bitcoinChain2.id ? transferInit?.btcAddrSegwit : transferInit?.depositAddr;
7498
+ const funDepositAddress = selectedChainId === solanaChain.id ? transferInit?.solanaAddr : selectedChainId === bitcoinChain.id ? transferInit?.btcAddrSegwit : transferInit?.depositAddr;
7238
7499
  const blockchainType = (() => {
7239
7500
  if (selectedChainId === solanaChain.id) {
7240
7501
  return "solana";
7241
7502
  }
7242
- if (selectedChainId === bitcoinChain2.id) {
7503
+ if (selectedChainId === bitcoinChain.id) {
7243
7504
  return "bitcoin";
7244
7505
  }
7245
7506
  return "ethereum";
@@ -7278,7 +7539,7 @@ var useMinTransferLimits = () => {
7278
7539
  return limits ?? { mainnet: 0, nonMainnet: 0 };
7279
7540
  };
7280
7541
  function getMinTransferValueForChain(chainId, limits) {
7281
- const MAINNET_IDS = [mainnet5.id, bitcoinChain2.id];
7542
+ const MAINNET_IDS = [mainnet6.id, bitcoinChain.id];
7282
7543
  return MAINNET_IDS.includes(chainId) ? limits.mainnet : limits.nonMainnet;
7283
7544
  }
7284
7545
  var useMinTransferValue = (selectedChainId) => {
@@ -11939,7 +12200,7 @@ import { useCallback as useCallback11, useMemo as useMemo17 } from "react";
11939
12200
  // src/domains/wallet.ts
11940
12201
  import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO3 } from "@funkit/chains";
11941
12202
  import { isNotNullish as isNotNullish2 } from "@funkit/utils";
11942
- import { mainnet as mainnet6, polygon as polygon3 } from "viem/chains";
12203
+ import { mainnet as mainnet7, polygon as polygon3 } from "viem/chains";
11943
12204
 
11944
12205
  // src/utils/assets.ts
11945
12206
  import { isTokenAddressEquivalent as isTokenAddressEquivalent2 } from "@funkit/utils";
@@ -12234,7 +12495,7 @@ import { getCheckoutQuote as getApiCheckoutQuote } from "@funkit/api-base";
12234
12495
  import { getAssetPriceInfo } from "@funkit/api-base";
12235
12496
  import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO5 } from "@funkit/chains";
12236
12497
  import { estimateGas, getGasPrice } from "@wagmi/core";
12237
- import { encodeFunctionData, erc20Abi, formatEther } from "viem";
12498
+ import { encodeFunctionData, erc20Abi as erc20Abi2, formatEther } from "viem";
12238
12499
  import { zksync } from "viem/zksync";
12239
12500
  function getFunFeeBreakdown(baseQuote) {
12240
12501
  return {
@@ -12256,7 +12517,7 @@ async function getTransferGas(baseQuote, selectedSourceAssetInfo, wagmiConfig) {
12256
12517
  to: selectedSourceAssetInfo.address,
12257
12518
  chainId: Number.parseInt(selectedSourceAssetInfo.chainId),
12258
12519
  data: encodeFunctionData({
12259
- abi: erc20Abi,
12520
+ abi: erc20Abi2,
12260
12521
  functionName: "transfer",
12261
12522
  args: [
12262
12523
  DUMMY_TRANSFER_PARAMS.toAddress,
@@ -16467,7 +16728,7 @@ import {
16467
16728
  import React74, { useEffect as useEffect27, useMemo as useMemo21, useState as useState23 } from "react";
16468
16729
  import clsx13 from "clsx";
16469
16730
  import { motion as motion5, useAnimationControls } from "motion/react";
16470
- import { mainnet as mainnet7 } from "viem/chains";
16731
+ import { mainnet as mainnet8 } from "viem/chains";
16471
16732
 
16472
16733
  // src/domains/relay.ts
16473
16734
  var KATANA_BRIDGE_ALERT_THRESHOLD_PERCENT = 0.5;
@@ -16733,7 +16994,7 @@ function computeDigest(relayQuoteMetadata, uiCustomizations, totalPriceImpactPer
16733
16994
  value: void 0
16734
16995
  };
16735
16996
  }
16736
- const isMainnet = details?.currencyIn?.currency?.chainId === mainnet7.id || details?.currencyOut?.currency?.chainId === mainnet7.id;
16997
+ const isMainnet = details?.currencyIn?.currency?.chainId === mainnet8.id || details?.currencyOut?.currency?.chainId === mainnet8.id;
16737
16998
  const percent = formatPercent(totalPriceImpactPercent);
16738
16999
  return {
16739
17000
  isMainnet,
@@ -17532,7 +17793,7 @@ import { useEffect as useEffect29, useState as useState24 } from "react";
17532
17793
  import { polygon as polygon4 } from "viem/chains";
17533
17794
 
17534
17795
  // src/hooks/useEnabledTokenTransferChainTokens.ts
17535
- import { bitcoinChain as bitcoinChain3, solanaChain as solanaChain3 } from "@funkit/chains";
17796
+ import { bitcoinChain as bitcoinChain2, solanaChain as solanaChain3 } from "@funkit/chains";
17536
17797
  import { FlagKey as FlagKey9 } from "@funkit/utils";
17537
17798
  import { base as base5 } from "viem/chains";
17538
17799
  function useEnabledTokenTransferChainTokens(transferInit, isWithdrawal) {
@@ -17559,7 +17820,7 @@ function useEnabledTokenTransferChainTokens(transferInit, isWithdrawal) {
17559
17820
  if (isSolana && !hasSolanaAddress && !isWithdrawal) {
17560
17821
  return acc;
17561
17822
  }
17562
- const isBitcoin = chainId === bitcoinChain3.id;
17823
+ const isBitcoin = chainId === bitcoinChain2.id;
17563
17824
  if (isBitcoin && !hasBitcoinAddress && !isWithdrawal) {
17564
17825
  return acc;
17565
17826
  }
@@ -20495,9 +20756,12 @@ function useFunkitRecentDepositsImpl(query) {
20495
20756
  fetchSize: fetchSize * 2
20496
20757
  // fetch extra to account for merging
20497
20758
  });
20498
- return {
20499
- data: data?.map((de) => purifyCheckoutHistoryItem(de)).slice(0, fetchSize)
20500
- };
20759
+ return useMemo24(
20760
+ () => ({
20761
+ data: data?.map((de) => purifyCheckoutHistoryItem(de)).slice(0, fetchSize)
20762
+ }),
20763
+ [data, fetchSize]
20764
+ );
20501
20765
  }
20502
20766
 
20503
20767
  // src/hooks/useOnNewNotification.ts
@@ -26878,19 +27142,19 @@ import { Trans as Trans10 } from "react-i18next";
26878
27142
  // src/modals/CheckoutModal/ConfirmationStep/useAccountBalanceTransfer.ts
26879
27143
  import { USDT_ABI } from "@funkit/utils";
26880
27144
  import { useCallback as useCallback32 } from "react";
26881
- import { erc20Abi as erc20Abi2 } from "viem";
27145
+ import { erc20Abi as erc20Abi3 } from "viem";
26882
27146
  import { useAccount as useAccount6, useSendTransaction, useWriteContract } from "wagmi";
26883
27147
 
26884
27148
  // src/utils/isMainnetUsdt.ts
26885
27149
  import { isTokenEquivalent as isTokenEquivalent3 } from "@funkit/utils";
26886
- import { mainnet as mainnet8 } from "viem/chains";
27150
+ import { mainnet as mainnet9 } from "viem/chains";
26887
27151
  var USDT_MAINNET_ADDRESS = "0xdAC17F958D2ee523a2206206994597C13D831ec7";
26888
27152
  function isMainnetUsdt(chainId, address) {
26889
27153
  return isTokenEquivalent3({
26890
27154
  firstTokenAddress: address,
26891
27155
  firstTokenChainId: chainId.toString(),
26892
27156
  secondTokenAddress: USDT_MAINNET_ADDRESS,
26893
- secondTokenChainId: mainnet8.id.toString()
27157
+ secondTokenChainId: mainnet9.id.toString()
26894
27158
  });
26895
27159
  }
26896
27160
 
@@ -26960,7 +27224,7 @@ function useWeb3AccountBalancePostCheckout(setPostCheckoutStepMessage) {
26960
27224
  chainId: Number.parseInt(sourceAssetChainId),
26961
27225
  address: sourceAssetAddress,
26962
27226
  // USDT on mainnet has a different ABI
26963
- abi: isTokenMainnetUsdt ? USDT_ABI : erc20Abi2,
27227
+ abi: isTokenMainnetUsdt ? USDT_ABI : erc20Abi3,
26964
27228
  functionName: "transfer",
26965
27229
  args: [depositAddress, sourceAssetAmountBaseUnit]
26966
27230
  };
@@ -30265,7 +30529,7 @@ import {
30265
30529
  katanaChain
30266
30530
  } from "@funkit/chains";
30267
30531
  import { useCallback as useCallback38, useState as useState56 } from "react";
30268
- import { mainnet as mainnet9, mantle, zksync as zksync2 } from "viem/chains";
30532
+ import { mainnet as mainnet10, mantle, zksync as zksync2 } from "viem/chains";
30269
30533
  import { getAssetErc20ByChainAndSymbol as getAssetErc20ByChainAndSymbol2 } from "@funkit/api-base";
30270
30534
  var pickSourceAssetForCard = async (checkoutItem, userIpInfo, apiKey) => {
30271
30535
  if (!checkoutItem?.initSettings.config.targetChain) {
@@ -30299,7 +30563,7 @@ var pickSourceAssetForCard = async (checkoutItem, userIpInfo, apiKey) => {
30299
30563
  sourceTokenAddress = NATIVE_TOKEN;
30300
30564
  sourceTokenChainId = moonpayChainId;
30301
30565
  } else {
30302
- sourceTokenChainId = isNyOrTxOrVi ? mainnet9.id.toString() : moonpayChainId;
30566
+ sourceTokenChainId = isNyOrTxOrVi ? mainnet10.id.toString() : moonpayChainId;
30303
30567
  if (isTargetAssetEthOrWeth) {
30304
30568
  sourceTokenTicker = "ETH" /* ETH */;
30305
30569
  sourceTokenAddress = NATIVE_TOKEN;
@@ -31237,7 +31501,7 @@ function usePaymentMethodEnablement({
31237
31501
  const isKatanaEarnFlowAction = isKatanaEarnFlow({ apiKey, checkoutConfig });
31238
31502
  const isFiatEnabled = isFiatFlagEnabled && !isKatanaEarnFlowAction;
31239
31503
  const isTokenTransferEnabled = isTokenTransferFlagEnabled && !isKatanaEarnFlowAction;
31240
- const isMeldEnabled = isMeldFlagEnabled && !isKatanaEarnFlowAction;
31504
+ const isMeldEnabled = isMeldFlagEnabled && !isKatanaEarnFlowAction && isTokenTransferEnabled;
31241
31505
  const isBrokerageEnabled = isBrokerageFlagEnabled && isTokenTransferEnabled;
31242
31506
  return {
31243
31507
  isFiatEnabled,
@@ -31297,9 +31561,16 @@ var usePaymentSources = (paymentMethodInfo, targetChainId, checkoutConfig) => {
31297
31561
  isWalletInNewSources && "balance" /* ACCOUNT_BALANCE */,
31298
31562
  isBrokerageEnabled && "brokerage" /* BROKERAGE */
31299
31563
  ].filter((b) => !!b);
31564
+ const comingSoon = [];
31565
+ if (isLighterxyzCustomer(apiKey) && !isTokenTransferEnabled) {
31566
+ comingSoon.push("token_transfer" /* TOKEN_TRANSFER */);
31567
+ comingSoon.push("card" /* CARD */);
31568
+ comingSoon.push("brokerage" /* BROKERAGE */);
31569
+ }
31300
31570
  return {
31301
31571
  preferred: connected.length > 0 ? connected : fallback2,
31302
- moreSources: newSources
31572
+ moreSources: newSources,
31573
+ comingSoon
31303
31574
  };
31304
31575
  };
31305
31576
 
@@ -31922,7 +32193,7 @@ import {
31922
32193
  import { formatCurrencyAndStringify as formatCurrencyAndStringify11, isTokenEquivalent as isTokenEquivalent5 } from "@funkit/utils";
31923
32194
  import React188, { useEffect as useEffect50, useMemo as useMemo45, useState as useState58 } from "react";
31924
32195
  import { createPortal as createPortal18 } from "react-dom";
31925
- import { mainnet as mainnet10 } from "viem/chains";
32196
+ import { mainnet as mainnet11 } from "viem/chains";
31926
32197
 
31927
32198
  // src/components/Dropdown/ReceiveTokenDropdown.tsx
31928
32199
  import React186 from "react";
@@ -31943,9 +32214,12 @@ var ReceiveTokenDropdown = ({
31943
32214
  onTokenSelected,
31944
32215
  label,
31945
32216
  activeItemLabel,
31946
- activeItemProps
32217
+ activeItemProps,
32218
+ maxDropdownHeight,
32219
+ displayedChainId
31947
32220
  }) => {
31948
32221
  const allTokens = Array.from(new Set(Object.values(tokens).flat()));
32222
+ const patchedChainId = displayedChainId ?? chainId;
31949
32223
  const tokenBadgeText = tokens.find(
31950
32224
  (token) => token.tokenSymbol === selectedToken
31951
32225
  )?.badgeText;
@@ -31958,6 +32232,7 @@ var ReceiveTokenDropdown = ({
31958
32232
  return /* @__PURE__ */ React186.createElement(
31959
32233
  BaseDropdown_default,
31960
32234
  {
32235
+ maxDropdownHeight,
31961
32236
  horizontalIconGap: "8",
31962
32237
  label,
31963
32238
  openToTopOnMobile: false,
@@ -31968,7 +32243,7 @@ var ReceiveTokenDropdown = ({
31968
32243
  assetIconSize: TOKEN_ICON_SIZE2,
31969
32244
  assetName: selectedToken,
31970
32245
  assetSrc: getTokenIconUrl(selectedToken, tokens),
31971
- chainId,
32246
+ chainId: patchedChainId,
31972
32247
  largeChainIcon: true
31973
32248
  }
31974
32249
  ),
@@ -31998,7 +32273,7 @@ var ReceiveTokenDropdown = ({
31998
32273
  assetIconSize: TOKEN_ICON_SIZE2,
31999
32274
  assetName: "receive-token-asset",
32000
32275
  assetSrc: iconUrl,
32001
- chainId,
32276
+ chainId: patchedChainId,
32002
32277
  largeChainIcon: true
32003
32278
  }
32004
32279
  ),
@@ -32766,7 +33041,7 @@ function isTreatedAsNativeToken(apiKey, asset, dynamicTargetAssetCandidates, fin
32766
33041
  }
32767
33042
  if (isEtherealCustomer(apiKey)) {
32768
33043
  if (isTokenEquivalent5({
32769
- firstTokenChainId: mainnet10.id.toString(),
33044
+ firstTokenChainId: mainnet11.id.toString(),
32770
33045
  firstTokenAddress: "0x90d2af7d622ca3141efa4d8f1f24d86e5974cc8f",
32771
33046
  // eUSDe (Ethereum)
32772
33047
  secondTokenChainId: asset.pickedChainId,
@@ -32809,6 +33084,8 @@ function showsNativeTokensOnTop(apiKey) {
32809
33084
 
32810
33085
  // src/modals/CheckoutModal/SourceChange/SourceChange.tsx
32811
33086
  import { BridgeCustomerStatus as BridgeCustomerStatus6, MeldServiceProvider as MeldServiceProvider4 } from "@funkit/api-base";
33087
+ import { LIGHTER_CHAIN_ID as LIGHTER_CHAIN_ID3 } from "@funkit/chains";
33088
+ import { noop as noop9 } from "@funkit/utils";
32812
33089
  import React190, { useCallback as useCallback41, useEffect as useEffect51, useState as useState59 } from "react";
32813
33090
  import { createPortal as createPortal19 } from "react-dom";
32814
33091
 
@@ -33023,6 +33300,7 @@ function SourceChange({
33023
33300
  const [selectedTargetAsset, setSelectedTargetAsset] = useState59(
33024
33301
  () => getDefaultDynamicTargetAsset(checkoutConfig)
33025
33302
  );
33303
+ const isLighter = isLighterxyzCustomer(apiKey);
33026
33304
  useEffect51(() => {
33027
33305
  if (!paymentMethodInfo) {
33028
33306
  return;
@@ -33139,7 +33417,7 @@ function SourceChange({
33139
33417
  targetAssetMinAmount: token.targetAssetMinAmount,
33140
33418
  iconSrc: token.iconSrc
33141
33419
  });
33142
- if (isLighterxyzCustomer(apiKey)) {
33420
+ if (isLighter) {
33143
33421
  const routingId = getLighterRoutingIdByTokenAddress(token.tokenAddress);
33144
33422
  routingId && updateDynamicRoutingId(routingId);
33145
33423
  }
@@ -33149,7 +33427,7 @@ function SourceChange({
33149
33427
  onCloseConnectModal();
33150
33428
  }
33151
33429
  }, [connectionStatus]);
33152
- const { preferred, moreSources } = usePaymentSources(
33430
+ const { preferred, moreSources, comingSoon } = usePaymentSources(
33153
33431
  paymentMethodInfo,
33154
33432
  targetChainId,
33155
33433
  checkoutItem?.initSettings.config
@@ -33178,6 +33456,20 @@ function SourceChange({
33178
33456
  }
33179
33457
  );
33180
33458
  }
33459
+ function renderComingSoon(source) {
33460
+ return /* @__PURE__ */ React190.createElement(
33461
+ AddPaymentMethodItem,
33462
+ {
33463
+ key: source,
33464
+ paymentMethod: source,
33465
+ isActive: false,
33466
+ isClickable: false,
33467
+ onClick: noop9,
33468
+ customValueIcon: /* @__PURE__ */ React190.createElement(FunBadge, { borderColor: "generalBorder" }, t("common.comingSoon"))
33469
+ }
33470
+ );
33471
+ }
33472
+ const hasMoreSources = moreSources.length > 0 || comingSoon.length > 0;
33181
33473
  const bottomSectionRef = useBottomSectionRef();
33182
33474
  return /* @__PURE__ */ React190.createElement(React190.Fragment, null, isTargetAssetSelectable && /* @__PURE__ */ React190.createElement(Box, { marginBottom: "8" }, /* @__PURE__ */ React190.createElement(
33183
33475
  ReceiveTokenDropdown,
@@ -33185,6 +33477,7 @@ function SourceChange({
33185
33477
  activeItemLabel: t("sourceChange.selectTokenLabel"),
33186
33478
  activeItemProps: { background: { base: "offBackground" } },
33187
33479
  chainId: Number(selectedTargetAsset.tokenChainId),
33480
+ displayedChainId: isLighter ? LIGHTER_CHAIN_ID3 : void 0,
33188
33481
  onTokenSelected: handleTargetAssetChange,
33189
33482
  selectedToken: selectedTargetAsset?.tokenSymbol,
33190
33483
  tokens: dynamicTargetAssets
@@ -33200,7 +33493,7 @@ function SourceChange({
33200
33493
  }
33201
33494
  },
33202
33495
  preferred.map(renderSource),
33203
- preferred.length > 0 && moreSources.length > 0 && /* @__PURE__ */ React190.createElement(
33496
+ preferred.length > 0 && hasMoreSources && /* @__PURE__ */ React190.createElement(
33204
33497
  FunDivider,
33205
33498
  {
33206
33499
  label: t("sourceChange.more"),
@@ -33210,6 +33503,7 @@ function SourceChange({
33210
33503
  }
33211
33504
  ),
33212
33505
  moreSources.map(renderSource),
33506
+ comingSoon.map(renderComingSoon),
33213
33507
  /* @__PURE__ */ React190.createElement(PayPal, null)
33214
33508
  ), /* @__PURE__ */ React190.createElement(Box, { className: emptyStateStyles }, /* @__PURE__ */ React190.createElement(
33215
33509
  FunNoResults,
@@ -38023,8 +38317,7 @@ function useFunkitCheckout(props) {
38023
38317
  initNewCheckout,
38024
38318
  initNewWithdrawal,
38025
38319
  updateSourceAsset,
38026
- updateSelectedPaymentMethodInfo,
38027
- checkoutItem
38320
+ updateSelectedPaymentMethodInfo
38028
38321
  } = useContext19(FunkitCheckoutContext);
38029
38322
  const { openFunCheckoutModal } = useFunCheckoutModal();
38030
38323
  const { openWithdrawalModal } = useWithdrawalModal();
@@ -38054,12 +38347,10 @@ function useFunkitCheckout(props) {
38054
38347
  );
38055
38348
  const [pendingCheckoutConfig, setPendingCheckoutConfig] = useState75();
38056
38349
  const onCheckoutConflict = ({
38057
- newConfig,
38058
38350
  resume,
38059
38351
  replace
38060
38352
  }) => {
38061
- const lastConfig = checkoutItem?.initSettings.config;
38062
- if (lastConfig?.targetAsset === newConfig.targetAsset && isLighterxyzCustomer(apiKey)) {
38353
+ if (isLighterxyzCustomer(apiKey)) {
38063
38354
  resume();
38064
38355
  return false;
38065
38356
  }
@@ -38128,7 +38419,6 @@ function useFunkitCheckout(props) {
38128
38419
  }
38129
38420
  if (hasSoftHiddenCheckout && softHiddenCheckoutId) {
38130
38421
  const shouldContinue = onCheckoutConflict({
38131
- newConfig: validationResult.config,
38132
38422
  hiddenCheckoutId: softHiddenCheckoutId,
38133
38423
  resume: resumeSoftHiddenCheckout,
38134
38424
  replace: discardSoftHiddenCheckout
@@ -38342,11 +38632,10 @@ function getCheckoutItemDisplay({
38342
38632
  targetAssetTicker
38343
38633
  } = checkoutConfig;
38344
38634
  const displayAmount = overrideAmount ?? targetAssetAmount;
38635
+ const itemName = targetAssetTicker || checkoutItemTitle;
38345
38636
  if (isCheckoutPostActionRequired(checkoutConfig)) {
38346
- const itemName2 = checkoutItemTitle;
38347
- return !hideAmount && displayAmount > 0 ? formatCryptoAndStringify9(round3(displayAmount, 5), itemName2) : itemName2;
38637
+ return !hideAmount && displayAmount > 0 ? formatCryptoAndStringify9(round3(displayAmount, 5), itemName) : itemName;
38348
38638
  }
38349
- const itemName = targetAssetTicker || checkoutItemTitle;
38350
38639
  return hideAmount ? itemName : formatCryptoAndStringify9(displayAmount, itemName);
38351
38640
  }
38352
38641
  function getBaseQuoteTotalFeesFromAmount(baseQuote) {
@@ -38380,9 +38669,9 @@ async function getTokenDecimals(wagmiConfig, chainId, tokenAddress) {
38380
38669
  if (chainId === solanaChain5.id.toString()) {
38381
38670
  return solanaChain5.nativeCurrency.decimals;
38382
38671
  }
38383
- const decimals = await readContract(wagmiConfig, {
38672
+ const decimals = await readContract2(wagmiConfig, {
38384
38673
  address: tokenAddress,
38385
- abi: erc20Abi3,
38674
+ abi: erc20Abi4,
38386
38675
  chainId: Number.parseInt(chainId),
38387
38676
  functionName: "decimals"
38388
38677
  });
@@ -38487,12 +38776,12 @@ function computeDisplayDestinationToken(checkoutConfig, displayAssetAmount) {
38487
38776
  }
38488
38777
 
38489
38778
  // src/domains/feeEstimate.ts
38490
- import { mainnet as mainnet11 } from "viem/chains";
38779
+ import { mainnet as mainnet12 } from "viem/chains";
38491
38780
  var L1_FEES_ESTIMATE = 1;
38492
38781
  var L2_FEES_ESTIMATE = 1;
38493
38782
  var BROKERAGE_FEES_ESTIMATE = 0;
38494
38783
  var getBaseFeeUsdEstimate = (targetChainId, assetChainId) => {
38495
- if (targetChainId !== mainnet11.id.toString() && assetChainId !== mainnet11.id.toString()) {
38784
+ if (targetChainId !== mainnet12.id.toString() && assetChainId !== mainnet12.id.toString()) {
38496
38785
  return L2_FEES_ESTIMATE;
38497
38786
  }
38498
38787
  return L1_FEES_ESTIMATE;
@@ -38508,7 +38797,7 @@ var getFeesUsdEstimate = (targetChainId, assetChainId, paymentMethod) => {
38508
38797
  var isStablecoin = (symbol) => STABLECOIN_SYMBOLS.find((s) => symbol.toLowerCase().includes(s.toLowerCase()));
38509
38798
  function isPreferredChain(chainId, additionalChains = []) {
38510
38799
  const chains = /* @__PURE__ */ new Set([
38511
- mainnet12.id,
38800
+ mainnet13.id,
38512
38801
  polygon6.id,
38513
38802
  base7.id,
38514
38803
  arbitrum5.id,
@@ -38820,8 +39109,8 @@ function ConnectButtonRenderer({
38820
39109
  connectModalOpen,
38821
39110
  mounted: isMounted(),
38822
39111
  openAccountModal: () => openAccountModal?.(null),
38823
- openChainModal: openChainModal ?? noop9,
38824
- openConnectModal: openConnectModal ?? noop9
39112
+ openChainModal: openChainModal ?? noop10,
39113
+ openConnectModal: openConnectModal ?? noop10
38825
39114
  }));
38826
39115
  }
38827
39116
  ConnectButtonRenderer.displayName = "ConnectButton.Custom";
@@ -231,7 +231,7 @@ export declare const flagConfig: {
231
231
  readonly if_any: [{
232
232
  readonly key: "apiKey";
233
233
  readonly type: "isAnyOf";
234
- readonly values: ["6TUi99Tq3O9MWj1IFX8Pv6spmPXzcvhy9NvBoeW2", "clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e", "57G91zNoew4nYxIoqSCpS1vWr8JT3gGVasNqMwgG", "M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um", "cGlmpTmNh657m8TiV5RFdwna6FG5pxM6ajiNHvw3", "pLQBJsA6zS9tg990rbdBD6UdABkWRv5O60vlrVcW", "lUzTaIRxs95iin3pCAafB1ChA5akBiuQ1tjhXnau", "53OWivH0fK2VIAuMZTycr52EnSEnPWj97Jy3Dpiz", "AH7lRIhbsL167nptv6eub9xDJXVHnYUm2vL7FLjK", "i6e1I8cfX625TTwRJlD2DshKyAoaUtO8aeoaR4i2", "1cRIX8XoWP801OILra02i13IJ08IARBP5B6ydcnp", "2hicPxo2vy2NMHcg2cEU9crOeKtDpc14NEfMCthc", "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN", "Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6", "wQDLu86Qab61vbtru7thf8Yj0xaeqVUH4ohoXESu", "iMTsSsgDdI2FC0FjeEejS9LMxuJgDhFO3OHlwVjT", "HKHvPSPDezaxsTohFgDuG4WpKW6hB4SFYyztm9vc", "5UzOrcAE2F3rcuMX2EeIlaYv5VUcDe6Lyh0PeZX2"];
234
+ readonly values: ["6TUi99Tq3O9MWj1IFX8Pv6spmPXzcvhy9NvBoeW2", "clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e", "Tkp90bAf246UQXfou5uHY9UHN7AUV6xK1tgEWKke", "57G91zNoew4nYxIoqSCpS1vWr8JT3gGVasNqMwgG", "M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um", "cGlmpTmNh657m8TiV5RFdwna6FG5pxM6ajiNHvw3", "1QxzeJ4XKT78ba86whLct6sc7dW60Dl461UVWFdw", "pLQBJsA6zS9tg990rbdBD6UdABkWRv5O60vlrVcW", "lUzTaIRxs95iin3pCAafB1ChA5akBiuQ1tjhXnau", "53OWivH0fK2VIAuMZTycr52EnSEnPWj97Jy3Dpiz", "AH7lRIhbsL167nptv6eub9xDJXVHnYUm2vL7FLjK", "TY2G63jFfd7H29aHiJIzg5RqdXNdog2Q5jgb8tr7", "i6e1I8cfX625TTwRJlD2DshKyAoaUtO8aeoaR4i2", "1cRIX8XoWP801OILra02i13IJ08IARBP5B6ydcnp", "2hicPxo2vy2NMHcg2cEU9crOeKtDpc14NEfMCthc", "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN", "Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6", "wQDLu86Qab61vbtru7thf8Yj0xaeqVUH4ohoXESu", "iMTsSsgDdI2FC0FjeEejS9LMxuJgDhFO3OHlwVjT", "HKHvPSPDezaxsTohFgDuG4WpKW6hB4SFYyztm9vc", "5UzOrcAE2F3rcuMX2EeIlaYv5VUcDe6Lyh0PeZX2"];
235
235
  }];
236
236
  readonly value: true;
237
237
  }, {
@@ -273,7 +273,7 @@ export declare const flagConfig: {
273
273
  };
274
274
  readonly enable_bitcoin: {
275
275
  readonly type: "boolean";
276
- readonly default_value: true;
276
+ readonly default_value: false;
277
277
  readonly overrides: [{
278
278
  readonly if_any: [{
279
279
  readonly key: "apiKey";
@@ -7,6 +7,11 @@ export declare const LIGHTER_DYNAMIC_ROUTING_ID: {
7
7
  USDC_PERPS: string;
8
8
  ETH_SPOT_NEW_USER: string;
9
9
  USDC_PERPS_NEW_USER: string;
10
+ LINK_SPOT_NEW_USER: string;
11
+ UNI_SPOT_NEW_USER: string;
12
+ AAVE_SPOT_NEW_USER: string;
13
+ SKY_SPOT_NEW_USER: string;
14
+ LDO_SPOT_NEW_USER: string;
10
15
  };
11
16
  export declare const getLighterRoutingIdByTokenAddress: (address: Address) => string | undefined;
12
17
  export declare const getLighterTokenAddressByRoutingId: (id: string) => Address | undefined;
@@ -8,15 +8,15 @@ import {
8
8
  import {
9
9
  tahoWallet
10
10
  } from "./chunk-TNZJRXUQ.js";
11
+ import {
12
+ tokenPocketWallet
13
+ } from "./chunk-47QF6EET.js";
11
14
  import {
12
15
  talismanWallet
13
16
  } from "./chunk-JTLLKY2O.js";
14
17
  import {
15
18
  tokenaryWallet
16
19
  } from "./chunk-M2HGGTFE.js";
17
- import {
18
- tokenPocketWallet
19
- } from "./chunk-47QF6EET.js";
20
20
  import {
21
21
  trustWallet
22
22
  } from "./chunk-JFHP4YJG.js";
@@ -62,12 +62,12 @@ import {
62
62
  import {
63
63
  oktoWallet
64
64
  } from "./chunk-ADIXAKUL.js";
65
- import {
66
- okxWallet
67
- } from "./chunk-U5QP7MI5.js";
68
65
  import {
69
66
  omniWallet
70
67
  } from "./chunk-7CUY5G6R.js";
68
+ import {
69
+ okxWallet
70
+ } from "./chunk-U5QP7MI5.js";
71
71
  import {
72
72
  oneInchWallet
73
73
  } from "./chunk-OESTDX6I.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "7.1.0-next.15",
3
+ "version": "7.1.0-next.18",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -102,9 +102,9 @@
102
102
  "ua-parser-js": "^1.0.37",
103
103
  "use-debounce": "^10.0.5",
104
104
  "uuid": "^9.0.1",
105
- "@funkit/api-base": "1.12.22-next.5",
106
105
  "@funkit/chains": "0.5.2-next.1",
107
- "@funkit/fun-relay": "2.2.0-next.5",
106
+ "@funkit/fun-relay": "2.2.0-next.6",
107
+ "@funkit/api-base": "1.12.22-next.5",
108
108
  "@funkit/utils": "1.1.22-next.2"
109
109
  },
110
110
  "repository": {