@funkit/connect 6.0.2 → 6.0.4
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 +36 -0
- package/dist/{chunk-IVQ57535.js → chunk-7HKC2KCK.js} +2 -2
- package/dist/{chunk-IOMUPAAW.js → chunk-VQOGHHW2.js} +1 -1
- package/dist/{chunk-N6UWLAUQ.js → chunk-ZAZGUX6Z.js} +1 -1
- package/dist/components/Dialog/DialogContent.css.d.ts +4 -0
- package/dist/domains/relay.d.ts +7 -13
- package/dist/hooks/queries/useWithdrawalQuote.d.ts +6 -0
- package/dist/index.css +4 -4
- package/dist/index.js +234 -206
- package/dist/modals/CheckoutModal/LoadingAccount.d.ts +2 -7
- package/dist/modals/CheckoutModal/stepTransition.d.ts +2 -1
- package/dist/providers/FunkitCheckoutContext.d.ts +2 -1
- package/dist/themes/baseTheme.js +1 -1
- package/dist/themes/darkTheme.js +2 -2
- package/dist/themes/lightTheme.js +2 -2
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +41 -41
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
darkTheme
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VQOGHHW2.js";
|
|
5
5
|
import {
|
|
6
6
|
lightTheme
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZAZGUX6Z.js";
|
|
8
8
|
import {
|
|
9
9
|
systemFontStack
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7HKC2KCK.js";
|
|
11
11
|
|
|
12
12
|
// src/components/Dialog/DialogContent.css.ts
|
|
13
13
|
var SCROLL_BAR_WIDTH = 6;
|
|
@@ -1139,7 +1139,7 @@ import React40, {
|
|
|
1139
1139
|
useState as useState8
|
|
1140
1140
|
} from "react";
|
|
1141
1141
|
import { isHex } from "viem";
|
|
1142
|
-
import { useQuery as
|
|
1142
|
+
import { useQuery as useQuery5 } from "@tanstack/react-query";
|
|
1143
1143
|
|
|
1144
1144
|
// src/hooks/useSymbolRefresh.ts
|
|
1145
1145
|
import { useState as useState3 } from "react";
|
|
@@ -2490,8 +2490,26 @@ var flagConfig = {
|
|
|
2490
2490
|
type: "isAnyOf",
|
|
2491
2491
|
values: [
|
|
2492
2492
|
"0x2A8Bd916E85d98d8175258De99fc0ddbcC102eF6",
|
|
2493
|
-
"0x21b94a3E67c4a72d3D15f478A696c5175f036092"
|
|
2493
|
+
"0x21b94a3E67c4a72d3D15f478A696c5175f036092",
|
|
2494
2494
|
// jianhe
|
|
2495
|
+
"0x9C64fD7d9826E6d552dD8bc53e5C96F7C3F38528",
|
|
2496
|
+
// panda
|
|
2497
|
+
"0x236c60C57a8B9ca563Fb0dA5199FDdCB686d91E8",
|
|
2498
|
+
// greg
|
|
2499
|
+
"0x2e0Fa1cE3F0F6a85542c1E4F941116c0E885292E",
|
|
2500
|
+
// adam
|
|
2501
|
+
"0x8a5505F1b274d8fC23986AF60Dd3Ca3857095BB8",
|
|
2502
|
+
// david
|
|
2503
|
+
"0x0B6E49e9D1528F59BaBF3C5337A4c96E987f81aa",
|
|
2504
|
+
// aaron (rainbow)
|
|
2505
|
+
"0x84Bc1AC5621d2B44C5D3e3E79b45C2885406026D",
|
|
2506
|
+
// hunter (evm)
|
|
2507
|
+
"0x0D0377aa9CCA769931821842aB0E1A75e7DD6dD6",
|
|
2508
|
+
// cheng-yu (evm)
|
|
2509
|
+
"0x7B0195921183f7E04f0D331c1DAF7C1bB208CC4E",
|
|
2510
|
+
// kurt (evm)
|
|
2511
|
+
"0xda6b07Eb94f699F511a943e9bFC12B64B7fe3486"
|
|
2512
|
+
// Alex
|
|
2495
2513
|
]
|
|
2496
2514
|
},
|
|
2497
2515
|
{
|
|
@@ -2808,41 +2826,13 @@ var flagConfig = {
|
|
|
2808
2826
|
[FlagKey.RelayBypassTargetChainsAndAssets]: {
|
|
2809
2827
|
type: "string",
|
|
2810
2828
|
default_value: JSON.stringify({
|
|
2811
|
-
|
|
2812
|
-
137: ["
|
|
2813
|
-
|
|
2814
|
-
42161: ["
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
// ETH
|
|
2819
|
-
"0x7f1f4b4b29f5058fa32cc7a97141b8d7e5abdc2d",
|
|
2820
|
-
// KAT
|
|
2821
|
-
"0xEE7D8BCFb72bC1880D0Cf19822eB0A2e6577aB62",
|
|
2822
|
-
// vbETH
|
|
2823
|
-
"0x203A662b0BD271A6ed5a60EdFbd04bFce608FD36",
|
|
2824
|
-
// vbUSDC
|
|
2825
|
-
"0x2DCa96907fde857dd3D816880A0df407eeB2D2F2",
|
|
2826
|
-
// vbUSDT
|
|
2827
|
-
"0x0913DA6Da4b42f538B445599b46Bb4622342Cf52",
|
|
2828
|
-
// vbWBTC
|
|
2829
|
-
"0x62D6A123E8D19d06d68cf0d2294F9A3A0362c6b3",
|
|
2830
|
-
// vbUSDS
|
|
2831
|
-
"0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
|
|
2832
|
-
// AUSD
|
|
2833
|
-
"0x9B8Df6E244526ab5F6e6400d331DB28C8fdDdb55",
|
|
2834
|
-
// uSOL
|
|
2835
|
-
"0xb0505e5a99abd03d94a1169e638B78EDfEd26ea4",
|
|
2836
|
-
// uSUI
|
|
2837
|
-
"0x2615a94df961278DcbC41Fb0a54fEc5f10a693aE",
|
|
2838
|
-
// uXRP
|
|
2839
|
-
"0x1e5eFCA3D0dB2c6d5C67a4491845c43253eB9e4e",
|
|
2840
|
-
// MORPHO
|
|
2841
|
-
"0x17BFF452dae47e07CeA877Ff0E1aba17eB62b0aB",
|
|
2842
|
-
// SUSHI
|
|
2843
|
-
"0x476eaCd417cD65421bD34fca054377658BB5E02b"
|
|
2844
|
-
// YFI
|
|
2845
|
-
],
|
|
2829
|
+
1: ["*"],
|
|
2830
|
+
137: ["*"],
|
|
2831
|
+
8453: ["*"],
|
|
2832
|
+
42161: ["*"],
|
|
2833
|
+
10: ["*"],
|
|
2834
|
+
56: ["*"],
|
|
2835
|
+
747474: ["*"],
|
|
2846
2836
|
999: ["*"],
|
|
2847
2837
|
2741: ["*"],
|
|
2848
2838
|
1151111081099710: [
|
|
@@ -3951,8 +3941,8 @@ import { flushSync } from "react-dom";
|
|
|
3951
3941
|
import { v4 as uuid } from "uuid";
|
|
3952
3942
|
|
|
3953
3943
|
// src/hooks/useCheckoutDirectExecution.ts
|
|
3954
|
-
import { DirectExecutionType } from "@funkit/api-base";
|
|
3955
|
-
import { executeRelayQuote
|
|
3944
|
+
import { DirectExecutionType, getCheckoutQuoteV2 } from "@funkit/api-base";
|
|
3945
|
+
import { executeRelayQuote } from "@funkit/fun-relay";
|
|
3956
3946
|
import { useCallback as useCallback5 } from "react";
|
|
3957
3947
|
import { useWalletClient } from "wagmi";
|
|
3958
3948
|
|
|
@@ -3971,19 +3961,6 @@ var WEB3_ACCOUNT_BALANCE_MESSAGE = {
|
|
|
3971
3961
|
[2 /* APPROVE_TRANSFER */]: (tokenSymbol) => `Confirm ${tokenSymbol} transfer`
|
|
3972
3962
|
};
|
|
3973
3963
|
|
|
3974
|
-
// src/hooks/queries/useClientId.ts
|
|
3975
|
-
import { getOrganizationIdByApiKey } from "@funkit/api-base";
|
|
3976
|
-
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
|
3977
|
-
var useClientId = () => {
|
|
3978
|
-
const { apiKey } = useFunkitConfig();
|
|
3979
|
-
const query = useQuery3({
|
|
3980
|
-
queryKey: ["getOrganizationIdByApiKey", apiKey],
|
|
3981
|
-
queryFn: () => getOrganizationIdByApiKey({ apiKey }),
|
|
3982
|
-
enabled: !!apiKey
|
|
3983
|
-
});
|
|
3984
|
-
return query;
|
|
3985
|
-
};
|
|
3986
|
-
|
|
3987
3964
|
// src/hooks/useRelayBypass.ts
|
|
3988
3965
|
import { FlagKey as FlagKey4, isTokenAddressEquivalent as isTokenAddressEquivalent2 } from "@funkit/utils";
|
|
3989
3966
|
import { useCallback as useCallback4, useMemo as useMemo7 } from "react";
|
|
@@ -4097,7 +4074,7 @@ function useCheckoutDirectExecution() {
|
|
|
4097
4074
|
const { connector } = useFunkitAccount();
|
|
4098
4075
|
const { data: walletClient } = useWalletClient();
|
|
4099
4076
|
const { getIsRelayEnabled } = useRelayBypass();
|
|
4100
|
-
const {
|
|
4077
|
+
const { apiKey } = useFunkitConfig();
|
|
4101
4078
|
const getRelayDirectExecutionBaseQuote = useCallback5(
|
|
4102
4079
|
async (params) => {
|
|
4103
4080
|
const {
|
|
@@ -4112,41 +4089,35 @@ function useCheckoutDirectExecution() {
|
|
|
4112
4089
|
if (params.isExactIn) {
|
|
4113
4090
|
const { fromTokenDecimals, fromTokenAmount } = params;
|
|
4114
4091
|
const multiplier2 = 10 ** fromTokenDecimals;
|
|
4115
|
-
return await
|
|
4092
|
+
return await getCheckoutQuoteV2({
|
|
4116
4093
|
actionParams,
|
|
4117
|
-
|
|
4094
|
+
apiKey,
|
|
4095
|
+
fromAmountBaseUnit: BigInt(Math.floor(fromTokenAmount * multiplier2)),
|
|
4118
4096
|
fromChainId,
|
|
4119
4097
|
fromTokenAddress,
|
|
4120
4098
|
logger,
|
|
4121
4099
|
recipientAddress,
|
|
4122
4100
|
toChainId,
|
|
4123
4101
|
toTokenAddress,
|
|
4124
|
-
fromTokenAmountBaseUnit: BigInt(
|
|
4125
|
-
Math.floor(fromTokenAmount * multiplier2)
|
|
4126
|
-
),
|
|
4127
|
-
tradeType: "EXACT_INPUT",
|
|
4128
4102
|
userAddress: senderAddress
|
|
4129
4103
|
});
|
|
4130
4104
|
}
|
|
4131
4105
|
const { toTokenAmount, toTokenDecimals } = params;
|
|
4132
4106
|
const multiplier = 10 ** toTokenDecimals;
|
|
4133
|
-
return await
|
|
4107
|
+
return await getCheckoutQuoteV2({
|
|
4134
4108
|
actionParams,
|
|
4135
|
-
|
|
4109
|
+
apiKey,
|
|
4136
4110
|
fromChainId,
|
|
4137
4111
|
fromTokenAddress,
|
|
4138
4112
|
logger,
|
|
4139
4113
|
recipientAddress,
|
|
4114
|
+
toAmountBaseUnit: BigInt(Math.floor(toTokenAmount * multiplier)),
|
|
4140
4115
|
toChainId,
|
|
4141
4116
|
toTokenAddress,
|
|
4142
|
-
toTokenAmountBaseUnit: BigInt(Math.floor(toTokenAmount * multiplier)),
|
|
4143
|
-
// When no contract action is required: expected_output
|
|
4144
|
-
// When a contract action is required: exact_output
|
|
4145
|
-
tradeType: actionParams?.length ? "EXACT_OUTPUT" : "EXPECTED_OUTPUT",
|
|
4146
4117
|
userAddress: senderAddress
|
|
4147
4118
|
});
|
|
4148
4119
|
},
|
|
4149
|
-
[address,
|
|
4120
|
+
[address, apiKey]
|
|
4150
4121
|
);
|
|
4151
4122
|
const checkAndSwitchChains = useCallback5(
|
|
4152
4123
|
async ({
|
|
@@ -4305,7 +4276,7 @@ import {
|
|
|
4305
4276
|
initializeCheckoutTokenTransferAddress
|
|
4306
4277
|
} from "@funkit/api-base";
|
|
4307
4278
|
import { FlagKey as FlagKey5 } from "@funkit/utils";
|
|
4308
|
-
import { useQuery as
|
|
4279
|
+
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
|
4309
4280
|
import { useCallback as useCallback6 } from "react";
|
|
4310
4281
|
|
|
4311
4282
|
// src/domains/clientMetadata.ts
|
|
@@ -4402,7 +4373,7 @@ var useCheckoutTransferInit = () => {
|
|
|
4402
4373
|
const isQRCodeEnabledWithPostAction = !!checkoutConfig && // either no post action required
|
|
4403
4374
|
(!isCheckoutPostActionRequired(checkoutConfig) || // or action type is set
|
|
4404
4375
|
!!checkoutConfig?.qrcodeActionType);
|
|
4405
|
-
const { data, isFetching } =
|
|
4376
|
+
const { data, isFetching } = useQuery3({
|
|
4406
4377
|
queryKey: ["initializeCheckoutTokenTransferAddress", queryKey],
|
|
4407
4378
|
queryFn: () => queryFunction(queryKey),
|
|
4408
4379
|
refetchOnWindowFocus: false,
|
|
@@ -4460,6 +4431,7 @@ function generateSourceOfFundString({
|
|
|
4460
4431
|
var FunCheckoutStartingStep = /* @__PURE__ */ ((FunCheckoutStartingStep2) => {
|
|
4461
4432
|
FunCheckoutStartingStep2["SOURCE_CHANGE"] = "source_change";
|
|
4462
4433
|
FunCheckoutStartingStep2["CONFIRMATION"] = "confirmation";
|
|
4434
|
+
FunCheckoutStartingStep2["SELECT_ASSET"] = "select_asset";
|
|
4463
4435
|
return FunCheckoutStartingStep2;
|
|
4464
4436
|
})(FunCheckoutStartingStep || {});
|
|
4465
4437
|
var FunkitCheckoutContext = createContext10({
|
|
@@ -5369,14 +5341,14 @@ import {
|
|
|
5369
5341
|
getDirectExecutionByTxHash
|
|
5370
5342
|
} from "@funkit/api-base";
|
|
5371
5343
|
import { RELAY_TERMINAL_STATUSES } from "@funkit/fun-relay";
|
|
5372
|
-
import { useQuery as
|
|
5344
|
+
import { useQuery as useQuery4 } from "@tanstack/react-query";
|
|
5373
5345
|
var RELAY_FETCH_INTERVAL = 1500;
|
|
5374
5346
|
var logPrefix = "useDirectExecutionInfoPolling";
|
|
5375
5347
|
function useDirectExecutionInfoPolling({
|
|
5376
5348
|
initDirectExecution
|
|
5377
5349
|
}) {
|
|
5378
5350
|
const { apiKey } = useFunkitConfig();
|
|
5379
|
-
const { data: directExecution, isLoading } =
|
|
5351
|
+
const { data: directExecution, isLoading } = useQuery4({
|
|
5380
5352
|
queryKey: [logPrefix, initDirectExecution?.txHash],
|
|
5381
5353
|
queryFn: async () => {
|
|
5382
5354
|
try {
|
|
@@ -5640,7 +5612,7 @@ function useCheckoutHistoryContext() {
|
|
|
5640
5612
|
}
|
|
5641
5613
|
function useCheckoutsListenerByUserId(userId) {
|
|
5642
5614
|
const { apiKey } = useFunkitConfig();
|
|
5643
|
-
const { data, isLoading } =
|
|
5615
|
+
const { data, isLoading } = useQuery5({
|
|
5644
5616
|
enabled: !!userId,
|
|
5645
5617
|
queryKey: ["getPurifiedCheckoutsByUserId", userId],
|
|
5646
5618
|
queryFn: async () => {
|
|
@@ -5667,7 +5639,7 @@ function useCheckoutsListenerByUserId(userId) {
|
|
|
5667
5639
|
}
|
|
5668
5640
|
function useCheckoutListenerByCheckoutId(checkoutId) {
|
|
5669
5641
|
const { apiKey } = useFunkitConfig();
|
|
5670
|
-
const { data, isLoading } =
|
|
5642
|
+
const { data, isLoading } = useQuery5({
|
|
5671
5643
|
enabled: !!checkoutId,
|
|
5672
5644
|
queryKey: ["getPurifiedCheckoutById", checkoutId],
|
|
5673
5645
|
queryFn: async () => {
|
|
@@ -7653,7 +7625,8 @@ var FunBottomBar = ({
|
|
|
7653
7625
|
type: "tertiary",
|
|
7654
7626
|
height: "modalBottomBarButtonHeight",
|
|
7655
7627
|
textSize: "modalBottomBarButtonText",
|
|
7656
|
-
textWeight: "modalBottomBarButtonText"
|
|
7628
|
+
textWeight: "modalBottomBarButtonText",
|
|
7629
|
+
uppercase: uiCustomizations?.callToActionsUppercase
|
|
7657
7630
|
}
|
|
7658
7631
|
), actionButtonProps && /* @__PURE__ */ React60.createElement(
|
|
7659
7632
|
FunButton,
|
|
@@ -7662,8 +7635,8 @@ var FunBottomBar = ({
|
|
|
7662
7635
|
borderRadius: customButtonRadius,
|
|
7663
7636
|
height: "modalBottomBarButtonHeight",
|
|
7664
7637
|
textSize: "modalBottomBarButtonText",
|
|
7665
|
-
|
|
7666
|
-
|
|
7638
|
+
textWeight: "modalBottomBarButtonText",
|
|
7639
|
+
uppercase: uiCustomizations?.callToActionsUppercase
|
|
7667
7640
|
}
|
|
7668
7641
|
)), bottomSectionComponent && /* @__PURE__ */ React60.createElement(Box, { paddingTop: "10" }, bottomSectionComponent));
|
|
7669
7642
|
};
|
|
@@ -8520,7 +8493,7 @@ Dialog.BottomSection = DialogBottom;
|
|
|
8520
8493
|
Dialog.BottomBar = FunBottomBar;
|
|
8521
8494
|
|
|
8522
8495
|
// src/modals/WithdrwalModal/WithdrawalContent.tsx
|
|
8523
|
-
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
8496
|
+
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO8 } from "@funkit/chains";
|
|
8524
8497
|
import {
|
|
8525
8498
|
FlagKey as FlagKey14,
|
|
8526
8499
|
formatCryptoAndStringify as formatCryptoAndStringify2,
|
|
@@ -10255,13 +10228,16 @@ import clsx14 from "clsx";
|
|
|
10255
10228
|
import { motion as motion6, useAnimationControls } from "motion/react";
|
|
10256
10229
|
|
|
10257
10230
|
// src/domains/relay.ts
|
|
10258
|
-
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6 } from "@funkit/chains";
|
|
10259
10231
|
var KATANA_BRIDGE_ALERT_THRESHOLD_PERCENT = 0.5;
|
|
10260
|
-
function extractRelayFeeInfo(
|
|
10232
|
+
function extractRelayFeeInfo({
|
|
10233
|
+
relayQuote = {},
|
|
10234
|
+
feeBreakdown
|
|
10235
|
+
} = {}) {
|
|
10236
|
+
if (feeBreakdown) {
|
|
10237
|
+
return feeBreakdown;
|
|
10238
|
+
}
|
|
10261
10239
|
const { details, fees } = relayQuote;
|
|
10262
10240
|
const gasUsd = Number.parseFloat(fees?.gas?.amountUsd || "0");
|
|
10263
|
-
const destinationChainId = details?.currencyOut?.currency?.chainId || "";
|
|
10264
|
-
const chainName = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6[destinationChainId]?.name;
|
|
10265
10241
|
const appFeeUsd = Number.parseFloat(fees?.app?.amountUsd || "0");
|
|
10266
10242
|
const fillCostUsd = Number.parseFloat(fees?.relayerGas?.amountUsd || "0");
|
|
10267
10243
|
const relayCostUsd = Number.parseFloat(fees?.relayerService?.amountUsd || "0");
|
|
@@ -10281,7 +10257,6 @@ function extractRelayFeeInfo(relayQuote) {
|
|
|
10281
10257
|
gasUsd,
|
|
10282
10258
|
fillCostUsd,
|
|
10283
10259
|
fillCostPercent,
|
|
10284
|
-
chainName,
|
|
10285
10260
|
totalImpactUsd,
|
|
10286
10261
|
totalImpact,
|
|
10287
10262
|
swapImpact,
|
|
@@ -10403,7 +10378,7 @@ function formatRelayFee({
|
|
|
10403
10378
|
}
|
|
10404
10379
|
return formatPercent(percent);
|
|
10405
10380
|
}
|
|
10406
|
-
function renderRelayFee(
|
|
10381
|
+
function renderRelayFee(relayQuoteMetadata, fees, totalUsd) {
|
|
10407
10382
|
const {
|
|
10408
10383
|
gasUsd,
|
|
10409
10384
|
totalImpactUsd,
|
|
@@ -10414,7 +10389,7 @@ function renderRelayFee(relayQuote, fees, totalUsd) {
|
|
|
10414
10389
|
maxSlippage,
|
|
10415
10390
|
minReceived,
|
|
10416
10391
|
fillCostUsd
|
|
10417
|
-
} = extractRelayFeeInfo(
|
|
10392
|
+
} = extractRelayFeeInfo(relayQuoteMetadata);
|
|
10418
10393
|
const totalNetworkCostUsd = fillCostUsd + gasUsd;
|
|
10419
10394
|
const totalPriceImpact = swapImpactUsd + appFeeUsd;
|
|
10420
10395
|
const totalPriceImpactPercent = swapImpact + appFeePercent;
|
|
@@ -10527,9 +10502,9 @@ function renderRelayFee(relayQuote, fees, totalUsd) {
|
|
|
10527
10502
|
]
|
|
10528
10503
|
};
|
|
10529
10504
|
}
|
|
10530
|
-
var extractFeeItems = (fees, totalUsd,
|
|
10531
|
-
if (
|
|
10532
|
-
return renderRelayFee(
|
|
10505
|
+
var extractFeeItems = (fees, totalUsd, relayQuoteMetadata) => {
|
|
10506
|
+
if (relayQuoteMetadata) {
|
|
10507
|
+
return renderRelayFee(relayQuoteMetadata, fees, totalUsd);
|
|
10533
10508
|
}
|
|
10534
10509
|
const marketMakerFee = {
|
|
10535
10510
|
label: "Market maker gas costs",
|
|
@@ -10616,8 +10591,8 @@ function PaymentFeesSummary({
|
|
|
10616
10591
|
return NO_DATA;
|
|
10617
10592
|
}
|
|
10618
10593
|
const totalUsd = Number(quote?.finalTotalUsd ?? "0");
|
|
10619
|
-
const
|
|
10620
|
-
return extractFeeItems(fees, totalUsd,
|
|
10594
|
+
const relayQuoteMetadata = quote?.baseQuote?.metadata;
|
|
10595
|
+
return extractFeeItems(fees, totalUsd, relayQuoteMetadata);
|
|
10621
10596
|
}, [quote, fallbackFees]);
|
|
10622
10597
|
const isExpandable = expandedItems.length > 0 && !isLoading && !valuesNotAvailable;
|
|
10623
10598
|
return /* @__PURE__ */ React90.createElement(Box, null, /* @__PURE__ */ React90.createElement(
|
|
@@ -10697,7 +10672,7 @@ function FeeLineItem({
|
|
|
10697
10672
|
content: tooltipText,
|
|
10698
10673
|
tooltipPosition,
|
|
10699
10674
|
enableDynamicPositioning: true,
|
|
10700
|
-
maxWidth: tooltipWidth === "wide" ?
|
|
10675
|
+
maxWidth: tooltipWidth === "wide" ? 250 : void 0
|
|
10701
10676
|
},
|
|
10702
10677
|
/* @__PURE__ */ React90.createElement(
|
|
10703
10678
|
Box,
|
|
@@ -10758,7 +10733,7 @@ var EvmWallet = ({ size = 20 }) => /* @__PURE__ */ React91.createElement(
|
|
|
10758
10733
|
);
|
|
10759
10734
|
|
|
10760
10735
|
// src/hooks/queries/useWithdrawalQuote.ts
|
|
10761
|
-
import { useQuery as
|
|
10736
|
+
import { useQuery as useQuery6 } from "@tanstack/react-query";
|
|
10762
10737
|
import { useConfig as useConfig2 } from "wagmi";
|
|
10763
10738
|
|
|
10764
10739
|
// src/domains/quote.ts
|
|
@@ -10769,18 +10744,18 @@ import {
|
|
|
10769
10744
|
getAssetPriceInfo as getAssetPriceInfo2,
|
|
10770
10745
|
getMoonpayBuyQuoteForCreditCard
|
|
10771
10746
|
} from "@funkit/api-base";
|
|
10772
|
-
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
10747
|
+
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7 } from "@funkit/chains";
|
|
10773
10748
|
import { estimateGas, getGasPrice } from "@wagmi/core";
|
|
10774
10749
|
import { encodeFunctionData, erc20Abi as erc20Abi2, formatEther } from "viem";
|
|
10775
10750
|
import { zkSync } from "viem/zksync";
|
|
10776
10751
|
|
|
10777
10752
|
// src/utils/moonpay.ts
|
|
10778
|
-
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
10753
|
+
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6 } from "@funkit/chains";
|
|
10779
10754
|
var MINIMUM_MOONPAY_DEPOSIT_AMOUNT_USD = 35;
|
|
10780
10755
|
var MINIMUM_DEFI_MOONPAY_DEPOSIT_AMOUNT_USD = 25;
|
|
10781
10756
|
var MAXIMUM_MOONPAY_DEPOSIT_AMOUNT_USD = 1e4;
|
|
10782
10757
|
var generateMoonpayCurrencyCode = (tokenSymbol, chainId) => {
|
|
10783
|
-
let moonpayChainName =
|
|
10758
|
+
let moonpayChainName = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6[chainId]?.moonpayChainName;
|
|
10784
10759
|
if (moonpayChainName == null) {
|
|
10785
10760
|
throw new Error("MoonPay not supported on testnets");
|
|
10786
10761
|
}
|
|
@@ -10846,7 +10821,7 @@ async function evaluateAccountWalletFees({
|
|
|
10846
10821
|
apiKey,
|
|
10847
10822
|
isWithdrawal
|
|
10848
10823
|
}) {
|
|
10849
|
-
const nativeCurrencySymbol =
|
|
10824
|
+
const nativeCurrencySymbol = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7[selectedSourceAssetInfo.chainId]?.nativeCurrency.symbol || "";
|
|
10850
10825
|
const walletCheckoutFees = {
|
|
10851
10826
|
paymentMethod: "balance" /* ACCOUNT_BALANCE */,
|
|
10852
10827
|
...getFunFeeBreakdown(baseQuote),
|
|
@@ -11178,12 +11153,13 @@ function useWithdrawalQuote({
|
|
|
11178
11153
|
const wagmiConfig = useConfig2();
|
|
11179
11154
|
const { getWithdrawalDirectExecution } = useCheckoutDirectExecution();
|
|
11180
11155
|
const { checkoutItem } = useCheckoutContext();
|
|
11156
|
+
const isInstantQuoting = (symbol === "USDC" || symbol === "USDT") && chainId !== "1";
|
|
11181
11157
|
const isValidAddress = isAddressCompatibleWithChain(
|
|
11182
11158
|
recipientAddress,
|
|
11183
11159
|
Number(chainId)
|
|
11184
11160
|
);
|
|
11185
11161
|
const enabled = !!apiKey && !!targetAsset && !!sourceAmount && !!recipientAddress && !!chainId && !!symbol && !!isValidAddress && !!checkoutItem;
|
|
11186
|
-
const query =
|
|
11162
|
+
const query = useQuery6({
|
|
11187
11163
|
queryKey: [
|
|
11188
11164
|
"withdrawal",
|
|
11189
11165
|
"quote",
|
|
@@ -11220,19 +11196,33 @@ function useWithdrawalQuote({
|
|
|
11220
11196
|
retry: false,
|
|
11221
11197
|
enabled,
|
|
11222
11198
|
refetchInterval: enabled ? QUOTE_REFRESH_INTERVAL_MS : false,
|
|
11223
|
-
refetchIntervalInBackground: true
|
|
11199
|
+
refetchIntervalInBackground: true,
|
|
11200
|
+
placeholderData: (previousData) => {
|
|
11201
|
+
if (!previousData || !isInstantQuoting) {
|
|
11202
|
+
return void 0;
|
|
11203
|
+
}
|
|
11204
|
+
const prevQuote = previousData.baseQuote.metadata?.relayQuote;
|
|
11205
|
+
if (!prevQuote) {
|
|
11206
|
+
return void 0;
|
|
11207
|
+
}
|
|
11208
|
+
const { chainId: prevChainId, symbol: prevSymbol } = prevQuote?.details?.currencyOut?.currency || {};
|
|
11209
|
+
if (prevChainId?.toString() === chainId && prevSymbol === symbol) {
|
|
11210
|
+
return previousData;
|
|
11211
|
+
}
|
|
11212
|
+
}
|
|
11224
11213
|
});
|
|
11225
11214
|
return {
|
|
11226
11215
|
...query,
|
|
11227
|
-
quoteEnabled: enabled
|
|
11216
|
+
quoteEnabled: enabled,
|
|
11217
|
+
isInstantQuoting
|
|
11228
11218
|
};
|
|
11229
11219
|
}
|
|
11230
11220
|
|
|
11231
11221
|
// src/hooks/queries/useWithdrawalRisk.ts
|
|
11232
|
-
import { useQuery as
|
|
11222
|
+
import { useQuery as useQuery7 } from "@tanstack/react-query";
|
|
11233
11223
|
import { isAddress as isAddress3 } from "viem";
|
|
11234
11224
|
var useWithdrawalRisk = (apiKey, receiveAddress) => {
|
|
11235
|
-
const query =
|
|
11225
|
+
const query = useQuery7({
|
|
11236
11226
|
queryKey: ["withdrawal", "addressRisk", apiKey, receiveAddress],
|
|
11237
11227
|
queryFn: async () => {
|
|
11238
11228
|
return await hasRisk(apiKey, receiveAddress);
|
|
@@ -11252,17 +11242,17 @@ import {
|
|
|
11252
11242
|
convertFunToRelayTokenAddress,
|
|
11253
11243
|
getRelayAssetPriceInfo
|
|
11254
11244
|
} from "@funkit/fun-relay";
|
|
11255
|
-
import { skipToken, useQuery as
|
|
11245
|
+
import { skipToken, useQuery as useQuery9 } from "@tanstack/react-query";
|
|
11256
11246
|
|
|
11257
11247
|
// src/hooks/queries/useErc20Asset.ts
|
|
11258
11248
|
import { getAssetErc20ByChainAndSymbol } from "@funkit/api-base";
|
|
11259
|
-
import { useQuery as
|
|
11249
|
+
import { useQuery as useQuery8 } from "@tanstack/react-query";
|
|
11260
11250
|
var useErc20Asset = ({
|
|
11261
11251
|
chainId,
|
|
11262
11252
|
symbol
|
|
11263
11253
|
}) => {
|
|
11264
11254
|
const { apiKey } = useFunkitConfig();
|
|
11265
|
-
const query =
|
|
11255
|
+
const query = useQuery8({
|
|
11266
11256
|
queryKey: ["erc20Asset", chainId, symbol],
|
|
11267
11257
|
queryFn: async () => {
|
|
11268
11258
|
if (!apiKey || !chainId || !symbol) {
|
|
@@ -11311,7 +11301,7 @@ function useAssetAddressPrice({
|
|
|
11311
11301
|
refetchInterval = 1e4
|
|
11312
11302
|
}) {
|
|
11313
11303
|
const { apiKey } = useFunkitConfig();
|
|
11314
|
-
const { data, error, isLoading } =
|
|
11304
|
+
const { data, error, isLoading } = useQuery9({
|
|
11315
11305
|
queryKey: ["getAssetPriceInfo", chainId, assetTokenAddress],
|
|
11316
11306
|
queryFn: chainId && assetTokenAddress ? async () => {
|
|
11317
11307
|
const isRelayPrimary = RELAY_SHORT_CIRCUIT_CHAIN_IDS.includes(chainId);
|
|
@@ -12082,8 +12072,9 @@ function useWithdrawalAssets(config) {
|
|
|
12082
12072
|
}
|
|
12083
12073
|
function getRelayOutputCurrencyAmount(quote, fallback2) {
|
|
12084
12074
|
try {
|
|
12075
|
+
const relayQuote = quote.baseQuote;
|
|
12085
12076
|
return Number.parseFloat(
|
|
12086
|
-
|
|
12077
|
+
relayQuote.metadata?.relayQuote?.details?.currencyOut?.amountFormatted || "0"
|
|
12087
12078
|
) || fallback2 || 0;
|
|
12088
12079
|
} catch (error) {
|
|
12089
12080
|
logger.error("Error getting relay output currency amount:", error);
|
|
@@ -12100,9 +12091,11 @@ var WithdrawContent = ({
|
|
|
12100
12091
|
onContinue,
|
|
12101
12092
|
config,
|
|
12102
12093
|
withdrawalItem
|
|
12094
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: <explanation>
|
|
12103
12095
|
}) => {
|
|
12104
12096
|
const sourceTokenBalance = withdrawalItem?.withdrawalSourceTokenBalance?.() || 0;
|
|
12105
12097
|
const token = config.sourceTokenSymbol;
|
|
12098
|
+
const [confirmingQuote, setConfirmingQuote] = useState27(false);
|
|
12106
12099
|
const [recipientAddress, setRecipientAddress] = useState27("");
|
|
12107
12100
|
const [amount, setAmount] = useState27("");
|
|
12108
12101
|
const [debouncedAmount] = useDebounce(amount, 500);
|
|
@@ -12150,7 +12143,9 @@ var WithdrawContent = ({
|
|
|
12150
12143
|
isLoading: isQuoteLoading,
|
|
12151
12144
|
data: quote,
|
|
12152
12145
|
error: quoteErrorObject,
|
|
12153
|
-
quoteEnabled
|
|
12146
|
+
quoteEnabled,
|
|
12147
|
+
isPlaceholderData,
|
|
12148
|
+
isInstantQuoting
|
|
12154
12149
|
} = useWithdrawalQuote({
|
|
12155
12150
|
withdrawalClient: config.wallet,
|
|
12156
12151
|
recipientAddress,
|
|
@@ -12171,6 +12166,13 @@ var WithdrawContent = ({
|
|
|
12171
12166
|
onContinue(withdrawal, txHash);
|
|
12172
12167
|
}
|
|
12173
12168
|
});
|
|
12169
|
+
useEffect27(() => {
|
|
12170
|
+
if (!isPlaceholderData && !isQuoteLoading && isInstantQuoting && confirmingQuote) {
|
|
12171
|
+
setTimeout(() => {
|
|
12172
|
+
setConfirmingQuote(false);
|
|
12173
|
+
}, 150);
|
|
12174
|
+
}
|
|
12175
|
+
}, [isPlaceholderData, confirmingQuote, isQuoteLoading, isInstantQuoting]);
|
|
12174
12176
|
const showCheckAddressAlert = false;
|
|
12175
12177
|
const wallets = usePreparedWalletConnectors();
|
|
12176
12178
|
const { loginType } = useGeneralWallet();
|
|
@@ -12178,6 +12180,7 @@ var WithdrawContent = ({
|
|
|
12178
12180
|
const connectedWalletIconUrl = wallets.find(
|
|
12179
12181
|
(wallet) => wallet.id === connector?.id
|
|
12180
12182
|
)?.iconUrl;
|
|
12183
|
+
const normalizedSelectedToken = selectedToken.toUpperCase();
|
|
12181
12184
|
const isValidAddress = isAddressSupported(recipientAddress);
|
|
12182
12185
|
const isValidAddressAndChain = isAddressCompatibleWithChain(
|
|
12183
12186
|
recipientAddress,
|
|
@@ -12214,6 +12217,10 @@ var WithdrawContent = ({
|
|
|
12214
12217
|
updateWithdrawalSourceAssetAmount(sourceTokenBalance);
|
|
12215
12218
|
};
|
|
12216
12219
|
const handleSubmit = () => {
|
|
12220
|
+
if (isPlaceholderData || isQuoteLoading && isInstantQuoting) {
|
|
12221
|
+
setConfirmingQuote(true);
|
|
12222
|
+
return;
|
|
12223
|
+
}
|
|
12217
12224
|
if (!quote) {
|
|
12218
12225
|
throw new Error("Quote is not available");
|
|
12219
12226
|
}
|
|
@@ -12230,6 +12237,9 @@ var WithdrawContent = ({
|
|
|
12230
12237
|
};
|
|
12231
12238
|
const { data: addressAssessment, isLoading: isCheckingAddressRisk } = useWithdrawalRisk(apiKey, recipientAddress);
|
|
12232
12239
|
const getWithdrawButtonText = () => {
|
|
12240
|
+
if (confirmingQuote) {
|
|
12241
|
+
return "Confirming quote";
|
|
12242
|
+
}
|
|
12233
12243
|
if (isWithdrawing) {
|
|
12234
12244
|
return "Processing";
|
|
12235
12245
|
}
|
|
@@ -12245,7 +12255,7 @@ var WithdrawContent = ({
|
|
|
12245
12255
|
return "Withdraw";
|
|
12246
12256
|
};
|
|
12247
12257
|
const getAlertMessage = () => {
|
|
12248
|
-
const chainName =
|
|
12258
|
+
const chainName = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO8[selectedChainId]?.name;
|
|
12249
12259
|
if (chainName) {
|
|
12250
12260
|
return `Please ensure the address supports receiving ${selectedToken} on ${chainName}.`;
|
|
12251
12261
|
}
|
|
@@ -12254,15 +12264,14 @@ var WithdrawContent = ({
|
|
|
12254
12264
|
const bottomSectionRef = useBottomSectionRef("withdrawal");
|
|
12255
12265
|
const showAddressError = addressInputTouched && !isValidAddress && recipientAddress !== "";
|
|
12256
12266
|
const showAmountError = amountInputTouched && amount !== "" && !isWithdrawAmountValid;
|
|
12257
|
-
const canContinue = recipientAddress && amount && token && selectedChainId && !isQuoteLoading && !showAmountError && !showAddressError && !isCheckingAddressRisk && !addressAssessment && isValidAddressAndChain && amount === debouncedAmount;
|
|
12267
|
+
const canContinue = recipientAddress && amount && token && selectedChainId && (!isQuoteLoading || isInstantQuoting) && !showAmountError && !showAddressError && !isCheckingAddressRisk && !addressAssessment && isValidAddressAndChain && amount === debouncedAmount;
|
|
12258
12268
|
const { totalImpactUsd, gasUsd } = extractRelayFeeInfo(
|
|
12259
|
-
quote?.baseQuote?.metadata
|
|
12269
|
+
quote?.baseQuote?.metadata
|
|
12260
12270
|
);
|
|
12261
|
-
const receiveAmountCrypto = quote ? getRelayOutputCurrencyAmount(quote.finalEstimation, targetAssetAmount) : 0;
|
|
12262
|
-
const receiveAmountFiat = quote ? Number(debouncedAmount || 0) : 0;
|
|
12271
|
+
const receiveAmountCrypto = quote ? getRelayOutputCurrencyAmount(quote.finalEstimation, targetAssetAmount) : isInstantQuoting ? Number(amount) : 0;
|
|
12272
|
+
const receiveAmountFiat = quote || isInstantQuoting ? Number(debouncedAmount || 0) : 0;
|
|
12263
12273
|
const receiveAmountFiatTotal = receiveAmountFiat - totalImpactUsd - gasUsd;
|
|
12264
12274
|
const withdrawButtonText = getWithdrawButtonText();
|
|
12265
|
-
const normalizedSelectedToken = selectedToken.toUpperCase();
|
|
12266
12275
|
return /* @__PURE__ */ React93.createElement(Box, { id: "withdrawal-flow", display: "flex", flexDirection: "column", gap: "18" }, /* @__PURE__ */ React93.createElement(Box, { display: "flex", flexDirection: "column", gap: "8" }, /* @__PURE__ */ React93.createElement(Box, { display: "flex", flexDirection: "column", gap: "4" }, /* @__PURE__ */ React93.createElement(Text, { size: "12", weight: "medium" }, "Recipient address"), /* @__PURE__ */ React93.createElement(
|
|
12267
12276
|
FunInput,
|
|
12268
12277
|
{
|
|
@@ -12376,7 +12385,7 @@ var WithdrawContent = ({
|
|
|
12376
12385
|
alwaysOpenToTop: true,
|
|
12377
12386
|
maxTokenDropdownHeight: 195
|
|
12378
12387
|
}
|
|
12379
|
-
), /* @__PURE__ */ React93.createElement(Box, { display: "flex", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React93.createElement(Text, { size: "12" }, "You will receive"), isQuoteLoading ? /* @__PURE__ */ React93.createElement(FunSkeletonBlock, { height: "14", width: "54" }) : /* @__PURE__ */ React93.createElement(
|
|
12388
|
+
), /* @__PURE__ */ React93.createElement(Box, { display: "flex", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React93.createElement(Text, { size: "12" }, "You will receive"), isQuoteLoading && !isInstantQuoting ? /* @__PURE__ */ React93.createElement(FunSkeletonBlock, { height: "14", width: "54" }) : /* @__PURE__ */ React93.createElement(
|
|
12380
12389
|
Box,
|
|
12381
12390
|
{
|
|
12382
12391
|
display: "flex",
|
|
@@ -12389,7 +12398,7 @@ var WithdrawContent = ({
|
|
|
12389
12398
|
PaymentFeesSummary,
|
|
12390
12399
|
{
|
|
12391
12400
|
fallbackFees: FALLBACK_FEES,
|
|
12392
|
-
isLoading: isQuoteLoading,
|
|
12401
|
+
isLoading: isQuoteLoading && !isInstantQuoting,
|
|
12393
12402
|
quote: quote?.finalEstimation,
|
|
12394
12403
|
key: `${isQuoteLoading}`,
|
|
12395
12404
|
valuesNotAvailable: !quoteEnabled
|
|
@@ -12415,7 +12424,7 @@ var WithdrawContent = ({
|
|
|
12415
12424
|
actionButtonProps: {
|
|
12416
12425
|
title: withdrawButtonText,
|
|
12417
12426
|
isDisabled: !canContinue || isWithdrawing,
|
|
12418
|
-
isLoading: isWithdrawing,
|
|
12427
|
+
isLoading: isWithdrawing || confirmingQuote,
|
|
12419
12428
|
onClick: handleSubmit
|
|
12420
12429
|
}
|
|
12421
12430
|
}
|
|
@@ -12537,7 +12546,7 @@ function useSIWFarcasterListener(channelToken) {
|
|
|
12537
12546
|
import {
|
|
12538
12547
|
getAllWalletTokens
|
|
12539
12548
|
} from "@funkit/api-base";
|
|
12540
|
-
import { keepPreviousData, useQuery as
|
|
12549
|
+
import { keepPreviousData, useQuery as useQuery10 } from "@tanstack/react-query";
|
|
12541
12550
|
import { arbitrum as arbitrum2, polygon as polygon4 } from "viem/chains";
|
|
12542
12551
|
import { useAccount as useAccount4 } from "wagmi";
|
|
12543
12552
|
import { isTokenEquivalent as isTokenEquivalent2 } from "@funkit/utils";
|
|
@@ -12626,7 +12635,7 @@ var useWalletAssets = ({
|
|
|
12626
12635
|
} = {}) => {
|
|
12627
12636
|
const { address, isConnected } = useAccount4();
|
|
12628
12637
|
const { apiKey } = useFunkitConfig();
|
|
12629
|
-
const { data, isLoading, isFetching } =
|
|
12638
|
+
const { data, isLoading, isFetching } = useQuery10({
|
|
12630
12639
|
queryKey: ["getWalletAssets", address, apiKey],
|
|
12631
12640
|
queryFn: ({ queryKey: [_, addr, key] }) => fetchAssets(addr, key),
|
|
12632
12641
|
placeholderData: keepPreviousData,
|
|
@@ -12704,7 +12713,7 @@ function FunTxSummaryLineItemKeyText({ text }) {
|
|
|
12704
12713
|
|
|
12705
12714
|
// src/components/FunButton/FunRedirectButton.tsx
|
|
12706
12715
|
import React97 from "react";
|
|
12707
|
-
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
12716
|
+
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9 } from "@funkit/chains";
|
|
12708
12717
|
|
|
12709
12718
|
// src/components/Icons/RedirectIcon.tsx
|
|
12710
12719
|
import React96 from "react";
|
|
@@ -12763,7 +12772,7 @@ var AddressRedirectButton = ({
|
|
|
12763
12772
|
address,
|
|
12764
12773
|
customRedirectUrl
|
|
12765
12774
|
}) => {
|
|
12766
|
-
const explorerInfo =
|
|
12775
|
+
const explorerInfo = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9[chainId]?.explorerInfo;
|
|
12767
12776
|
return /* @__PURE__ */ React97.createElement(
|
|
12768
12777
|
FunRedirectButton,
|
|
12769
12778
|
{
|
|
@@ -12777,7 +12786,7 @@ var TransactionRedirectButton = ({
|
|
|
12777
12786
|
txHash,
|
|
12778
12787
|
customRedirectUrl
|
|
12779
12788
|
}) => {
|
|
12780
|
-
const explorerInfo =
|
|
12789
|
+
const explorerInfo = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9[chainId]?.explorerInfo;
|
|
12781
12790
|
return /* @__PURE__ */ React97.createElement(
|
|
12782
12791
|
FunRedirectButton,
|
|
12783
12792
|
{
|
|
@@ -12814,7 +12823,7 @@ import {
|
|
|
12814
12823
|
getBridgeCustomer,
|
|
12815
12824
|
getFrogAccount
|
|
12816
12825
|
} from "@funkit/api-base";
|
|
12817
|
-
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
12826
|
+
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO10 } from "@funkit/chains";
|
|
12818
12827
|
import { ResourceNotFoundError } from "@funkit/utils";
|
|
12819
12828
|
async function fetchFrogAccounts(walletAddress, params) {
|
|
12820
12829
|
const { logger: logger2 } = params;
|
|
@@ -12858,7 +12867,7 @@ async function fetchAllFiatAccounts(bridgeSubAccount, params) {
|
|
|
12858
12867
|
}
|
|
12859
12868
|
function getMatchingBankAccount(accounts, targetChain, targetAddress) {
|
|
12860
12869
|
const { bankAccounts } = accounts;
|
|
12861
|
-
const chainInfo =
|
|
12870
|
+
const chainInfo = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO10[targetChain];
|
|
12862
12871
|
if (!bankAccounts || !chainInfo) {
|
|
12863
12872
|
return void 0;
|
|
12864
12873
|
}
|
|
@@ -12903,9 +12912,9 @@ import {
|
|
|
12903
12912
|
createBridgeBankAccount,
|
|
12904
12913
|
getBridgeKycLink
|
|
12905
12914
|
} from "@funkit/api-base";
|
|
12906
|
-
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
12915
|
+
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO11 } from "@funkit/chains";
|
|
12907
12916
|
import { FlagKey as FlagKey16 } from "@funkit/utils";
|
|
12908
|
-
import { useQuery as
|
|
12917
|
+
import { useQuery as useQuery11, useQueryClient } from "@tanstack/react-query";
|
|
12909
12918
|
import { useCallback as useCallback18 } from "react";
|
|
12910
12919
|
var sepaCountryCode = [
|
|
12911
12920
|
// EU countries that are part of SEPA
|
|
@@ -12991,7 +13000,7 @@ function useFiatEnabled() {
|
|
|
12991
13000
|
function useFrogAccounts() {
|
|
12992
13001
|
const { apiKey } = useFunkitConfig();
|
|
12993
13002
|
const { walletAddress } = useGeneralWallet();
|
|
12994
|
-
const query =
|
|
13003
|
+
const query = useQuery11({
|
|
12995
13004
|
queryKey: ["frogSubAccounts", walletAddress],
|
|
12996
13005
|
queryFn: () => fetchFrogAccounts(walletAddress, { apiKey, logger }),
|
|
12997
13006
|
enabled: !!walletAddress,
|
|
@@ -13027,7 +13036,7 @@ function useVirtualFiatAccounts() {
|
|
|
13027
13036
|
const bridgeSubAccount = frogSubAccounts?.find(
|
|
13028
13037
|
(subAccount) => subAccount.subAccountType === "bridge"
|
|
13029
13038
|
);
|
|
13030
|
-
const query =
|
|
13039
|
+
const query = useQuery11({
|
|
13031
13040
|
queryKey: ["useVirtualFiatAccounts", bridgeSubAccount?.guid],
|
|
13032
13041
|
queryFn: () => fetchAllFiatAccounts(bridgeSubAccount, { apiKey, logger }),
|
|
13033
13042
|
enabled: !!bridgeSubAccount,
|
|
@@ -13054,7 +13063,7 @@ function useMatchingVirtualFiatAccount(accounts) {
|
|
|
13054
13063
|
}
|
|
13055
13064
|
function useLoadKycLink(linkLoad) {
|
|
13056
13065
|
const { apiKey } = useFunkitConfig();
|
|
13057
|
-
const query =
|
|
13066
|
+
const query = useQuery11({
|
|
13058
13067
|
queryKey: ["kycLink", linkLoad.guid],
|
|
13059
13068
|
queryFn: async () => {
|
|
13060
13069
|
if (linkLoad.kycLink) {
|
|
@@ -13083,7 +13092,7 @@ function useCreateVirtualBankAccount() {
|
|
|
13083
13092
|
const targetChainId = checkoutConfig?.targetChain;
|
|
13084
13093
|
const { transferInit, recipientAddr } = useCheckoutTransferInit();
|
|
13085
13094
|
const destinationAddress = transferInit?.depositAddr || recipientAddr;
|
|
13086
|
-
const chainName = targetChainId &&
|
|
13095
|
+
const chainName = targetChainId && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO11[targetChainId]?.name?.toLowerCase();
|
|
13087
13096
|
const subAccountId = allFiatAccounts?.bridgeCustomer?.id;
|
|
13088
13097
|
const { clearVirtualFiatAccounts } = useClearFrogAccountsCache();
|
|
13089
13098
|
const handleCreateVirtualFiatAccount = useCallback18(async () => {
|
|
@@ -13134,7 +13143,7 @@ var useWalletLabel = () => {
|
|
|
13134
13143
|
// src/modals/CheckoutModal/useWalletAssetHoldings.ts
|
|
13135
13144
|
import {
|
|
13136
13145
|
FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS3,
|
|
13137
|
-
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
13146
|
+
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12
|
|
13138
13147
|
} from "@funkit/chains";
|
|
13139
13148
|
import { useMemo as useMemo13 } from "react";
|
|
13140
13149
|
|
|
@@ -13154,14 +13163,14 @@ var processWalletAssets = (walletAssets, targetChain) => {
|
|
|
13154
13163
|
if (!walletAssets) {
|
|
13155
13164
|
return;
|
|
13156
13165
|
}
|
|
13157
|
-
const targetChainInfo =
|
|
13166
|
+
const targetChainInfo = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12[targetChain];
|
|
13158
13167
|
const isCheckoutOnMainnet = targetChainInfo?.isMainnet;
|
|
13159
13168
|
return Object.values(walletAssets).reduce(
|
|
13160
13169
|
(result, asset) => {
|
|
13161
13170
|
if (!asset.symbol || !asset.contractAddress) {
|
|
13162
13171
|
return result;
|
|
13163
13172
|
}
|
|
13164
|
-
const assetChainInfo =
|
|
13173
|
+
const assetChainInfo = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12[asset.chainId];
|
|
13165
13174
|
const isAssetOnMainnet = assetChainInfo?.isMainnet;
|
|
13166
13175
|
if (isCheckoutOnMainnet && !isAssetOnMainnet) {
|
|
13167
13176
|
return result;
|
|
@@ -13208,7 +13217,7 @@ function useWalletAssetHoldings(targetChain) {
|
|
|
13208
13217
|
|
|
13209
13218
|
// src/config/getDefaultConfig.ts
|
|
13210
13219
|
import {
|
|
13211
|
-
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
13220
|
+
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO13,
|
|
13212
13221
|
FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST
|
|
13213
13222
|
} from "@funkit/chains";
|
|
13214
13223
|
import { fallback } from "viem";
|
|
@@ -13905,7 +13914,7 @@ var createDefaultTransports = (chains) => {
|
|
|
13905
13914
|
const transportsObject = {};
|
|
13906
13915
|
for (const chain of chains) {
|
|
13907
13916
|
const key = chain.id;
|
|
13908
|
-
const fallbackRpcs =
|
|
13917
|
+
const fallbackRpcs = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO13[key]?.fallbackRpcUrls;
|
|
13909
13918
|
if (fallbackRpcs && fallbackRpcs.length > 0) {
|
|
13910
13919
|
transportsObject[key] = fallback([
|
|
13911
13920
|
http(),
|
|
@@ -15153,9 +15162,6 @@ function useCheckoutQuoteNotification() {
|
|
|
15153
15162
|
};
|
|
15154
15163
|
}
|
|
15155
15164
|
|
|
15156
|
-
// src/modals/CheckoutModal/stepTransition.ts
|
|
15157
|
-
import { FlagKey as FlagKey31 } from "@funkit/utils";
|
|
15158
|
-
|
|
15159
15165
|
// src/modals/CheckoutModal/VirtualFiatAccount/BridgeCustomer.tsx
|
|
15160
15166
|
import React112 from "react";
|
|
15161
15167
|
|
|
@@ -18298,11 +18304,11 @@ function ConfirmationStep({
|
|
|
18298
18304
|
const uiCustomizations = funkitConfig.uiCustomizations?.confirmationScreen;
|
|
18299
18305
|
const customRecipient = checkoutItem?.initSettings.config.customRecipient;
|
|
18300
18306
|
const showKatanaBridgeAlert = useMemo19(() => {
|
|
18301
|
-
const
|
|
18302
|
-
if (!
|
|
18307
|
+
const relayQuoteMetadata = latestQuote?.baseQuote?.metadata;
|
|
18308
|
+
if (!relayQuoteMetadata) {
|
|
18303
18309
|
return false;
|
|
18304
18310
|
}
|
|
18305
|
-
const { swapImpact, appFeePercent } = extractRelayFeeInfo(
|
|
18311
|
+
const { swapImpact, appFeePercent } = extractRelayFeeInfo(relayQuoteMetadata);
|
|
18306
18312
|
return isKatanaCustomer(funkitConfig.apiKey) && // Don't take totalImpact, just sum swapImpact and appFeePercent
|
|
18307
18313
|
// https://fun-xyz.slack.com/archives/C08PVUDA1M2/p1752179735981389?thread_ts=1752176009.628309&cid=C08PVUDA1M2
|
|
18308
18314
|
swapImpact + appFeePercent > KATANA_BRIDGE_ALERT_THRESHOLD_PERCENT;
|
|
@@ -18519,7 +18525,7 @@ import React164, { useEffect as useEffect37 } from "react";
|
|
|
18519
18525
|
|
|
18520
18526
|
// src/hooks/queries/useMeldCurrencies.ts
|
|
18521
18527
|
import { getMeldSupportedFiat } from "@funkit/api-base";
|
|
18522
|
-
import { useQuery as
|
|
18528
|
+
import { useQuery as useQuery12 } from "@tanstack/react-query";
|
|
18523
18529
|
var getPriority = (currencyCode) => {
|
|
18524
18530
|
if (currencyCode === "USD") {
|
|
18525
18531
|
return 0;
|
|
@@ -18531,7 +18537,7 @@ var getPriority = (currencyCode) => {
|
|
|
18531
18537
|
};
|
|
18532
18538
|
var useMeldCurrencies = (isEnabled = true) => {
|
|
18533
18539
|
const { apiKey } = useFunkitConfig();
|
|
18534
|
-
const query =
|
|
18540
|
+
const query = useQuery12({
|
|
18535
18541
|
queryKey: ["meld", "currencies"],
|
|
18536
18542
|
queryFn: async () => {
|
|
18537
18543
|
if (!apiKey) {
|
|
@@ -18557,7 +18563,7 @@ var useMeldCurrencies = (isEnabled = true) => {
|
|
|
18557
18563
|
|
|
18558
18564
|
// src/hooks/queries/useMeldDefaultCurrency.ts
|
|
18559
18565
|
import { getMeldDefaultFiat } from "@funkit/api-base";
|
|
18560
|
-
import { useQuery as
|
|
18566
|
+
import { useQuery as useQuery13 } from "@tanstack/react-query";
|
|
18561
18567
|
|
|
18562
18568
|
// src/hooks/queries/useMeldCryptoCurrencyCode.ts
|
|
18563
18569
|
import { FlagKey as FlagKey20 } from "@funkit/utils";
|
|
@@ -18603,7 +18609,7 @@ var useMeldDefaultCurrency = (paymentMethod) => {
|
|
|
18603
18609
|
const { apiKey } = useFunkitConfig();
|
|
18604
18610
|
const { userIpInfo } = useFunkitUserIp();
|
|
18605
18611
|
const enableMeld = useIsMeldEnabled();
|
|
18606
|
-
const query =
|
|
18612
|
+
const query = useQuery13({
|
|
18607
18613
|
queryKey: ["meld", "defaultCurrency", paymentMethod],
|
|
18608
18614
|
queryFn: async () => {
|
|
18609
18615
|
if (!apiKey) {
|
|
@@ -18628,13 +18634,13 @@ var useMeldDefaultCurrency = (paymentMethod) => {
|
|
|
18628
18634
|
// src/hooks/queries/useMeldLimits.ts
|
|
18629
18635
|
import { getMeldFiatLimits } from "@funkit/api-base";
|
|
18630
18636
|
import { formatCurrencyAndStringify as formatCurrencyAndStringify6 } from "@funkit/utils";
|
|
18631
|
-
import { useQuery as
|
|
18637
|
+
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
18632
18638
|
var useMeldLimits = (isEnabled = true) => {
|
|
18633
18639
|
const { apiKey } = useFunkitConfig();
|
|
18634
18640
|
const { userIpInfo } = useFunkitUserIp();
|
|
18635
18641
|
const cryptoCurrency = useMeldCryptoCurrencyCode();
|
|
18636
18642
|
const countryCode = userIpInfo?.alpha2;
|
|
18637
|
-
const query =
|
|
18643
|
+
const query = useQuery14({
|
|
18638
18644
|
queryKey: ["meld", "limits", countryCode, cryptoCurrency],
|
|
18639
18645
|
queryFn: async () => {
|
|
18640
18646
|
if (!apiKey || !countryCode) {
|
|
@@ -18828,6 +18834,7 @@ var providerLabelMap = {
|
|
|
18828
18834
|
ONRAMPMONEY: "Onramp Money",
|
|
18829
18835
|
PAYBIS: "Paybis",
|
|
18830
18836
|
RAMP: "Ramp",
|
|
18837
|
+
REVOLUT: "Revolut",
|
|
18831
18838
|
ROBINHOOD: "Robinhood",
|
|
18832
18839
|
SARDINE: "Sardine",
|
|
18833
18840
|
SHIFT4: "Shift4",
|
|
@@ -19852,7 +19859,7 @@ var useMeldLink = (sourceAmount, sourceCurrencyCode = "USD") => {
|
|
|
19852
19859
|
|
|
19853
19860
|
// src/modals/CheckoutModal/MeldQuotes/useMeldQuotes.tsx
|
|
19854
19861
|
import { getMeldQuotes } from "@funkit/api-base";
|
|
19855
|
-
import { useQuery as
|
|
19862
|
+
import { useQuery as useQuery15 } from "@tanstack/react-query";
|
|
19856
19863
|
import { useDebounce as useDebounce2 } from "use-debounce";
|
|
19857
19864
|
var DEBOUNCE_DELAY = 500;
|
|
19858
19865
|
var COUNTDOWN_INTERVAL_SEC = 60;
|
|
@@ -19864,7 +19871,7 @@ var useMeldQuotes = (sourceAmount, fiatCurrency) => {
|
|
|
19864
19871
|
const { isAway } = useUserPresence();
|
|
19865
19872
|
const destinationCurrencyCode = useMeldCryptoCurrencyCode();
|
|
19866
19873
|
const sourceCurrencyCode = fiatCurrency || "USD";
|
|
19867
|
-
const query =
|
|
19874
|
+
const query = useQuery15({
|
|
19868
19875
|
queryKey: [
|
|
19869
19876
|
"meld",
|
|
19870
19877
|
"quotes",
|
|
@@ -20452,7 +20459,7 @@ function InputAmountLoaded({
|
|
|
20452
20459
|
textCustomizations
|
|
20453
20460
|
}) {
|
|
20454
20461
|
const maxCheckoutUsdString = useFlag(FlagKey23.MaxCheckoutUsd);
|
|
20455
|
-
const isSourceNavWidgetEnabled =
|
|
20462
|
+
const isSourceNavWidgetEnabled = modalState.startingStep === "select_asset" /* SELECT_ASSET */;
|
|
20456
20463
|
const { paymentMethod } = modalState.paymentMethodInfo;
|
|
20457
20464
|
const { quote: manuallySelectedQuote } = modalState;
|
|
20458
20465
|
const isCardCheckout = paymentMethod === "card" /* CARD */;
|
|
@@ -20762,7 +20769,7 @@ function YouPayYouReceiveWrapper({
|
|
|
20762
20769
|
}
|
|
20763
20770
|
|
|
20764
20771
|
// src/modals/CheckoutModal/InputAmount/InputAmountLoading.tsx
|
|
20765
|
-
import {
|
|
20772
|
+
import { formatCryptoAndStringify as formatCryptoAndStringify6 } from "@funkit/utils";
|
|
20766
20773
|
import React163, { useMemo as useMemo21 } from "react";
|
|
20767
20774
|
function InputAmountLoading({
|
|
20768
20775
|
modalState,
|
|
@@ -20772,7 +20779,7 @@ function InputAmountLoading({
|
|
|
20772
20779
|
const { paymentMethodInfo } = modalState;
|
|
20773
20780
|
const { checkoutItem } = useCheckoutContext();
|
|
20774
20781
|
const meldEnabled = useIsMeldEnabled();
|
|
20775
|
-
const isSourceNavWidgetEnabled =
|
|
20782
|
+
const isSourceNavWidgetEnabled = modalState.startingStep === "select_asset" /* SELECT_ASSET */;
|
|
20776
20783
|
const targetAssetAmount = checkoutItem?.initSettings.config.targetAssetAmount;
|
|
20777
20784
|
const targetAssetTicker = checkoutItem?.initSettings.config.targetAssetTicker;
|
|
20778
20785
|
const error = useMemo21(() => {
|
|
@@ -20975,20 +20982,20 @@ function InputAmount(props) {
|
|
|
20975
20982
|
import React167, { useEffect as useEffect38 } from "react";
|
|
20976
20983
|
|
|
20977
20984
|
// src/domains/wallet.ts
|
|
20978
|
-
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
20985
|
+
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO14, dydxChain as dydxChain2 } from "@funkit/chains";
|
|
20979
20986
|
import { isNotNullish as isNotNullish7 } from "@funkit/utils";
|
|
20980
20987
|
import { mainnet as mainnet6, polygon as polygon6 } from "viem/chains";
|
|
20981
20988
|
var ASSETS_LOW_VALUE_THRESHOLD2 = 0.1;
|
|
20982
20989
|
|
|
20983
20990
|
// src/hooks/usePaymentSources.ts
|
|
20984
|
-
import { FlagKey as
|
|
20991
|
+
import { FlagKey as FlagKey24, isNotNullish as isNotNullish8 } from "@funkit/utils";
|
|
20985
20992
|
function usePaymentMethodEnablement({
|
|
20986
20993
|
checkoutConfig
|
|
20987
20994
|
}) {
|
|
20988
20995
|
const { apiKey, uiCustomizations } = useFunkitConfig();
|
|
20989
|
-
const isTokenTransferFlagEnabled = useFlag(
|
|
20996
|
+
const isTokenTransferFlagEnabled = useFlag(FlagKey24.EnableTokenTransfer);
|
|
20990
20997
|
const isFiatFlagEnabled = useFiatEnabled();
|
|
20991
|
-
const isCardFlagEnabled = useFlag(
|
|
20998
|
+
const isCardFlagEnabled = useFlag(FlagKey24.EnableCard);
|
|
20992
20999
|
const isKatanaEarnFlowAction = isKatanaEarnFlow({ apiKey, checkoutConfig });
|
|
20993
21000
|
const isUsKatanaUser = useIsUsKatanaUser();
|
|
20994
21001
|
const isFiatEnabled = isFiatFlagEnabled && !isKatanaEarnFlowAction;
|
|
@@ -21200,13 +21207,20 @@ function FunAssetLoading({ count = 3 }) {
|
|
|
21200
21207
|
var LoadingAccountInfo = {
|
|
21201
21208
|
Component: LoadingAccount,
|
|
21202
21209
|
onNext(state, payload) {
|
|
21203
|
-
if (
|
|
21210
|
+
if (state.startingStep === "confirmation" /* CONFIRMATION */ && payload.paymentMethodInfo) {
|
|
21204
21211
|
return {
|
|
21205
21212
|
...state,
|
|
21206
21213
|
step: "confirmation" /* CONFIRMATION */,
|
|
21207
21214
|
paymentMethodInfo: payload.paymentMethodInfo
|
|
21208
21215
|
};
|
|
21209
21216
|
}
|
|
21217
|
+
if (state.startingStep === "select_asset" /* SELECT_ASSET */ && payload.chosenPaymentMethod === "balance" /* ACCOUNT_BALANCE */ && payload.paymentMethodInfo) {
|
|
21218
|
+
return {
|
|
21219
|
+
...state,
|
|
21220
|
+
step: "select_asset" /* SELECT_ASSET */,
|
|
21221
|
+
paymentMethodInfo: payload.paymentMethodInfo
|
|
21222
|
+
};
|
|
21223
|
+
}
|
|
21210
21224
|
switch (payload.chosenPaymentMethod) {
|
|
21211
21225
|
case "balance" /* ACCOUNT_BALANCE */:
|
|
21212
21226
|
case "brokerage" /* BROKERAGE */:
|
|
@@ -21243,7 +21257,7 @@ var hasSufficientAsset = (walletAssets, targetChainId, threshold = ASSETS_LOW_VA
|
|
|
21243
21257
|
return (availableAmount ?? 0) >= threshold;
|
|
21244
21258
|
});
|
|
21245
21259
|
};
|
|
21246
|
-
function handleSufficientAssetRedirect(isDefiMode, hasCustomStartingStep, isOstiumCustomer2, walletAddress, updateSelectedPaymentMethodInfo, onNext
|
|
21260
|
+
function handleSufficientAssetRedirect(isDefiMode, hasCustomStartingStep, isOstiumCustomer2, walletAddress, updateSelectedPaymentMethodInfo, onNext) {
|
|
21247
21261
|
const paymentMethodInfo = createPaymentMethodInfo({
|
|
21248
21262
|
paymentMethod: "balance" /* ACCOUNT_BALANCE */,
|
|
21249
21263
|
walletAddress
|
|
@@ -21252,8 +21266,7 @@ function handleSufficientAssetRedirect(isDefiMode, hasCustomStartingStep, isOsti
|
|
|
21252
21266
|
if (isDefiMode || hasCustomStartingStep || isOstiumCustomer2) {
|
|
21253
21267
|
return onNext({
|
|
21254
21268
|
chosenPaymentMethod: null,
|
|
21255
|
-
paymentMethodInfo
|
|
21256
|
-
startingStep: checkoutConfig?.startingStep
|
|
21269
|
+
paymentMethodInfo
|
|
21257
21270
|
});
|
|
21258
21271
|
}
|
|
21259
21272
|
return onNext({
|
|
@@ -21294,10 +21307,22 @@ function LoadingAccount({
|
|
|
21294
21307
|
});
|
|
21295
21308
|
const hasCustomStartingStep = !!checkoutConfig?.startingStep;
|
|
21296
21309
|
const startsOnConfirmationStep = checkoutConfig?.startingStep === "confirmation" /* CONFIRMATION */;
|
|
21310
|
+
const startsOnSelectAssetStep = checkoutConfig?.startingStep === "select_asset" /* SELECT_ASSET */;
|
|
21297
21311
|
useEffect38(() => {
|
|
21298
21312
|
if (isLoadingFlags || isLoadingFiat || !checkoutConfig) {
|
|
21299
21313
|
return;
|
|
21300
21314
|
}
|
|
21315
|
+
if (startsOnSelectAssetStep) {
|
|
21316
|
+
const paymentMethodInfo = createPaymentMethodInfo({
|
|
21317
|
+
paymentMethod: "balance" /* ACCOUNT_BALANCE */,
|
|
21318
|
+
walletAddress
|
|
21319
|
+
});
|
|
21320
|
+
updateSelectedPaymentMethodInfo(paymentMethodInfo);
|
|
21321
|
+
return onNext({
|
|
21322
|
+
chosenPaymentMethod: "balance" /* ACCOUNT_BALANCE */,
|
|
21323
|
+
paymentMethodInfo
|
|
21324
|
+
});
|
|
21325
|
+
}
|
|
21301
21326
|
if (!startsOnConfirmationStep) {
|
|
21302
21327
|
return onNext({ chosenPaymentMethod: null });
|
|
21303
21328
|
}
|
|
@@ -21309,8 +21334,7 @@ function LoadingAccount({
|
|
|
21309
21334
|
isOstiumCustomer(apiKey),
|
|
21310
21335
|
walletAddress,
|
|
21311
21336
|
updateSelectedPaymentMethodInfo,
|
|
21312
|
-
onNext
|
|
21313
|
-
checkoutConfig
|
|
21337
|
+
onNext
|
|
21314
21338
|
);
|
|
21315
21339
|
}
|
|
21316
21340
|
if (isFetchingAssets) {
|
|
@@ -21328,6 +21352,7 @@ function LoadingAccount({
|
|
|
21328
21352
|
}, [
|
|
21329
21353
|
hasCustomStartingStep,
|
|
21330
21354
|
startsOnConfirmationStep,
|
|
21355
|
+
startsOnSelectAssetStep,
|
|
21331
21356
|
isDefiMode,
|
|
21332
21357
|
isLoadingFlags,
|
|
21333
21358
|
isLoadingFiat,
|
|
@@ -21654,11 +21679,7 @@ function MoonpaySetup({
|
|
|
21654
21679
|
|
|
21655
21680
|
// src/modals/CheckoutModal/SelectAsset.tsx
|
|
21656
21681
|
import { FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST as FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST2 } from "@funkit/chains";
|
|
21657
|
-
import {
|
|
21658
|
-
FlagKey as FlagKey27,
|
|
21659
|
-
formatCurrencyAndStringify as formatCurrencyAndStringify12,
|
|
21660
|
-
isTokenEquivalent as isTokenEquivalent6
|
|
21661
|
-
} from "@funkit/utils";
|
|
21682
|
+
import { formatCurrencyAndStringify as formatCurrencyAndStringify12, isTokenEquivalent as isTokenEquivalent6 } from "@funkit/utils";
|
|
21662
21683
|
import React174, { useEffect as useEffect40, useMemo as useMemo27, useState as useState45 } from "react";
|
|
21663
21684
|
import { createPortal as createPortal11 } from "react-dom";
|
|
21664
21685
|
|
|
@@ -21755,13 +21776,13 @@ var ReceiveTokenDropdown = ({
|
|
|
21755
21776
|
|
|
21756
21777
|
// src/components/NewTokenDepositAlert/NewTokenDepositAlert.tsx
|
|
21757
21778
|
import React173 from "react";
|
|
21758
|
-
import { FlagKey as
|
|
21779
|
+
import { FlagKey as FlagKey25, safeParseJson as safeParseJson5 } from "@funkit/utils";
|
|
21759
21780
|
var NewTokenDepositAlert = ({
|
|
21760
21781
|
onClick
|
|
21761
21782
|
}) => {
|
|
21762
|
-
const alertJson = useFlag(
|
|
21783
|
+
const alertJson = useFlag(FlagKey25.NewTokenAssetSelectionBanner);
|
|
21763
21784
|
const alertData = safeParseJson5(alertJson);
|
|
21764
|
-
const isTokenTransferEnabled = useFlag(
|
|
21785
|
+
const isTokenTransferEnabled = useFlag(FlagKey25.EnableTokenTransfer);
|
|
21765
21786
|
if (!alertData || !isTokenTransferEnabled) {
|
|
21766
21787
|
return null;
|
|
21767
21788
|
}
|
|
@@ -21788,12 +21809,12 @@ var NewTokenDepositAlert = ({
|
|
|
21788
21809
|
|
|
21789
21810
|
// src/hooks/useAllowedAssets.ts
|
|
21790
21811
|
import { getAllowedAssets } from "@funkit/api-base";
|
|
21791
|
-
import { useQuery as
|
|
21812
|
+
import { useQuery as useQuery16 } from "@tanstack/react-query";
|
|
21792
21813
|
import { useCallback as useCallback30, useMemo as useMemo26 } from "react";
|
|
21793
21814
|
function useAllowedAssets() {
|
|
21794
21815
|
const { apiKey } = useFunkitConfig();
|
|
21795
21816
|
const isRelayEnabled = useSourceTokenRelayEnabled();
|
|
21796
|
-
const { data: allowedAssets, isLoading } =
|
|
21817
|
+
const { data: allowedAssets, isLoading } = useQuery16({
|
|
21797
21818
|
queryKey: ["getAllowedAssets", apiKey],
|
|
21798
21819
|
queryFn: () => getAllowedAssets({ apiKey, logger }),
|
|
21799
21820
|
refetchOnMount: false,
|
|
@@ -22250,9 +22271,9 @@ var SelectAssetInfoSection = ({
|
|
|
22250
22271
|
totalBalance,
|
|
22251
22272
|
paymentMethodInfo,
|
|
22252
22273
|
onSelectSource,
|
|
22253
|
-
onTokenTransfer
|
|
22274
|
+
onTokenTransfer,
|
|
22275
|
+
isSourceNavWidgetEnabled
|
|
22254
22276
|
}) => {
|
|
22255
|
-
const isSourceNavWidgetEnabled = useFlag(FlagKey27.EnableSourceNavigationWidget);
|
|
22256
22277
|
const { checkoutItem } = useCheckoutContext();
|
|
22257
22278
|
const label = usePaymentMethodInfoLabel(paymentMethodInfo, 16);
|
|
22258
22279
|
const isDefiMode = checkoutItem?.initSettings.config.isDefiMode;
|
|
@@ -22276,7 +22297,8 @@ function SelectWalletAsset({
|
|
|
22276
22297
|
onFinish,
|
|
22277
22298
|
onSelectSource,
|
|
22278
22299
|
onTokenTransfer,
|
|
22279
|
-
onClose
|
|
22300
|
+
onClose,
|
|
22301
|
+
isSourceNavWidgetEnabled
|
|
22280
22302
|
}) {
|
|
22281
22303
|
const { data, isLoading, totalBalance } = useWalletAssetHoldings(targetChainId);
|
|
22282
22304
|
return /* @__PURE__ */ React174.createElement(React174.Fragment, null, /* @__PURE__ */ React174.createElement(
|
|
@@ -22285,7 +22307,8 @@ function SelectWalletAsset({
|
|
|
22285
22307
|
paymentMethodInfo,
|
|
22286
22308
|
totalBalance,
|
|
22287
22309
|
onTokenTransfer,
|
|
22288
|
-
onSelectSource
|
|
22310
|
+
onSelectSource,
|
|
22311
|
+
isSourceNavWidgetEnabled
|
|
22289
22312
|
}
|
|
22290
22313
|
), /* @__PURE__ */ React174.createElement(
|
|
22291
22314
|
MeshOrAccountSelectAsset,
|
|
@@ -22319,7 +22342,8 @@ function SelectAsset({
|
|
|
22319
22342
|
onFinish: handleFinish,
|
|
22320
22343
|
onSelectSource: handleSelectSource,
|
|
22321
22344
|
onTokenTransfer: handleTokenTransfer,
|
|
22322
|
-
onClose
|
|
22345
|
+
onClose,
|
|
22346
|
+
isSourceNavWidgetEnabled: modalState.startingStep === "select_asset" /* SELECT_ASSET */
|
|
22323
22347
|
}
|
|
22324
22348
|
) : /* @__PURE__ */ React174.createElement(React174.Fragment, null));
|
|
22325
22349
|
}
|
|
@@ -22351,7 +22375,7 @@ var DefiPurchaseSection = ({ config }) => {
|
|
|
22351
22375
|
|
|
22352
22376
|
// src/modals/CheckoutModal/SourceChange/useUpdateSourceAssetForCard.ts
|
|
22353
22377
|
import {
|
|
22354
|
-
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
22378
|
+
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO15,
|
|
22355
22379
|
dydxChain as dydxChain3,
|
|
22356
22380
|
katanaChain
|
|
22357
22381
|
} from "@funkit/chains";
|
|
@@ -22377,7 +22401,7 @@ var pickSourceAssetForCard = async (checkoutItem, userIpInfo) => {
|
|
|
22377
22401
|
const wethAddrOnTargetChain = (await getTokenAddressBySymbolAndChainId2("weth", moonpayChainId)).toLowerCase();
|
|
22378
22402
|
const isTargetAssetEthOrWeth = [NATIVE_TOKEN, wethAddrOnTargetChain].includes(
|
|
22379
22403
|
checkoutItem.initSettings.config.targetAsset
|
|
22380
|
-
) &&
|
|
22404
|
+
) && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO15[moonpayChainId]?.nativeCurrency.symbol === "ETH" /* ETH */;
|
|
22381
22405
|
let sourceTokenAddress;
|
|
22382
22406
|
let sourceTokenTicker;
|
|
22383
22407
|
let sourceTokenChainId;
|
|
@@ -22720,7 +22744,6 @@ function SourceChange({
|
|
|
22720
22744
|
}
|
|
22721
22745
|
|
|
22722
22746
|
// src/modals/CheckoutModal/TransferToken/TransferToken.tsx
|
|
22723
|
-
import { FlagKey as FlagKey29 } from "@funkit/utils";
|
|
22724
22747
|
import { motion as motion9, useAnimationControls as useAnimationControls3 } from "motion/react";
|
|
22725
22748
|
import React188, { useRef as useRef17, useState as useState51 } from "react";
|
|
22726
22749
|
import { createPortal as createPortal13 } from "react-dom";
|
|
@@ -23406,13 +23429,13 @@ var TransferTokenDetails = ({
|
|
|
23406
23429
|
|
|
23407
23430
|
// src/hooks/useTokenTransfer.ts
|
|
23408
23431
|
import { solanaChain as solanaChain4 } from "@funkit/chains";
|
|
23409
|
-
import { FlagKey as
|
|
23432
|
+
import { FlagKey as FlagKey26 } from "@funkit/utils";
|
|
23410
23433
|
import { useMemo as useMemo29 } from "react";
|
|
23411
23434
|
import { mainnet as mainnet8, polygon as polygon7 } from "viem/chains";
|
|
23412
23435
|
var useTokenTransfer = (selectedChainId, selectedToken, chainIds) => {
|
|
23413
23436
|
const { checkoutItem } = useCheckoutContext();
|
|
23414
23437
|
const enableUniversal = useFlag(
|
|
23415
|
-
|
|
23438
|
+
FlagKey26.EnableTokenTransferUniversalDepositAddress,
|
|
23416
23439
|
false
|
|
23417
23440
|
);
|
|
23418
23441
|
const estPriceImpact = usePriceImpactEstimation(selectedToken);
|
|
@@ -23446,7 +23469,7 @@ var useTokenTransfer = (selectedChainId, selectedToken, chainIds) => {
|
|
|
23446
23469
|
};
|
|
23447
23470
|
var useMinTransferLimits = () => {
|
|
23448
23471
|
const { userIpInfo } = useFunkitUserIp();
|
|
23449
|
-
const minTransferValueJsonString = useFlag(
|
|
23472
|
+
const minTransferValueJsonString = useFlag(FlagKey26.MinTokenTransferValue);
|
|
23450
23473
|
const minTransferValue = safeJSONParse(
|
|
23451
23474
|
minTransferValueJsonString
|
|
23452
23475
|
);
|
|
@@ -23526,7 +23549,7 @@ function TransferToken({
|
|
|
23526
23549
|
}) {
|
|
23527
23550
|
const controls = useAnimationControls3();
|
|
23528
23551
|
const [qrCodeHover, setQrCodeHover] = useState51(false);
|
|
23529
|
-
const isSourceNavWidgetEnabled =
|
|
23552
|
+
const isSourceNavWidgetEnabled = modalState.startingStep === "select_asset" /* SELECT_ASSET */;
|
|
23530
23553
|
const { textCustomizations } = useFunkitConfig();
|
|
23531
23554
|
const { checkoutItem } = useCheckoutContext();
|
|
23532
23555
|
const checkoutConfig = checkoutItem?.initSettings.config;
|
|
@@ -23768,7 +23791,6 @@ function TransferToken({
|
|
|
23768
23791
|
}
|
|
23769
23792
|
|
|
23770
23793
|
// src/modals/CheckoutModal/VirtualFiatAccount/FiatAccountDetail.tsx
|
|
23771
|
-
import { FlagKey as FlagKey30 } from "@funkit/utils";
|
|
23772
23794
|
import React194, { useState as useState52 } from "react";
|
|
23773
23795
|
|
|
23774
23796
|
// src/components/Tabs/Tabs.tsx
|
|
@@ -24053,7 +24075,7 @@ var AccountDetailsScreen = ({
|
|
|
24053
24075
|
const label = usePaymentMethodInfoLabel(paymentMethodInfo);
|
|
24054
24076
|
const { appName } = useFunkitConfig();
|
|
24055
24077
|
const { animation, animate } = useAnimatedNavigation(void 0);
|
|
24056
|
-
const isSourceNavWidgetEnabled =
|
|
24078
|
+
const isSourceNavWidgetEnabled = modalState.startingStep === "select_asset" /* SELECT_ASSET */;
|
|
24057
24079
|
const [activeTab, setActiveTab] = useState52(0);
|
|
24058
24080
|
const [detailsExpanded, setDetailsExpanded] = useState52(false);
|
|
24059
24081
|
const { source_deposit_instructions: sourceDeposit } = matchingFiatAccount;
|
|
@@ -24287,7 +24309,8 @@ function extractCommonState(state) {
|
|
|
24287
24309
|
checkoutId: state.checkoutId,
|
|
24288
24310
|
targetChainId: state.targetChainId,
|
|
24289
24311
|
isSoftHidden: state.isSoftHidden,
|
|
24290
|
-
isDefiMode: state.isDefiMode
|
|
24312
|
+
isDefiMode: state.isDefiMode,
|
|
24313
|
+
startingStep: state.startingStep
|
|
24291
24314
|
};
|
|
24292
24315
|
}
|
|
24293
24316
|
var CheckoutModalSteps = {
|
|
@@ -24325,7 +24348,8 @@ function initialState(checkoutItem) {
|
|
|
24325
24348
|
checkoutId: checkoutItem.id,
|
|
24326
24349
|
targetChainId: checkoutItem.initSettings.config.targetChain,
|
|
24327
24350
|
isSoftHidden: false,
|
|
24328
|
-
isDefiMode: !!checkoutItem.initSettings.config.isDefiMode
|
|
24351
|
+
isDefiMode: !!checkoutItem.initSettings.config.isDefiMode,
|
|
24352
|
+
startingStep: checkoutItem.initSettings.config.startingStep || "source_change" /* SOURCE_CHANGE */
|
|
24329
24353
|
};
|
|
24330
24354
|
}
|
|
24331
24355
|
function useCheckoutModalTransition(checkoutItem, onClose) {
|
|
@@ -24432,7 +24456,7 @@ function useCheckoutModalTransition(checkoutItem, onClose) {
|
|
|
24432
24456
|
}
|
|
24433
24457
|
function useTitleConfig(checkoutItem, state) {
|
|
24434
24458
|
const { apiKey, textCustomizations } = useFunkitConfig();
|
|
24435
|
-
const isSourceNavWidgetEnabled =
|
|
24459
|
+
const isSourceNavWidgetEnabled = state.startingStep === "select_asset" /* SELECT_ASSET */;
|
|
24436
24460
|
const {
|
|
24437
24461
|
showFullHeight,
|
|
24438
24462
|
disableBack = () => false,
|
|
@@ -24462,6 +24486,10 @@ var mapHeightToCheckoutStep = {
|
|
|
24462
24486
|
["confirmation" /* CONFIRMATION */]: 825,
|
|
24463
24487
|
["checkout_complete" /* CHECKOUT_COMPLETE */]: 825
|
|
24464
24488
|
};
|
|
24489
|
+
function getPermittedHeight(checkoutStep) {
|
|
24490
|
+
const heightOffset = 2;
|
|
24491
|
+
return (checkoutStep ? mapHeightToCheckoutStep[checkoutStep] ?? DEFAULT_HEIGHT : DEFAULT_HEIGHT) - heightOffset;
|
|
24492
|
+
}
|
|
24465
24493
|
function FunCheckoutModalHeightAnimationWrapper({
|
|
24466
24494
|
children,
|
|
24467
24495
|
checkoutStep
|
|
@@ -24475,7 +24503,7 @@ function FunCheckoutModalHeightAnimationWrapper({
|
|
|
24475
24503
|
resizeObserverRef.current = new ResizeObserver((entries) => {
|
|
24476
24504
|
animationFrameRef.current = requestAnimationFrame(() => {
|
|
24477
24505
|
const requestedHeight = entries[0].contentRect.height;
|
|
24478
|
-
const permittedHeight2 = checkoutStep
|
|
24506
|
+
const permittedHeight2 = getPermittedHeight(checkoutStep);
|
|
24479
24507
|
setHeight(
|
|
24480
24508
|
requestedHeight > permittedHeight2 ? permittedHeight2 : requestedHeight
|
|
24481
24509
|
);
|
|
@@ -24490,7 +24518,7 @@ function FunCheckoutModalHeightAnimationWrapper({
|
|
|
24490
24518
|
};
|
|
24491
24519
|
}
|
|
24492
24520
|
}, [checkoutStep]);
|
|
24493
|
-
const permittedHeight = checkoutStep
|
|
24521
|
+
const permittedHeight = getPermittedHeight(checkoutStep);
|
|
24494
24522
|
return /* @__PURE__ */ React196.createElement(
|
|
24495
24523
|
motion11.div,
|
|
24496
24524
|
{
|
|
@@ -28013,7 +28041,7 @@ function ChainModal({ onClose, open }) {
|
|
|
28013
28041
|
// src/modals/CheckoutModal/FunCheckoutModal.tsx
|
|
28014
28042
|
import { FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST as FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST3 } from "@funkit/chains";
|
|
28015
28043
|
import { LogLevel, initializeRelayClient } from "@funkit/fun-relay";
|
|
28016
|
-
import { FlagKey as
|
|
28044
|
+
import { FlagKey as FlagKey28 } from "@funkit/utils";
|
|
28017
28045
|
import React247, { useRef as useRef26 } from "react";
|
|
28018
28046
|
|
|
28019
28047
|
// src/components/FunCheckoutBlocked/FunCheckoutBlocked.tsx
|
|
@@ -28082,13 +28110,13 @@ var FunNotificationShowMoreButton = ({
|
|
|
28082
28110
|
import {
|
|
28083
28111
|
getCheckoutsByUserId as getCheckoutsByUserId2
|
|
28084
28112
|
} from "@funkit/api-base";
|
|
28085
|
-
import { FlagKey as
|
|
28086
|
-
import { useQuery as
|
|
28113
|
+
import { FlagKey as FlagKey27 } from "@funkit/utils";
|
|
28114
|
+
import { useQuery as useQuery17 } from "@tanstack/react-query";
|
|
28087
28115
|
var hasCorrectPaymentMethod = (checkout, paymentMethod) => !paymentMethod || checkout.clientMetadata.selectedPaymentMethodInfo?.paymentMethod === paymentMethod;
|
|
28088
28116
|
var isRecent = (checkout, timestampCutoff) => checkout.createdTimeMs > timestampCutoff;
|
|
28089
28117
|
var DEFAULT_NOTIF_CUTOFF = 7 * 24 * 60 * 60 * 1e3;
|
|
28090
28118
|
function useCheckoutRefreshInterval() {
|
|
28091
|
-
const str = useFlag(
|
|
28119
|
+
const str = useFlag(FlagKey27.CheckoutNotificationsRefreshInterval);
|
|
28092
28120
|
return safeJSONParse(str) || { listRefresh: 50 * 1e3, itemRefresh: 5 * 1e3 };
|
|
28093
28121
|
}
|
|
28094
28122
|
var useRecentCheckouts = ({
|
|
@@ -28098,7 +28126,7 @@ var useRecentCheckouts = ({
|
|
|
28098
28126
|
const { isUserLoggedIn, userInfo } = useGeneralWallet();
|
|
28099
28127
|
const { apiKey } = useFunkitConfig();
|
|
28100
28128
|
const { listRefresh } = useCheckoutRefreshInterval();
|
|
28101
|
-
const query =
|
|
28129
|
+
const query = useQuery17({
|
|
28102
28130
|
queryKey: ["checkouts", userInfo.id],
|
|
28103
28131
|
queryFn: async () => {
|
|
28104
28132
|
const checkouts = await getCheckoutsByUserId2({
|
|
@@ -28121,7 +28149,7 @@ var useRecentCheckouts = ({
|
|
|
28121
28149
|
import {
|
|
28122
28150
|
getDirectExecutionsByUserId as getDirectExecutionsByUserId2
|
|
28123
28151
|
} from "@funkit/api-base";
|
|
28124
|
-
import { useQuery as
|
|
28152
|
+
import { useQuery as useQuery18 } from "@tanstack/react-query";
|
|
28125
28153
|
var isRecent2 = (de, timestampCutoff) => de.createdTimeMs > timestampCutoff;
|
|
28126
28154
|
var useRecentDirectExecutions = ({
|
|
28127
28155
|
isVisible
|
|
@@ -28129,7 +28157,7 @@ var useRecentDirectExecutions = ({
|
|
|
28129
28157
|
const { isUserLoggedIn, userInfo } = useGeneralWallet();
|
|
28130
28158
|
const { apiKey } = useFunkitConfig();
|
|
28131
28159
|
const { listRefresh } = useCheckoutRefreshInterval();
|
|
28132
|
-
const query =
|
|
28160
|
+
const query = useQuery18({
|
|
28133
28161
|
queryKey: ["directExecutions", userInfo.id],
|
|
28134
28162
|
queryFn: async () => {
|
|
28135
28163
|
const directExecutions = await getDirectExecutionsByUserId2({
|
|
@@ -28842,11 +28870,11 @@ var FunNotificationBanner = ({
|
|
|
28842
28870
|
import {
|
|
28843
28871
|
getCheckoutByDepositAddress as getCheckoutByDepositAddress2
|
|
28844
28872
|
} from "@funkit/api-base";
|
|
28845
|
-
import { useQuery as
|
|
28873
|
+
import { useQuery as useQuery19 } from "@tanstack/react-query";
|
|
28846
28874
|
var useCheckout = (depositAddress, initial) => {
|
|
28847
28875
|
const { apiKey } = useFunkitConfig();
|
|
28848
28876
|
const { itemRefresh } = useCheckoutRefreshInterval();
|
|
28849
|
-
const query =
|
|
28877
|
+
const query = useQuery19({
|
|
28850
28878
|
queryKey: ["checkouts", "checkout", depositAddress],
|
|
28851
28879
|
queryFn: () => (
|
|
28852
28880
|
// biome-ignore lint/style/noNonNullAssertion: already checked for null
|
|
@@ -29256,7 +29284,7 @@ function FunCheckoutModalInner({
|
|
|
29256
29284
|
const isBlocked = isUserGeoblocked || modalState.isBlocked;
|
|
29257
29285
|
const hasBack = hasHistoryEntry && !disableBack;
|
|
29258
29286
|
const checkoutConfig = checkoutItem.initSettings.config;
|
|
29259
|
-
const helpButtonUrl = useFlag(
|
|
29287
|
+
const helpButtonUrl = useFlag(FlagKey28.HelpTutorialUrl);
|
|
29260
29288
|
const { onScroll, topbar, withTopDivider } = useCustomStatusAnimationAboveTopbar({
|
|
29261
29289
|
depositAddress: checkoutItem.depositAddress ?? void 0,
|
|
29262
29290
|
isCheckoutDetailView: modalState.step === "checkout_complete" /* CHECKOUT_COMPLETE */,
|
|
@@ -31148,18 +31176,18 @@ function cssStringFromTheme(theme, options = {}) {
|
|
|
31148
31176
|
}
|
|
31149
31177
|
|
|
31150
31178
|
// src/hooks/useIsFunkitCheckoutActivated.ts
|
|
31151
|
-
import { FlagKey as
|
|
31179
|
+
import { FlagKey as FlagKey29 } from "@funkit/utils";
|
|
31152
31180
|
var useIsFunkitCheckoutActivated = () => {
|
|
31153
|
-
const isCheckoutActivated = useFlag(
|
|
31181
|
+
const isCheckoutActivated = useFlag(FlagKey29.IsCheckoutActivated);
|
|
31154
31182
|
return {
|
|
31155
31183
|
isActivated: isCheckoutActivated
|
|
31156
31184
|
};
|
|
31157
31185
|
};
|
|
31158
31186
|
|
|
31159
31187
|
// src/hooks/useFunkitMaxCheckoutUsdInfo.ts
|
|
31160
|
-
import { FlagKey as
|
|
31188
|
+
import { FlagKey as FlagKey30, formatCurrencyAndStringify as formatCurrencyAndStringify17 } from "@funkit/utils";
|
|
31161
31189
|
var useFunkitMaxCheckoutUsdInfo = () => {
|
|
31162
|
-
const maxCheckoutUsd = Number(useFlag(
|
|
31190
|
+
const maxCheckoutUsd = Number(useFlag(FlagKey30.MaxCheckoutUsd));
|
|
31163
31191
|
const limitText = maxCheckoutUsd === Number.MAX_VALUE ? "no" : formatCurrencyAndStringify17(maxCheckoutUsd, {
|
|
31164
31192
|
decimalPrecisionForSuffix: 0,
|
|
31165
31193
|
minimumSignificantDigits: 0,
|
|
@@ -31276,7 +31304,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
31276
31304
|
localStorage.setItem(storageKey5, version);
|
|
31277
31305
|
}
|
|
31278
31306
|
function getCurrentSdkVersion() {
|
|
31279
|
-
return "6.0.
|
|
31307
|
+
return "6.0.4";
|
|
31280
31308
|
}
|
|
31281
31309
|
function useFingerprint() {
|
|
31282
31310
|
const fingerprint = useCallback50(() => {
|