@funkit/connect 10.1.1 → 10.2.1
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 +35 -0
- package/dist/clients/lighter.js +16 -5
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +2 -2
- package/dist/clients/polymarket/index.js +5 -5
- package/dist/index.js +170 -108
- package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +7 -2
- package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +15 -0
- package/dist/utils/customer.d.ts +32 -0
- 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 +53 -53
- 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 +4 -11
- package/dist/utils/swappedRouteOverride.d.ts +0 -27
- package/dist/clients/{chunk-QR64CUND.js → chunk-ZAXSDMDU.js} +4 -4
- package/dist/wallets/walletConnectors/{chunk-W2LCLDPX.js → chunk-2VP2F6EK.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-IULPZP2Q.js → chunk-4T6ZSRJF.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-WAHGI5L7.js → chunk-6BW3HLBG.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YO2K4MBH.js → chunk-CCQV2ZET.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-TKB2OY6G.js → chunk-CPI4TD43.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-OX37G4YT.js → chunk-F5XEEVG6.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-JPN6TWIT.js → chunk-HNRB7KJU.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-WKNQMP4A.js → chunk-HTHAK6XB.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-GUQM4QSL.js → chunk-MIQTHJ6X.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-4NV5BYRP.js → chunk-RB3HR4R2.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-SWFF3TWJ.js → chunk-RVOY537T.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-KI5Y2BBF.js → chunk-STVVP43G.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-OEEGYENV.js → chunk-UK7C2JXW.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YQFGVZGR.js → chunk-VAPGUPHO.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-XCNHV3HS.js → chunk-VTM6EECM.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-NR2OGDHQ.js → chunk-X6CGV36L.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-AVDUNQUW.js → chunk-YEZM4CK4.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-KCRO2AGO.js → chunk-ZNX4EMPB.js} +3 -3
package/dist/index.js
CHANGED
|
@@ -973,12 +973,12 @@ import { arbitrum as arbitrum6, polygon as polygon7 } from "viem/chains";
|
|
|
973
973
|
|
|
974
974
|
// src/domains/asset.ts
|
|
975
975
|
import {
|
|
976
|
-
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
976
|
+
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12,
|
|
977
977
|
hyperEvmChain as hyperEvmChain4,
|
|
978
978
|
monadChain as monadChain2,
|
|
979
979
|
solanaChain as solanaChain6
|
|
980
980
|
} from "@funkit/chains";
|
|
981
|
-
import { isEVMAddressEquivalent as isEVMAddressEquivalent7, isTokenEquivalent as
|
|
981
|
+
import { isEVMAddressEquivalent as isEVMAddressEquivalent7, isTokenEquivalent as isTokenEquivalent14 } from "@funkit/utils";
|
|
982
982
|
import { arbitrum as arbitrum5, base as base5, bsc, mainnet as mainnet12, optimism as optimism2, polygon as polygon6 } from "viem/chains";
|
|
983
983
|
|
|
984
984
|
// src/utils/checkout.ts
|
|
@@ -989,7 +989,7 @@ import {
|
|
|
989
989
|
} from "@funkit/connect-core";
|
|
990
990
|
import {
|
|
991
991
|
FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS5,
|
|
992
|
-
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
992
|
+
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO11,
|
|
993
993
|
lightningChain as lightningChain7,
|
|
994
994
|
solanaChain as solanaChain5,
|
|
995
995
|
tronChain as tronChain4
|
|
@@ -1063,7 +1063,7 @@ import {
|
|
|
1063
1063
|
initializeCheckout as postApiInitializeCheckout
|
|
1064
1064
|
} from "@funkit/api-base";
|
|
1065
1065
|
import {
|
|
1066
|
-
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
1066
|
+
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO10,
|
|
1067
1067
|
SOLANA_MAINNET_CHAIN_ID as SOLANA_MAINNET_CHAIN_ID2
|
|
1068
1068
|
} from "@funkit/chains";
|
|
1069
1069
|
import { isNotNullish as isNotNullish8, isEVMAddressEquivalent as isEVMAddressEquivalent5 } from "@funkit/utils";
|
|
@@ -1687,7 +1687,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
1687
1687
|
localStorage.setItem(storageKey, version);
|
|
1688
1688
|
}
|
|
1689
1689
|
function getCurrentSdkVersion() {
|
|
1690
|
-
return "10.
|
|
1690
|
+
return "10.2.1";
|
|
1691
1691
|
}
|
|
1692
1692
|
function useFingerprint() {
|
|
1693
1693
|
const fingerprint = useCallback3(() => {
|
|
@@ -1834,7 +1834,10 @@ var useTrack = () => {
|
|
|
1834
1834
|
custom: {
|
|
1835
1835
|
name: userInfo.name,
|
|
1836
1836
|
type: userInfo.type,
|
|
1837
|
-
isMobile: isMobile()
|
|
1837
|
+
isMobile: isMobile(),
|
|
1838
|
+
// Pairs with connect-rn's `sdkType: 'react-native'` so a shared config
|
|
1839
|
+
// can be scoped per-SDK via a Statsig targeting rule.
|
|
1840
|
+
sdkType: "web"
|
|
1838
1841
|
}
|
|
1839
1842
|
};
|
|
1840
1843
|
return updateStatsigUserAsync(statsigUser2);
|
|
@@ -2035,6 +2038,30 @@ function useFunkitConfig() {
|
|
|
2035
2038
|
|
|
2036
2039
|
// src/utils/customer.ts
|
|
2037
2040
|
var LIGHTER_MAIN_ACCOUNT_TYPE = 0;
|
|
2041
|
+
var LIGHTER_TRADING_MODE = {
|
|
2042
|
+
SIMPLE: 0,
|
|
2043
|
+
UNIFIED: 1
|
|
2044
|
+
};
|
|
2045
|
+
var LIGHTER_USDC_SPOT_ROUTING_IDS = /* @__PURE__ */ new Set([
|
|
2046
|
+
"LIGHTER_USDC_SPOT",
|
|
2047
|
+
"LIGHTER_USDC_SPOT_NEW_USER"
|
|
2048
|
+
]);
|
|
2049
|
+
var LIGHTER_USDC_SPOT_CANDIDATE_SYMBOL = "USDC (SPOT)";
|
|
2050
|
+
function stripLighterPerpsSuffix(symbol) {
|
|
2051
|
+
return symbol?.replace(/\s*\(perps\)\s*$/i, "");
|
|
2052
|
+
}
|
|
2053
|
+
function isLighterUsdcSpotCandidate(candidate) {
|
|
2054
|
+
if (candidate.dynamicRoutingId) {
|
|
2055
|
+
return LIGHTER_USDC_SPOT_ROUTING_IDS.has(candidate.dynamicRoutingId);
|
|
2056
|
+
}
|
|
2057
|
+
return candidate.tokenSymbol.toUpperCase() === LIGHTER_USDC_SPOT_CANDIDATE_SYMBOL;
|
|
2058
|
+
}
|
|
2059
|
+
function adaptLighterTargetAssetsForUnifiedAccount(candidates) {
|
|
2060
|
+
return candidates.filter((candidate) => !isLighterUsdcSpotCandidate(candidate)).map((candidate) => ({
|
|
2061
|
+
...candidate,
|
|
2062
|
+
tokenSymbol: stripLighterPerpsSuffix(candidate.tokenSymbol)
|
|
2063
|
+
}));
|
|
2064
|
+
}
|
|
2038
2065
|
async function getLighterAccountsByL1Address(address) {
|
|
2039
2066
|
const response = await fetch(
|
|
2040
2067
|
`https://mainnet.zklighter.elliot.ai/api/v1/accountsByL1Address?l1_address=${address}`
|
|
@@ -2107,6 +2134,9 @@ function useLighterAccounts({
|
|
|
2107
2134
|
return {
|
|
2108
2135
|
...query,
|
|
2109
2136
|
mainAccountIndex: mainAccount?.index?.toString(),
|
|
2137
|
+
// False until the accounts load — consumers fall back to the simple-mode
|
|
2138
|
+
// UI (both USDC variants shown) while the trading mode is unknown.
|
|
2139
|
+
isUnifiedTradingMode: mainAccount?.account_trading_mode === LIGHTER_TRADING_MODE.UNIFIED,
|
|
2110
2140
|
subAccounts
|
|
2111
2141
|
};
|
|
2112
2142
|
}
|
|
@@ -2124,6 +2154,7 @@ import { useEffect as useEffect9, useState as useState9 } from "react";
|
|
|
2124
2154
|
// src/hooks/queries/useFops.ts
|
|
2125
2155
|
import {
|
|
2126
2156
|
FormOfPaymentType as FormOfPaymentType2,
|
|
2157
|
+
RailConfigType,
|
|
2127
2158
|
getFops
|
|
2128
2159
|
} from "@funkit/api-base";
|
|
2129
2160
|
import { solanaChain as solanaChain2 } from "@funkit/chains";
|
|
@@ -4451,7 +4482,8 @@ var useFops = () => {
|
|
|
4451
4482
|
transferInit
|
|
4452
4483
|
);
|
|
4453
4484
|
const isValidRecipientAddress = !!recipientAddress && isAddressCompatibleWithChain(recipientAddress, Number(targetChain));
|
|
4454
|
-
const
|
|
4485
|
+
const countryCode = userIpInfo?.alpha2;
|
|
4486
|
+
const isEnabled = isSwappedEnabled && !comingSoon && !!apiKey && !!targetAsset && !!targetChain && !isSwappedCurrencyCodeLoading && isValidRecipientAddress && !!transferInit && !!countryCode;
|
|
4455
4487
|
const query = useQuery9({
|
|
4456
4488
|
// `prefillFiatEmail` is intentionally NOT in the queryKey: it's read inside
|
|
4457
4489
|
// `queryFn` and captured at fetch time, so post-mount changes don't trigger a refetch
|
|
@@ -4463,7 +4495,7 @@ var useFops = () => {
|
|
|
4463
4495
|
targetAsset,
|
|
4464
4496
|
targetChain,
|
|
4465
4497
|
swappedCurrencyCode,
|
|
4466
|
-
|
|
4498
|
+
countryCode,
|
|
4467
4499
|
apiKey,
|
|
4468
4500
|
themeConfig,
|
|
4469
4501
|
fopPriority,
|
|
@@ -4490,22 +4522,31 @@ var useFops = () => {
|
|
|
4490
4522
|
apiKey,
|
|
4491
4523
|
logger,
|
|
4492
4524
|
params: {
|
|
4525
|
+
// recipientAddress and destinationToken are required by the backend's
|
|
4526
|
+
// Zod schema but ignored when railConfigs is present — the
|
|
4527
|
+
// FIAT_TO_CRYPTO handler reads railConfigs[].recipientTargets.
|
|
4493
4528
|
recipientAddress,
|
|
4494
4529
|
userId,
|
|
4495
4530
|
destinationToken,
|
|
4496
4531
|
fiatCurrencyCode: swappedCurrencyCode,
|
|
4497
|
-
countryCode
|
|
4498
|
-
|
|
4499
|
-
{ recipientAddress, destinationToken },
|
|
4532
|
+
countryCode,
|
|
4533
|
+
railConfigs: [
|
|
4500
4534
|
{
|
|
4501
|
-
|
|
4502
|
-
|
|
4535
|
+
type: RailConfigType.FIAT_TO_CRYPTO,
|
|
4536
|
+
userId,
|
|
4537
|
+
countryCode,
|
|
4538
|
+
fiatCurrencyCode: swappedCurrencyCode,
|
|
4539
|
+
recipientTargets: [
|
|
4540
|
+
{ recipientAddress, destinationToken },
|
|
4541
|
+
{
|
|
4542
|
+
recipientAddress: transferInit.solanaAddr,
|
|
4543
|
+
destinationToken: secondaryDestinationToken
|
|
4544
|
+
}
|
|
4545
|
+
],
|
|
4546
|
+
thirdPartyPaymentConfigs,
|
|
4547
|
+
checkoutLimitsCriteria: { defaultMinAmount: defaultMinAmountEur }
|
|
4503
4548
|
}
|
|
4504
|
-
]
|
|
4505
|
-
thirdPartyPaymentConfigs,
|
|
4506
|
-
checkoutLimitsCriteria: {
|
|
4507
|
-
defaultMinAmount: defaultMinAmountEur
|
|
4508
|
-
}
|
|
4549
|
+
]
|
|
4509
4550
|
}
|
|
4510
4551
|
});
|
|
4511
4552
|
const validFopsData = validateFops(response, "useFops");
|
|
@@ -5291,12 +5332,27 @@ function useRelayBypass() {
|
|
|
5291
5332
|
// src/hooks/useCheckoutDirectExecution.ts
|
|
5292
5333
|
var getDirectExecutionQuoteNoop = () => Promise.resolve(null);
|
|
5293
5334
|
var executeDirectExecutionNoop = () => Promise.resolve(null);
|
|
5335
|
+
var EXPECTED_NO_WALLET_CLIENT_ERRORS = /* @__PURE__ */ new Set([
|
|
5336
|
+
"ConnectorNotConnectedError",
|
|
5337
|
+
"ConnectorUnavailableReconnectingError"
|
|
5338
|
+
]);
|
|
5339
|
+
async function getWalletClientSafe(config) {
|
|
5340
|
+
return await getWalletClient(config).catch((error) => {
|
|
5341
|
+
const name = error instanceof Error ? error.name : "";
|
|
5342
|
+
if (!EXPECTED_NO_WALLET_CLIENT_ERRORS.has(name)) {
|
|
5343
|
+
logger.warn("getWalletClientSafe:failed", {
|
|
5344
|
+
error: error instanceof Error ? error.message : String(error)
|
|
5345
|
+
});
|
|
5346
|
+
}
|
|
5347
|
+
return void 0;
|
|
5348
|
+
});
|
|
5349
|
+
}
|
|
5294
5350
|
function useCheckoutDirectExecution() {
|
|
5295
5351
|
const { t } = useFunkitTranslation();
|
|
5296
5352
|
const { address } = useFunkitUserInfo();
|
|
5297
5353
|
const { switchChainAsync } = useFunkitSwitchChains({});
|
|
5298
|
-
const { connector } =
|
|
5299
|
-
const
|
|
5354
|
+
const { connector } = useAccount();
|
|
5355
|
+
const wagmiConfig = useConfig();
|
|
5300
5356
|
const { getIsRelayEnabled } = useRelayBypass();
|
|
5301
5357
|
const { apiKey } = useFunkitConfig();
|
|
5302
5358
|
const getRelayDirectExecutionBaseQuote = useCallback12(
|
|
@@ -5377,7 +5433,7 @@ function useCheckoutDirectExecution() {
|
|
|
5377
5433
|
tokenAddress,
|
|
5378
5434
|
spenderAddress
|
|
5379
5435
|
}) => {
|
|
5380
|
-
const walletClient =
|
|
5436
|
+
const walletClient = await getWalletClientSafe(wagmiConfig);
|
|
5381
5437
|
if (!walletClient) {
|
|
5382
5438
|
throw new Error("Viem wallet client is not defined");
|
|
5383
5439
|
}
|
|
@@ -5394,7 +5450,7 @@ function useCheckoutDirectExecution() {
|
|
|
5394
5450
|
logger.info(`${logPrefix3}:success`, logData);
|
|
5395
5451
|
return txHash;
|
|
5396
5452
|
},
|
|
5397
|
-
[
|
|
5453
|
+
[wagmiConfig]
|
|
5398
5454
|
);
|
|
5399
5455
|
const checkAllowance = useCallback12(
|
|
5400
5456
|
async ({
|
|
@@ -5402,7 +5458,7 @@ function useCheckoutDirectExecution() {
|
|
|
5402
5458
|
ownerAddress,
|
|
5403
5459
|
spenderAddress
|
|
5404
5460
|
}) => {
|
|
5405
|
-
const walletClient =
|
|
5461
|
+
const walletClient = await getWalletClientSafe(wagmiConfig);
|
|
5406
5462
|
if (!walletClient) {
|
|
5407
5463
|
throw new Error("Viem wallet client is not defined");
|
|
5408
5464
|
}
|
|
@@ -5423,7 +5479,7 @@ function useCheckoutDirectExecution() {
|
|
|
5423
5479
|
logger.info(`${logPrefix3}:success`, logData);
|
|
5424
5480
|
return allowance;
|
|
5425
5481
|
},
|
|
5426
|
-
[
|
|
5482
|
+
[wagmiConfig]
|
|
5427
5483
|
);
|
|
5428
5484
|
const resetApprovalIfNeeded = useCallback12(
|
|
5429
5485
|
async (relayQuote) => {
|
|
@@ -5504,7 +5560,8 @@ function useCheckoutDirectExecution() {
|
|
|
5504
5560
|
checkoutItem.selectedSourceAssetInfo.chainId
|
|
5505
5561
|
);
|
|
5506
5562
|
logger.log(`${logPrefix3}:executionChainId`, { executionChainId });
|
|
5507
|
-
const
|
|
5563
|
+
const rawWalletClient = await getWalletClientSafe(wagmiConfig);
|
|
5564
|
+
const walletClient = rawWalletClient ? await disableAtomicBatchIfSupported(rawWalletClient, executionChainId) : void 0;
|
|
5508
5565
|
if (!walletClient && !withdrawalClient) {
|
|
5509
5566
|
throw new Error("Viem wallet client is not defined");
|
|
5510
5567
|
}
|
|
@@ -5660,7 +5717,7 @@ function useCheckoutDirectExecution() {
|
|
|
5660
5717
|
};
|
|
5661
5718
|
return await waitForConfirmation();
|
|
5662
5719
|
},
|
|
5663
|
-
[
|
|
5720
|
+
[wagmiConfig, checkAndSwitchChains, t, resetApprovalIfNeeded]
|
|
5664
5721
|
);
|
|
5665
5722
|
const getDirectExecutionInfo = useCallback12(
|
|
5666
5723
|
(checkoutItem) => {
|
|
@@ -9842,6 +9899,7 @@ var en_default = {
|
|
|
9842
9899
|
methodFast: "Fast",
|
|
9843
9900
|
methodSecure: "Native Bridge",
|
|
9844
9901
|
fastDisclaimer: "USDC Perps only \xB7 Multiple chains \xB7 Instant",
|
|
9902
|
+
fastDisclaimerUnified: "USDC only \xB7 Multiple chains \xB7 Instant",
|
|
9845
9903
|
secureDisclaimer: "All tokens \xB7 Ethereum chain only \xB7 {{delay}}",
|
|
9846
9904
|
secureFallbackDelay: "60+ minutes",
|
|
9847
9905
|
lighterSecureAddressTooltip: "You can only withdraw to your connected wallet",
|
|
@@ -10448,6 +10506,7 @@ var es_default = {
|
|
|
10448
10506
|
methodFast: "R\xE1pido",
|
|
10449
10507
|
methodSecure: "Puente Nativo",
|
|
10450
10508
|
fastDisclaimer: "Solo USDC Perps \xB7 M\xFAltiples cadenas \xB7 Instant\xE1neo",
|
|
10509
|
+
fastDisclaimerUnified: "Solo USDC \xB7 M\xFAltiples cadenas \xB7 Instant\xE1neo",
|
|
10451
10510
|
secureDisclaimer: "Todos los tokens \xB7 Solo cadena Ethereum \xB7 {{delay}}",
|
|
10452
10511
|
secureFallbackDelay: "60+ minutos",
|
|
10453
10512
|
lighterSecureAddressTooltip: "Solo puedes retirar a tu billetera conectada",
|
|
@@ -11051,6 +11110,7 @@ var fr_default = {
|
|
|
11051
11110
|
methodFast: "Rapide",
|
|
11052
11111
|
methodSecure: "Pont natif",
|
|
11053
11112
|
fastDisclaimer: "USDC Perps uniquement \xB7 Plusieurs cha\xEEnes \xB7 Instantan\xE9",
|
|
11113
|
+
fastDisclaimerUnified: "USDC uniquement \xB7 Plusieurs cha\xEEnes \xB7 Instantan\xE9",
|
|
11054
11114
|
secureDisclaimer: "Tous les tokens \xB7 Cha\xEEne Ethereum uniquement \xB7 {{delay}}",
|
|
11055
11115
|
secureFallbackDelay: "60+ minutes",
|
|
11056
11116
|
lighterSecureAddressTooltip: "Vous ne pouvez retirer que vers votre portefeuille connect\xE9",
|
|
@@ -11654,6 +11714,7 @@ var ja_default = {
|
|
|
11654
11714
|
methodFast: "\u9AD8\u901F",
|
|
11655
11715
|
methodSecure: "\u30CD\u30A4\u30C6\u30A3\u30D6\u30D6\u30EA\u30C3\u30B8",
|
|
11656
11716
|
fastDisclaimer: "USDC\u30D1\u30FC\u30D7\u30B9\u306E\u307F \xB7 \u8907\u6570\u30C1\u30A7\u30FC\u30F3 \xB7 \u5373\u6642",
|
|
11717
|
+
fastDisclaimerUnified: "USDC\u306E\u307F \xB7 \u8907\u6570\u30C1\u30A7\u30FC\u30F3 \xB7 \u5373\u6642",
|
|
11657
11718
|
secureDisclaimer: "\u5168\u30C8\u30FC\u30AF\u30F3 \xB7 \u30A4\u30FC\u30B5\u30EA\u30A2\u30E0\u30C1\u30A7\u30FC\u30F3\u306E\u307F \xB7 {{delay}}",
|
|
11658
11719
|
secureFallbackDelay: "60\u5206\u4EE5\u4E0A",
|
|
11659
11720
|
lighterSecureAddressTooltip: "\u63A5\u7D9A\u4E2D\u306E\u30A6\u30A9\u30EC\u30C3\u30C8\u306B\u306E\u307F\u51FA\u91D1\u3067\u304D\u307E\u3059",
|
|
@@ -12257,6 +12318,7 @@ var ko_default = {
|
|
|
12257
12318
|
methodFast: "\uBE60\uB978",
|
|
12258
12319
|
methodSecure: "\uB124\uC774\uD2F0\uBE0C \uBE0C\uB9AC\uC9C0",
|
|
12259
12320
|
fastDisclaimer: "USDC \uD37C\uD504\uC2A4\uB9CC \xB7 \uB2E4\uC911 \uCCB4\uC778 \xB7 \uC989\uC2DC",
|
|
12321
|
+
fastDisclaimerUnified: "USDC\uB9CC \xB7 \uB2E4\uC911 \uCCB4\uC778 \xB7 \uC989\uC2DC",
|
|
12260
12322
|
secureDisclaimer: "\uBAA8\uB4E0 \uD1A0\uD070 \xB7 \uC774\uB354\uB9AC\uC6C0 \uCCB4\uC778\uB9CC \xB7 {{delay}}",
|
|
12261
12323
|
secureFallbackDelay: "60\uBD84 \uC774\uC0C1",
|
|
12262
12324
|
lighterSecureAddressTooltip: "\uC5F0\uACB0\uB41C \uC9C0\uAC11\uC73C\uB85C\uB9CC \uCD9C\uAE08\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4",
|
|
@@ -12860,6 +12922,7 @@ var ru_default = {
|
|
|
12860
12922
|
methodFast: "\u0411\u044B\u0441\u0442\u0440\u044B\u0439",
|
|
12861
12923
|
methodSecure: "\u041D\u0430\u0442\u0438\u0432\u043D\u044B\u0439 \u043C\u043E\u0441\u0442",
|
|
12862
12924
|
fastDisclaimer: "\u0422\u043E\u043B\u044C\u043A\u043E USDC \u0431\u0435\u0441\u0441\u0440\u043E\u0447\u043D\u044B\u0435 \xB7 \u041D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0441\u0435\u0442\u0435\u0439 \xB7 \u041C\u0433\u043D\u043E\u0432\u0435\u043D\u043D\u043E",
|
|
12925
|
+
fastDisclaimerUnified: "\u0422\u043E\u043B\u044C\u043A\u043E USDC \xB7 \u041D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0441\u0435\u0442\u0435\u0439 \xB7 \u041C\u0433\u043D\u043E\u0432\u0435\u043D\u043D\u043E",
|
|
12863
12926
|
secureDisclaimer: "\u0412\u0441\u0435 \u0442\u043E\u043A\u0435\u043D\u044B \xB7 \u0422\u043E\u043B\u044C\u043A\u043E \u0441\u0435\u0442\u044C Ethereum \xB7 {{delay}}",
|
|
12864
12927
|
secureFallbackDelay: "60+ \u043C\u0438\u043D\u0443\u0442",
|
|
12865
12928
|
lighterSecureAddressTooltip: "\u0412\u044B\u0432\u043E\u0434 \u0432\u043E\u0437\u043C\u043E\u0436\u0435\u043D \u0442\u043E\u043B\u044C\u043A\u043E \u043D\u0430 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0451\u043D\u043D\u044B\u0439 \u043A\u043E\u0448\u0435\u043B\u0451\u043A",
|
|
@@ -13463,6 +13526,7 @@ var tr_default = {
|
|
|
13463
13526
|
methodFast: "H\u0131zl\u0131",
|
|
13464
13527
|
methodSecure: "Yerel K\xF6pr\xFC",
|
|
13465
13528
|
fastDisclaimer: "Yaln\u0131zca USDC Perps \xB7 Birden fazla zincir \xB7 An\u0131nda",
|
|
13529
|
+
fastDisclaimerUnified: "Yaln\u0131zca USDC \xB7 Birden fazla zincir \xB7 An\u0131nda",
|
|
13466
13530
|
secureDisclaimer: "T\xFCm tokenlar \xB7 Yaln\u0131zca Ethereum zinciri \xB7 {{delay}}",
|
|
13467
13531
|
secureFallbackDelay: "60+ dakika",
|
|
13468
13532
|
lighterSecureAddressTooltip: "Yaln\u0131zca ba\u011Fl\u0131 c\xFCzdan\u0131n\u0131za para \xE7ekebilirsiniz",
|
|
@@ -14066,6 +14130,7 @@ var zh_default = {
|
|
|
14066
14130
|
methodFast: "\u5FEB\u901F",
|
|
14067
14131
|
methodSecure: "\u539F\u751F\u8DE8\u94FE\u6865",
|
|
14068
14132
|
fastDisclaimer: "\u4EC5\u9650USDC\u6C38\u7EED \xB7 \u591A\u94FE \xB7 \u5373\u65F6",
|
|
14133
|
+
fastDisclaimerUnified: "\u4EC5\u9650USDC \xB7 \u591A\u94FE \xB7 \u5373\u65F6",
|
|
14069
14134
|
secureDisclaimer: "\u6240\u6709\u4EE3\u5E01 \xB7 \u4EC5\u4EE5\u592A\u574A\u94FE \xB7 {{delay}}",
|
|
14070
14135
|
secureFallbackDelay: "60\u5206\u949F\u4EE5\u4E0A",
|
|
14071
14136
|
lighterSecureAddressTooltip: "\u60A8\u53EA\u80FD\u63D0\u73B0\u5230\u5DF2\u8FDE\u63A5\u7684\u94B1\u5305",
|
|
@@ -19229,23 +19294,19 @@ function resolveLighterAssetIndex(lighterAssets, selectedSourceToken) {
|
|
|
19229
19294
|
)?.asset_id;
|
|
19230
19295
|
return lookupAssetId ?? (selectedSymbol === "USDC" ? LIGHTER_USDC_ASSET_INDEX : void 0);
|
|
19231
19296
|
}
|
|
19232
|
-
function buildLighterSourceTokenOptions(config, lighterAssets) {
|
|
19297
|
+
function buildLighterSourceTokenOptions(config, lighterAssets, isUnifiedTradingMode = false) {
|
|
19233
19298
|
const isLighterFast = config.sourceChainId === RELAY_LIGHTER_CHAIN_ID2;
|
|
19234
|
-
|
|
19235
|
-
return [
|
|
19236
|
-
{
|
|
19237
|
-
symbol: "USDC",
|
|
19238
|
-
label: "USDC (Perps)",
|
|
19239
|
-
iconSrc: getTokenIconUrl("USDC")
|
|
19240
|
-
}
|
|
19241
|
-
];
|
|
19242
|
-
}
|
|
19243
|
-
const usdcPerpsOption = {
|
|
19299
|
+
const usdcOption = {
|
|
19244
19300
|
symbol: "USDC",
|
|
19245
|
-
label: "USDC (Perps)",
|
|
19301
|
+
label: isUnifiedTradingMode ? "USDC" : "USDC (Perps)",
|
|
19246
19302
|
iconSrc: getTokenIconUrl("USDC")
|
|
19247
19303
|
};
|
|
19248
|
-
|
|
19304
|
+
if (isLighterFast) {
|
|
19305
|
+
return [usdcOption];
|
|
19306
|
+
}
|
|
19307
|
+
const spotOptions = lighterAssets.filter(
|
|
19308
|
+
(asset) => !(isUnifiedTradingMode && asset.symbol.toUpperCase() === "USDC")
|
|
19309
|
+
).map((asset) => {
|
|
19249
19310
|
if (asset.symbol.toUpperCase() === "USDC") {
|
|
19250
19311
|
return {
|
|
19251
19312
|
symbol: LIGHTER_USDC_SPOT_SYMBOL,
|
|
@@ -19259,7 +19320,7 @@ function buildLighterSourceTokenOptions(config, lighterAssets) {
|
|
|
19259
19320
|
iconSrc: getTokenIconUrl(asset.symbol)
|
|
19260
19321
|
};
|
|
19261
19322
|
});
|
|
19262
|
-
return [
|
|
19323
|
+
return [usdcOption, ...spotOptions];
|
|
19263
19324
|
}
|
|
19264
19325
|
function useLighterWithdrawal(config, setRecipientAddress) {
|
|
19265
19326
|
const { apiKey } = useFunkitConfig();
|
|
@@ -19271,7 +19332,7 @@ function useLighterWithdrawal(config, setRecipientAddress) {
|
|
|
19271
19332
|
setRecipientAddress(connectedAddress);
|
|
19272
19333
|
}
|
|
19273
19334
|
}, [isLighterSecure, connectedAddress, setRecipientAddress]);
|
|
19274
|
-
const { mainAccountIndex } = useLighterAccounts({
|
|
19335
|
+
const { mainAccountIndex, isUnifiedTradingMode } = useLighterAccounts({
|
|
19275
19336
|
address: connectedAddress
|
|
19276
19337
|
});
|
|
19277
19338
|
const {
|
|
@@ -19305,6 +19366,7 @@ function useLighterWithdrawal(config, setRecipientAddress) {
|
|
|
19305
19366
|
return {
|
|
19306
19367
|
isLighterSecure,
|
|
19307
19368
|
isLighterFast,
|
|
19369
|
+
isUnifiedTradingMode,
|
|
19308
19370
|
connectedAddress,
|
|
19309
19371
|
lighterBalances,
|
|
19310
19372
|
lighterAssets,
|
|
@@ -19312,11 +19374,15 @@ function useLighterWithdrawal(config, setRecipientAddress) {
|
|
|
19312
19374
|
invalidateLighterAccount
|
|
19313
19375
|
};
|
|
19314
19376
|
}
|
|
19315
|
-
function useLighterSourceTokenOptions(config, apiKey, lighterAssets) {
|
|
19377
|
+
function useLighterSourceTokenOptions(config, apiKey, lighterAssets, isUnifiedTradingMode = false) {
|
|
19316
19378
|
if (!isLighterxyzCustomer(apiKey)) {
|
|
19317
19379
|
return void 0;
|
|
19318
19380
|
}
|
|
19319
|
-
return buildLighterSourceTokenOptions(
|
|
19381
|
+
return buildLighterSourceTokenOptions(
|
|
19382
|
+
config,
|
|
19383
|
+
lighterAssets,
|
|
19384
|
+
isUnifiedTradingMode
|
|
19385
|
+
);
|
|
19320
19386
|
}
|
|
19321
19387
|
function LighterSecureLockedField({
|
|
19322
19388
|
tooltip,
|
|
@@ -19703,7 +19769,7 @@ function useCheckoutTimeEstimate(latestQuote, originalTimeEstimationMs, paymentM
|
|
|
19703
19769
|
import { useMemo as useMemo28 } from "react";
|
|
19704
19770
|
|
|
19705
19771
|
// src/hooks/queries/useSwappedExchanges.ts
|
|
19706
|
-
import { RailConfigType, getFops as getFops2 } from "@funkit/api-base";
|
|
19772
|
+
import { RailConfigType as RailConfigType2, getFops as getFops2 } from "@funkit/api-base";
|
|
19707
19773
|
import { bitcoinChain as bitcoinChain2, solanaChain as solanaChain3, tronChain as tronChain2 } from "@funkit/chains";
|
|
19708
19774
|
import { keepPreviousData as keepPreviousData2, useQuery as useQuery14 } from "@tanstack/react-query";
|
|
19709
19775
|
import { useMemo as useMemo27 } from "react";
|
|
@@ -19822,7 +19888,7 @@ var useSwappedExchanges = () => {
|
|
|
19822
19888
|
countryCode,
|
|
19823
19889
|
railConfigs: [
|
|
19824
19890
|
{
|
|
19825
|
-
type:
|
|
19891
|
+
type: RailConfigType2.CRYPTO_TO_CRYPTO,
|
|
19826
19892
|
userId,
|
|
19827
19893
|
countryCode,
|
|
19828
19894
|
baseCurrencyCode: swappedCurrencyCode,
|
|
@@ -25996,6 +26062,7 @@ var WithdrawContent = ({
|
|
|
25996
26062
|
const {
|
|
25997
26063
|
isLighterSecure,
|
|
25998
26064
|
isLighterFast,
|
|
26065
|
+
isUnifiedTradingMode,
|
|
25999
26066
|
connectedAddress,
|
|
26000
26067
|
lighterBalances,
|
|
26001
26068
|
lighterAssets,
|
|
@@ -26091,7 +26158,8 @@ var WithdrawContent = ({
|
|
|
26091
26158
|
const sourceTokenOptions = useLighterSourceTokenOptions(
|
|
26092
26159
|
config,
|
|
26093
26160
|
apiKey,
|
|
26094
|
-
lighterAssets
|
|
26161
|
+
lighterAssets,
|
|
26162
|
+
isUnifiedTradingMode
|
|
26095
26163
|
);
|
|
26096
26164
|
const normalizedSelectedToken = selectedToken?.toUpperCase();
|
|
26097
26165
|
const { checkoutItem } = useCheckoutContext();
|
|
@@ -26548,31 +26616,10 @@ import React139 from "react";
|
|
|
26548
26616
|
import { Trans as Trans9 } from "react-i18next";
|
|
26549
26617
|
|
|
26550
26618
|
// src/hooks/queries/useWithdrawFops.ts
|
|
26551
|
-
import { RailConfigType as
|
|
26619
|
+
import { RailConfigType as RailConfigType3, getFops as getFops3 } from "@funkit/api-base";
|
|
26552
26620
|
import { useQuery as useQuery19 } from "@tanstack/react-query";
|
|
26553
26621
|
import { useMemo as useMemo40 } from "react";
|
|
26554
|
-
|
|
26555
|
-
// src/utils/swappedRouteOverride.ts
|
|
26556
|
-
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9 } from "@funkit/chains";
|
|
26557
|
-
import { isTokenEquivalent as isTokenEquivalent7 } from "@funkit/utils";
|
|
26558
|
-
var isNonEmptyString = (value) => typeof value === "string" && value.length > 0;
|
|
26559
|
-
var isSupportedChainId = (value) => typeof value === "string" && /^\d+$/.test(value) && Boolean(FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9[Number(value)]);
|
|
26560
|
-
var isEvmAddress = (value) => typeof value === "string" && /^0x[a-fA-F0-9]{40}$/.test(value);
|
|
26561
|
-
function isWellFormedOverride(override) {
|
|
26562
|
-
return isSupportedChainId(override.when?.chainId) && isEvmAddress(override.when?.tokenAddress) && isSupportedChainId(override.use?.chainId) && isEvmAddress(override.use?.tokenAddress) && isNonEmptyString(override.use?.symbol);
|
|
26563
|
-
}
|
|
26564
|
-
function findSwappedSourceOverride(overrides, source) {
|
|
26565
|
-
return overrides?.find(
|
|
26566
|
-
(override) => isWellFormedOverride(override) && isTokenEquivalent7({
|
|
26567
|
-
firstTokenChainId: override.when.chainId,
|
|
26568
|
-
firstTokenAddress: override.when.tokenAddress,
|
|
26569
|
-
secondTokenChainId: source.chainId,
|
|
26570
|
-
secondTokenAddress: source.tokenAddress
|
|
26571
|
-
})
|
|
26572
|
-
);
|
|
26573
|
-
}
|
|
26574
|
-
|
|
26575
|
-
// src/hooks/queries/useWithdrawFops.ts
|
|
26622
|
+
import { findSwappedSourceOverride } from "@funkit/connect-core";
|
|
26576
26623
|
var SWAPPED_MIN_SELL_EUR = 7;
|
|
26577
26624
|
var useWithdrawFops = (params) => {
|
|
26578
26625
|
const { apiKey } = useFunkitConfig();
|
|
@@ -26660,7 +26707,7 @@ var useWithdrawFops = (params) => {
|
|
|
26660
26707
|
countryCode,
|
|
26661
26708
|
railConfigs: [
|
|
26662
26709
|
{
|
|
26663
|
-
type:
|
|
26710
|
+
type: RailConfigType3.CRYPTO_TO_FIAT,
|
|
26664
26711
|
userId,
|
|
26665
26712
|
countryCode,
|
|
26666
26713
|
fiatCurrencyCode: swappedCurrencyCode,
|
|
@@ -27344,6 +27391,9 @@ function useSwappedIframeLifecycle({
|
|
|
27344
27391
|
import { getCheckoutQuoteV2 as getCheckoutQuoteV22 } from "@funkit/api-base";
|
|
27345
27392
|
import { useEffect as useEffect45, useRef as useRef22 } from "react";
|
|
27346
27393
|
import { erc20Abi as erc20Abi5 } from "viem";
|
|
27394
|
+
import {
|
|
27395
|
+
findSwappedSourceOverride as findSwappedSourceOverride2
|
|
27396
|
+
} from "@funkit/connect-core";
|
|
27347
27397
|
function resolveSwappedWithdrawalLegs(config, override) {
|
|
27348
27398
|
const sourceChainId = Number(config.sourceChainId);
|
|
27349
27399
|
return {
|
|
@@ -27428,7 +27478,7 @@ function useFiatWithdrawal({
|
|
|
27428
27478
|
const sourceOverrides = useDynamicConfig("swappedwithdrawalsourceoverrides");
|
|
27429
27479
|
const legs = isWalletWithdrawalConfig(config) ? resolveSwappedWithdrawalLegs(
|
|
27430
27480
|
config,
|
|
27431
|
-
|
|
27481
|
+
findSwappedSourceOverride2(sourceOverrides, {
|
|
27432
27482
|
chainId: config.sourceChainId,
|
|
27433
27483
|
tokenAddress: config.sourceTokenAddress
|
|
27434
27484
|
})
|
|
@@ -31783,7 +31833,7 @@ var ChainInfoBanners = ({ chainId: chainId2 }) => {
|
|
|
31783
31833
|
import {
|
|
31784
31834
|
formatCurrencyAndStringify as formatCurrencyAndStringify7,
|
|
31785
31835
|
isEVMAddressEquivalent as isEVMAddressEquivalent3,
|
|
31786
|
-
isTokenEquivalent as
|
|
31836
|
+
isTokenEquivalent as isTokenEquivalent7
|
|
31787
31837
|
} from "@funkit/utils";
|
|
31788
31838
|
import NumberFlow from "@number-flow/react";
|
|
31789
31839
|
import { motion as motion11 } from "motion/react";
|
|
@@ -31824,7 +31874,7 @@ function PaymentAmountSummary({
|
|
|
31824
31874
|
const isBrokeragePayment = paymentMethod === PaymentMethod.BROKERAGE;
|
|
31825
31875
|
const receiveAmountLabel = useReceiveAmountLabel({
|
|
31826
31876
|
directExecutionType,
|
|
31827
|
-
isSameToken:
|
|
31877
|
+
isSameToken: isTokenEquivalent7({
|
|
31828
31878
|
firstTokenAddress: sourceTokenAddress,
|
|
31829
31879
|
firstTokenChainId: sourceTokenChainId,
|
|
31830
31880
|
secondTokenAddress: targetTokenAddress,
|
|
@@ -32195,11 +32245,11 @@ import { useCallback as useCallback36, useState as useState54 } from "react";
|
|
|
32195
32245
|
import { erc20Abi as erc20Abi6 } from "viem";
|
|
32196
32246
|
|
|
32197
32247
|
// src/utils/isMainnetUsdt.ts
|
|
32198
|
-
import { isTokenEquivalent as
|
|
32248
|
+
import { isTokenEquivalent as isTokenEquivalent8 } from "@funkit/utils";
|
|
32199
32249
|
import { mainnet as mainnet9 } from "viem/chains";
|
|
32200
32250
|
var USDT_MAINNET_ADDRESS = "0xdAC17F958D2ee523a2206206994597C13D831ec7";
|
|
32201
32251
|
function isMainnetUsdt(chainId2, address) {
|
|
32202
|
-
return
|
|
32252
|
+
return isTokenEquivalent8({
|
|
32203
32253
|
firstTokenAddress: address,
|
|
32204
32254
|
firstTokenChainId: chainId2.toString(),
|
|
32205
32255
|
secondTokenAddress: USDT_MAINNET_ADDRESS,
|
|
@@ -32649,7 +32699,7 @@ function useAaveNativeSupply() {
|
|
|
32649
32699
|
// src/modals/CheckoutModal/InputAmount/useNadoDirectTransfer.ts
|
|
32650
32700
|
import { DirectExecutionType as DirectExecutionType5, createDirectExecution as createDirectExecution2 } from "@funkit/api-base";
|
|
32651
32701
|
import {
|
|
32652
|
-
isTokenEquivalent as
|
|
32702
|
+
isTokenEquivalent as isTokenEquivalent9
|
|
32653
32703
|
} from "@funkit/utils";
|
|
32654
32704
|
import { useCallback as useCallback37, useRef as useRef26, useState as useState55 } from "react";
|
|
32655
32705
|
import { erc20Abi as erc20Abi7 } from "viem";
|
|
@@ -32743,7 +32793,7 @@ function isNadoDirectTransferContext({
|
|
|
32743
32793
|
if (!isNadoCustomer(apiKey) || !checkoutConfig.customRecipient || !isXstockTarget) {
|
|
32744
32794
|
return false;
|
|
32745
32795
|
}
|
|
32746
|
-
const matchesTarget =
|
|
32796
|
+
const matchesTarget = isTokenEquivalent9({
|
|
32747
32797
|
firstTokenChainId: String(sourceAsset.chainId),
|
|
32748
32798
|
firstTokenAddress: sourceAsset.address,
|
|
32749
32799
|
secondTokenChainId: checkoutConfig.targetChain,
|
|
@@ -32755,7 +32805,7 @@ function isNadoDirectTransferContext({
|
|
|
32755
32805
|
if (!wrappedTokenAddress) {
|
|
32756
32806
|
return false;
|
|
32757
32807
|
}
|
|
32758
|
-
return
|
|
32808
|
+
return isTokenEquivalent9({
|
|
32759
32809
|
firstTokenChainId: String(sourceAsset.chainId),
|
|
32760
32810
|
firstTokenAddress: sourceAsset.address,
|
|
32761
32811
|
secondTokenChainId: checkoutConfig.targetChain,
|
|
@@ -34598,7 +34648,7 @@ var useMeldLimitError = (amount, fiatCurrency) => {
|
|
|
34598
34648
|
import { defaultDynamicConfigs as fallbackDynamicConfigs } from "@funkit/connect-core";
|
|
34599
34649
|
import {
|
|
34600
34650
|
formatCryptoAndStringify as formatCryptoAndStringify5,
|
|
34601
|
-
isTokenEquivalent as
|
|
34651
|
+
isTokenEquivalent as isTokenEquivalent11,
|
|
34602
34652
|
round as round2
|
|
34603
34653
|
} from "@funkit/utils";
|
|
34604
34654
|
import * as dnum11 from "dnum";
|
|
@@ -35954,7 +36004,7 @@ function useTextMeasurer(inputRef) {
|
|
|
35954
36004
|
}
|
|
35955
36005
|
|
|
35956
36006
|
// src/modals/CheckoutModal/InputAmount/state.ts
|
|
35957
|
-
import { isEVMAddressEquivalent as isEVMAddressEquivalent4, isTokenEquivalent as
|
|
36007
|
+
import { isEVMAddressEquivalent as isEVMAddressEquivalent4, isTokenEquivalent as isTokenEquivalent10, round } from "@funkit/utils";
|
|
35958
36008
|
import * as dnum10 from "dnum";
|
|
35959
36009
|
import { mainnet as mainnet10 } from "viem/chains";
|
|
35960
36010
|
function resolveUnitPrice(isExactIn, sourceHolding, targetUnitPrice) {
|
|
@@ -36127,7 +36177,7 @@ function isEffectivelySameAsset(checkoutConfig, sourceToken, apiKey) {
|
|
|
36127
36177
|
if (!sourceToken) {
|
|
36128
36178
|
return false;
|
|
36129
36179
|
}
|
|
36130
|
-
if (
|
|
36180
|
+
if (isTokenEquivalent10({
|
|
36131
36181
|
firstTokenChainId: sourceToken.chainId,
|
|
36132
36182
|
firstTokenAddress: sourceToken.address,
|
|
36133
36183
|
secondTokenChainId: checkoutConfig.targetChain,
|
|
@@ -37850,7 +37900,7 @@ function YouPayYouReceiveWrapper({
|
|
|
37850
37900
|
const showYouPayYouReceive = Boolean(
|
|
37851
37901
|
sourceAssetSymbol && sourceAssetIconSrc && targetAssetTicker && targetIconSrc
|
|
37852
37902
|
);
|
|
37853
|
-
const youPayYouReceiveShowYouPaySection = forceShowYouPaySection || !
|
|
37903
|
+
const youPayYouReceiveShowYouPaySection = forceShowYouPaySection || !isTokenEquivalent11({
|
|
37854
37904
|
firstTokenChainId: sourceAssetChainId?.toString() || "",
|
|
37855
37905
|
firstTokenAddress: sourceAssetAddress?.toString() || "",
|
|
37856
37906
|
secondTokenChainId: targetChainId,
|
|
@@ -39776,7 +39826,7 @@ function MeldQuotes({
|
|
|
39776
39826
|
}
|
|
39777
39827
|
|
|
39778
39828
|
// src/modals/CheckoutModal/MeldRedirect/MeldRedirect.tsx
|
|
39779
|
-
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as
|
|
39829
|
+
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9 } from "@funkit/chains";
|
|
39780
39830
|
import React234 from "react";
|
|
39781
39831
|
var MeldRedirectInfo = {
|
|
39782
39832
|
Component: MeldRedirect,
|
|
@@ -39806,7 +39856,7 @@ function MeldRedirect({
|
|
|
39806
39856
|
const [destinationCurrencyCode, destinationChainName = ""] = quote.destinationCurrencyCode.split("_");
|
|
39807
39857
|
const providerLabel = providerLabelMap[quote.serviceProvider] ?? quote.serviceProvider;
|
|
39808
39858
|
const getChainIdByName = (chainName) => {
|
|
39809
|
-
const entry = Object.entries(
|
|
39859
|
+
const entry = Object.entries(FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9).find(
|
|
39810
39860
|
([, chainInfo]) => chainInfo?.name.toLowerCase() === chainName.toLowerCase()
|
|
39811
39861
|
);
|
|
39812
39862
|
return entry?.[0];
|
|
@@ -39863,7 +39913,7 @@ function MeldRedirect({
|
|
|
39863
39913
|
|
|
39864
39914
|
// src/modals/CheckoutModal/SelectAsset/SelectAsset.tsx
|
|
39865
39915
|
import { etherealChain, hyperEvmChain as hyperEvmChain3 } from "@funkit/chains";
|
|
39866
|
-
import { isTokenEquivalent as
|
|
39916
|
+
import { isTokenEquivalent as isTokenEquivalent12 } from "@funkit/utils";
|
|
39867
39917
|
import React238, {
|
|
39868
39918
|
useEffect as useEffect64,
|
|
39869
39919
|
useLayoutEffect as useLayoutEffect2,
|
|
@@ -40197,7 +40247,7 @@ function useAssetOptions({
|
|
|
40197
40247
|
const { isUsable, reason } = usableForCheckout;
|
|
40198
40248
|
const isKnown = isKnownAsset(asset);
|
|
40199
40249
|
const isDisabled = !isUsable || !isKnown;
|
|
40200
|
-
const isUserSelected =
|
|
40250
|
+
const isUserSelected = isTokenEquivalent12({
|
|
40201
40251
|
firstTokenChainId: asset.pickedChainId,
|
|
40202
40252
|
firstTokenAddress: asset.tokenAddress,
|
|
40203
40253
|
secondTokenChainId: userSelectedTargetAsset?.tokenChainId || "",
|
|
@@ -40291,7 +40341,7 @@ function AccountSelectAsset({
|
|
|
40291
40341
|
applyDynamicRouting
|
|
40292
40342
|
} = useCheckoutContext();
|
|
40293
40343
|
const { walletAddress } = useGeneralWallet();
|
|
40294
|
-
const { mainAccountIndex } = useLighterAccounts({
|
|
40344
|
+
const { mainAccountIndex, isUnifiedTradingMode } = useLighterAccounts({
|
|
40295
40345
|
address: walletAddress
|
|
40296
40346
|
});
|
|
40297
40347
|
const bottomSectionRef = useBottomSectionRef();
|
|
@@ -40337,7 +40387,9 @@ function AccountSelectAsset({
|
|
|
40337
40387
|
applyDynamicRouting({
|
|
40338
40388
|
targetAsset: dynamicPath.path.targetAsset,
|
|
40339
40389
|
targetChain: dynamicPath.path.targetChain,
|
|
40340
|
-
|
|
40390
|
+
// Lighter Unified accounts have no spot/perps split — the perps route
|
|
40391
|
+
// ticker ("USDC (Perps)") displays as plain "USDC".
|
|
40392
|
+
targetAssetTicker: isUnifiedTradingMode ? stripLighterPerpsSuffix(dynamicPath.path.targetAssetTicker) : dynamicPath.path.targetAssetTicker,
|
|
40341
40393
|
iconSrc: dynamicPath.path.iconSrc,
|
|
40342
40394
|
generateActionsParams: walletAddress ? dynamicPath.path.generateActionsParams?.(walletAddress) : void 0,
|
|
40343
40395
|
customRecipient: dynamicPath.path.getCustomRecipient?.({
|
|
@@ -40358,7 +40410,7 @@ function AccountSelectAsset({
|
|
|
40358
40410
|
return;
|
|
40359
40411
|
}
|
|
40360
40412
|
const currentSourceAsset = checkoutItem?.selectedSourceAssetInfo;
|
|
40361
|
-
const sourceAssetChanged = !
|
|
40413
|
+
const sourceAssetChanged = !isTokenEquivalent12({
|
|
40362
40414
|
firstTokenChainId: currentSourceAsset?.chainId || "",
|
|
40363
40415
|
firstTokenAddress: currentSourceAsset?.address || "",
|
|
40364
40416
|
secondTokenChainId: tokenItem.pickedChainId,
|
|
@@ -40535,7 +40587,7 @@ function isTreatedAsNativeToken(apiKey, asset, dynamicTargetAssetCandidates, fin
|
|
|
40535
40587
|
return dynamicPath.badge === "NATIVE";
|
|
40536
40588
|
}
|
|
40537
40589
|
if (isEtherealCustomer(apiKey)) {
|
|
40538
|
-
if (
|
|
40590
|
+
if (isTokenEquivalent12({
|
|
40539
40591
|
firstTokenChainId: mainnet11.id.toString(),
|
|
40540
40592
|
firstTokenAddress: "0x90d2af7d622ca3141efa4d8f1f24d86e5974cc8f",
|
|
40541
40593
|
// eUSDe (Ethereum)
|
|
@@ -40544,7 +40596,7 @@ function isTreatedAsNativeToken(apiKey, asset, dynamicTargetAssetCandidates, fin
|
|
|
40544
40596
|
})) {
|
|
40545
40597
|
return true;
|
|
40546
40598
|
}
|
|
40547
|
-
if (
|
|
40599
|
+
if (isTokenEquivalent12({
|
|
40548
40600
|
firstTokenChainId: etherealChain.id.toString(),
|
|
40549
40601
|
firstTokenAddress: NATIVE_TOKEN,
|
|
40550
40602
|
// USDe (Ethereal) uses 0xeeee... address
|
|
@@ -40555,7 +40607,7 @@ function isTreatedAsNativeToken(apiKey, asset, dynamicTargetAssetCandidates, fin
|
|
|
40555
40607
|
}
|
|
40556
40608
|
}
|
|
40557
40609
|
if (isHyenaCustomer(apiKey)) {
|
|
40558
|
-
if (
|
|
40610
|
+
if (isTokenEquivalent12({
|
|
40559
40611
|
firstTokenChainId: hyperEvmChain3.id.toString(),
|
|
40560
40612
|
firstTokenAddress: "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34",
|
|
40561
40613
|
secondTokenChainId: asset.pickedChainId,
|
|
@@ -40565,7 +40617,7 @@ function isTreatedAsNativeToken(apiKey, asset, dynamicTargetAssetCandidates, fin
|
|
|
40565
40617
|
}
|
|
40566
40618
|
}
|
|
40567
40619
|
return dynamicTargetAssetCandidates.some(
|
|
40568
|
-
(token) =>
|
|
40620
|
+
(token) => isTokenEquivalent12({
|
|
40569
40621
|
firstTokenChainId: token.tokenChainId,
|
|
40570
40622
|
firstTokenAddress: token.tokenAddress,
|
|
40571
40623
|
secondTokenChainId: asset.pickedChainId,
|
|
@@ -40586,7 +40638,7 @@ import {
|
|
|
40586
40638
|
createSyntheticFop,
|
|
40587
40639
|
isSyntheticFop as isSyntheticFop3
|
|
40588
40640
|
} from "@funkit/connect-core";
|
|
40589
|
-
import { isTokenEquivalent as
|
|
40641
|
+
import { isTokenEquivalent as isTokenEquivalent13, noop as noop6 } from "@funkit/utils";
|
|
40590
40642
|
import React247, { useEffect as useEffect66, useMemo as useMemo60, useRef as useRef32, useState as useState72 } from "react";
|
|
40591
40643
|
import { createPortal as createPortal20 } from "react-dom";
|
|
40592
40644
|
|
|
@@ -41175,7 +41227,17 @@ function SourceChange({
|
|
|
41175
41227
|
const paymentListScroll = useScrollDivider();
|
|
41176
41228
|
const { paymentMethodInfo, targetChainId } = modalState;
|
|
41177
41229
|
const checkoutConfig = checkoutItem?.initSettings.config;
|
|
41178
|
-
const
|
|
41230
|
+
const { walletAddress } = useGeneralWallet();
|
|
41231
|
+
const { isUnifiedTradingMode: isLighterUnifiedAccount } = useLighterAccounts({
|
|
41232
|
+
address: walletAddress
|
|
41233
|
+
});
|
|
41234
|
+
const dynamicTargetAssets = useMemo60(() => {
|
|
41235
|
+
const candidates = checkoutConfig?.dynamicTargetAssetCandidates;
|
|
41236
|
+
if (!candidates || !isLighterUnifiedAccount) {
|
|
41237
|
+
return candidates;
|
|
41238
|
+
}
|
|
41239
|
+
return adaptLighterTargetAssetsForUnifiedAccount(candidates);
|
|
41240
|
+
}, [checkoutConfig?.dynamicTargetAssetCandidates, isLighterUnifiedAccount]);
|
|
41179
41241
|
const isAutoContinue = !isOstiumCustomer(apiKey);
|
|
41180
41242
|
const isLighter = isLighterxyzCustomer(apiKey);
|
|
41181
41243
|
const {
|
|
@@ -41214,7 +41276,7 @@ function SourceChange({
|
|
|
41214
41276
|
return void 0;
|
|
41215
41277
|
}
|
|
41216
41278
|
const holding = Object.values(walletHoldings).find(
|
|
41217
|
-
(h) =>
|
|
41279
|
+
(h) => isTokenEquivalent13({
|
|
41218
41280
|
firstTokenChainId: h.pickedChainId,
|
|
41219
41281
|
firstTokenAddress: h.tokenAddress,
|
|
41220
41282
|
secondTokenChainId: checkoutConfig.targetChain,
|
|
@@ -41565,7 +41627,7 @@ function SourceChange({
|
|
|
41565
41627
|
chainId: Number(selectedTargetAsset.tokenChainId),
|
|
41566
41628
|
displayedChainId: isLighter ? LIGHTER_CHAIN_ID3 : void 0,
|
|
41567
41629
|
onTokenSelected: handleTargetAssetChange,
|
|
41568
|
-
selectedToken: selectedTargetAsset?.tokenSymbol,
|
|
41630
|
+
selectedToken: isLighterUnifiedAccount ? stripLighterPerpsSuffix(selectedTargetAsset?.tokenSymbol) : selectedTargetAsset?.tokenSymbol,
|
|
41569
41631
|
tokens: dynamicTargetAssets
|
|
41570
41632
|
}
|
|
41571
41633
|
))
|
|
@@ -47448,13 +47510,13 @@ var TITLE_ID2 = "rk-connect-modal-title";
|
|
|
47448
47510
|
function ConnectModal({ onClose, open }) {
|
|
47449
47511
|
const connectionStatus = useConnectionStatus();
|
|
47450
47512
|
const { disconnect } = useFunkitDisconnect();
|
|
47451
|
-
const
|
|
47513
|
+
const config = useConfig();
|
|
47452
47514
|
const onConnectModalCancel = React298.useCallback(() => {
|
|
47453
|
-
if (isConnecting) {
|
|
47515
|
+
if (getAccount(config).isConnecting) {
|
|
47454
47516
|
disconnect();
|
|
47455
47517
|
}
|
|
47456
47518
|
onClose();
|
|
47457
|
-
}, [onClose, disconnect,
|
|
47519
|
+
}, [onClose, disconnect, config]);
|
|
47458
47520
|
if (connectionStatus === "disconnected" || connectionStatus === "loading") {
|
|
47459
47521
|
return /* @__PURE__ */ React298.createElement(
|
|
47460
47522
|
Dialog,
|
|
@@ -48416,7 +48478,7 @@ function useFunkitCheckout(props) {
|
|
|
48416
48478
|
}
|
|
48417
48479
|
};
|
|
48418
48480
|
const isTestnetCheckoutBlocked = (config) => {
|
|
48419
|
-
return isUserLoggedIn && !
|
|
48481
|
+
return isUserLoggedIn && !FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO10?.[config.targetChain]?.isMainnet;
|
|
48420
48482
|
};
|
|
48421
48483
|
const handleLoggedInCheckout = (config, checkoutId) => {
|
|
48422
48484
|
setPendingCheckoutConfig(void 0);
|
|
@@ -48582,7 +48644,7 @@ async function validateCheckoutConfig(config) {
|
|
|
48582
48644
|
message: "Invalid targetAssetTicker configuration: Missing value"
|
|
48583
48645
|
};
|
|
48584
48646
|
}
|
|
48585
|
-
if (!
|
|
48647
|
+
if (!FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO11[config.targetChain]) {
|
|
48586
48648
|
return {
|
|
48587
48649
|
isValid: false,
|
|
48588
48650
|
message: `Invalid targetChain configuration: Unsupported chain id ${config.targetChain} for checkout.`
|
|
@@ -48722,7 +48784,7 @@ function getMaxTargetAssetAmountEstimate(sourceAssetBalance, config, quoteResult
|
|
|
48722
48784
|
async function getTokenDecimals(wagmiConfig, chainId2, tokenAddress) {
|
|
48723
48785
|
try {
|
|
48724
48786
|
if (isAddress(tokenAddress) && isNativeTokenAddress(tokenAddress)) {
|
|
48725
|
-
return
|
|
48787
|
+
return FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO11[chainId2]?.nativeCurrency?.decimals || 18;
|
|
48726
48788
|
}
|
|
48727
48789
|
if (chainId2 === solanaChain5.id.toString()) {
|
|
48728
48790
|
switch (tokenAddress) {
|
|
@@ -48886,7 +48948,7 @@ var isAssetUsableToPayForCheckout = ({
|
|
|
48886
48948
|
if (isCheckoutPostActionRequired(config)) {
|
|
48887
48949
|
return false;
|
|
48888
48950
|
}
|
|
48889
|
-
return paymentMethod === PaymentMethod.ACCOUNT_BALANCE && finalCheckoutRecipient.toLowerCase() === payerAddress.toLowerCase() &&
|
|
48951
|
+
return paymentMethod === PaymentMethod.ACCOUNT_BALANCE && finalCheckoutRecipient.toLowerCase() === payerAddress.toLowerCase() && isTokenEquivalent14({
|
|
48890
48952
|
firstTokenChainId: targetChainId,
|
|
48891
48953
|
firstTokenAddress: targetTokenAddress,
|
|
48892
48954
|
secondTokenChainId: assetChainId,
|
|
@@ -48912,7 +48974,7 @@ var isAssetUsableToPayForCheckout = ({
|
|
|
48912
48974
|
minUsdWithFees: minValueThreshold + feeEstimate
|
|
48913
48975
|
};
|
|
48914
48976
|
}
|
|
48915
|
-
const isSupported = isAllowedForCheckout &&
|
|
48977
|
+
const isSupported = isAllowedForCheckout && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12[assetChainId]?.isCheckoutSupported;
|
|
48916
48978
|
return {
|
|
48917
48979
|
isUsable: !!isSupported,
|
|
48918
48980
|
reason: !isSupported ? t("payment.unsupported") : ""
|
|
@@ -48920,7 +48982,7 @@ var isAssetUsableToPayForCheckout = ({
|
|
|
48920
48982
|
};
|
|
48921
48983
|
|
|
48922
48984
|
// src/hooks/useWalletAssets.ts
|
|
48923
|
-
import { isTokenEquivalent as
|
|
48985
|
+
import { isTokenEquivalent as isTokenEquivalent15 } from "@funkit/utils";
|
|
48924
48986
|
var ASSETS_LOW_VALUE_THRESHOLD3 = 0.1;
|
|
48925
48987
|
var FETCH_ASSETS_INTERVAL_MS2 = 6e4;
|
|
48926
48988
|
function isKnownAsset2(asset) {
|
|
@@ -48929,7 +48991,7 @@ function isKnownAsset2(asset) {
|
|
|
48929
48991
|
var POLYGON_USDCE_TOKEN = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174";
|
|
48930
48992
|
var ARBITRUM_USDCE_TOKEN = "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8";
|
|
48931
48993
|
function normalizeAssetSymbol(asset) {
|
|
48932
|
-
if (
|
|
48994
|
+
if (isTokenEquivalent15({
|
|
48933
48995
|
firstTokenChainId: asset.chainId,
|
|
48934
48996
|
firstTokenAddress: asset.contractAddress,
|
|
48935
48997
|
secondTokenChainId: polygon7.id.toString(),
|
|
@@ -48937,7 +48999,7 @@ function normalizeAssetSymbol(asset) {
|
|
|
48937
48999
|
})) {
|
|
48938
49000
|
return { ...asset, symbol: "USDC.e" };
|
|
48939
49001
|
}
|
|
48940
|
-
if (
|
|
49002
|
+
if (isTokenEquivalent15({
|
|
48941
49003
|
firstTokenChainId: asset.chainId,
|
|
48942
49004
|
firstTokenAddress: asset.contractAddress,
|
|
48943
49005
|
secondTokenChainId: arbitrum6.id.toString(),
|