@aurora-is-near/intents-swap-widget 3.15.1 → 3.15.2
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/dist/{config-DCXH00Br.js → config-CJfcVohD.js} +419 -417
- package/dist/{config-DCXH00Br.js.map → config-CJfcVohD.js.map} +1 -1
- package/dist/config.js +5 -4
- package/dist/config.js.map +1 -1
- package/dist/errors.js +1 -1
- package/dist/ext/alchemy/index.js +1 -1
- package/dist/ext/index.js +1 -1
- package/dist/features/BalanceRpcLoader/TokenBalanceLoader.js +1 -1
- package/dist/features/BalanceRpcLoader/index.js +1 -1
- package/dist/features/BalanceRpcLoader/useTokenBalanceRpc.js +1 -1
- package/dist/features/ChainsDropdown/ChainItem.d.ts +4 -1
- package/dist/features/ChainsDropdown/ChainItem.js +28 -21
- package/dist/features/ChainsDropdown/ChainItem.js.map +1 -1
- package/dist/features/ChainsDropdown/index.js +65 -62
- package/dist/features/ChainsDropdown/index.js.map +1 -1
- package/dist/features/DepositMethodSwitcher.js +1 -1
- package/dist/features/ErrorBoundary.js +1 -1
- package/dist/features/ExternalDeposit.js +1 -1
- package/dist/features/SendAddress/index.js +1 -1
- package/dist/features/SendAddress/useNotification.js +1 -1
- package/dist/features/SubmitButton/index.js +1 -1
- package/dist/features/SuccessScreen/index.js +1 -1
- package/dist/features/SwapDirectionSwitcher.js +1 -1
- package/dist/features/SwapQuote/SwapQuote.js +1 -1
- package/dist/features/SwapQuote/index.js +1 -1
- package/dist/features/TokenInput/TokenInput.js +1 -1
- package/dist/features/TokenInput/TokenInputEmpty.js +1 -1
- package/dist/features/TokenInput/TokenInputSource.js +1 -1
- package/dist/features/TokenInput/TokenInputTarget.js +1 -1
- package/dist/features/TokenInput/WalletBalance.js +1 -1
- package/dist/features/TokenInput/hooks/index.js +1 -1
- package/dist/features/TokenInput/hooks/useTokenInputBalance.js +1 -1
- package/dist/features/TokenInput/index.js +1 -1
- package/dist/features/TokensList/TokenItem.js +1 -1
- package/dist/features/TokensList/TokensList.js +1 -1
- package/dist/features/TokensList/index.js +1 -1
- package/dist/features/TokensModal.js +37 -39
- package/dist/features/TokensModal.js.map +1 -1
- package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js +20 -4
- package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js.map +1 -1
- package/dist/features/WalletCompatibilityCheck/index.js +1 -1
- package/dist/features/index.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +10 -8
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useAllTokens.js +1 -1
- package/dist/hooks/useChains.js +1 -1
- package/dist/hooks/useCompatibilityCheck.js +1 -1
- package/dist/hooks/useDefaultToken.js +1 -1
- package/dist/hooks/useExternalDepositStatus/index.js +1 -1
- package/dist/hooks/useExternalDepositStatus/usePoaExternalDepositStatus.js +1 -1
- package/dist/hooks/useHandleKeyDown.d.ts +1 -0
- package/dist/hooks/useHandleKeyDown.js +15 -0
- package/dist/hooks/useHandleKeyDown.js.map +1 -0
- package/dist/hooks/useIntentsBalance.js +1 -1
- package/dist/hooks/useIsCompatibilityCheckRequired.js +1 -1
- package/dist/hooks/useMakeDepositAddress.js +1 -1
- package/dist/hooks/useMakeIntentsTransfer.js +1 -1
- package/dist/hooks/useMakeNEARFtTransferCall.js +1 -1
- package/dist/hooks/useMakeQuote.js +1 -1
- package/dist/hooks/useMakeQuoteTransfer.js +1 -1
- package/dist/hooks/useMakeTransfer.js +1 -1
- package/dist/hooks/useMergedBalance.js +1 -1
- package/dist/hooks/useSwitchChain.js +1 -1
- package/dist/hooks/useTheme.js +1 -1
- package/dist/hooks/useTokenInputPair.js +1 -1
- package/dist/hooks/useTokens.js +1 -1
- package/dist/hooks/useTokensFiltered.js +1 -1
- package/dist/hooks/useTokensIntentsUnique.js +1 -1
- package/dist/index.js +42 -40
- package/dist/index.js.map +1 -1
- package/dist/machine/effects/index.js +1 -1
- package/dist/machine/effects/useAlchemyBalanceEffect.js +1 -1
- package/dist/machine/effects/useBalancesUpdateEffect.js +1 -1
- package/dist/machine/effects/useMakeQuoteEffect.js +1 -1
- package/dist/machine/effects/useSelectedTokensEffect.js +1 -1
- package/dist/machine/effects/useSetTokenBalanceEffect.js +1 -1
- package/dist/machine/effects/useSetTokenIntentsTargetEffect.js +1 -1
- package/dist/machine/effects/useWalletConnEffect.js +1 -1
- package/dist/machine/events/index.js +1 -1
- package/dist/machine/events/tokenSelect.js +1 -1
- package/dist/machine/events/validateInputAndMoveTo.js +1 -1
- package/dist/machine/events/validateInputs.js +1 -1
- package/dist/machine/index.js +1 -1
- package/dist/machine/snap.js +1 -1
- package/dist/machine/subscriptions/checkers/isSendAddressAsConnected.js +1 -1
- package/dist/machine/subscriptions/index.js +1 -1
- package/dist/theme/ThemeProvider.js +1 -1
- package/dist/utils/intents/signers/near.js +1 -1
- package/dist/utils/intents/signers/privy.js +1 -1
- package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +10 -9
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js.map +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositSkeleton.js +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js +4 -3
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js.map +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapSkeleton.js +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +4 -3
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js.map +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawSkeleton.js +1 -1
- package/package.json +1 -1
- package/src/features/ChainsDropdown/ChainItem.tsx +14 -6
- package/src/features/ChainsDropdown/index.tsx +56 -47
- package/src/features/TokensModal.tsx +6 -3
- package/src/features/WalletCompatibilityCheck/WalletCompatibilityModal.tsx +10 -5
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useHandleKeyDown.ts +17 -0
|
@@ -1,151 +1,153 @@
|
|
|
1
1
|
import { p as st } from "./index-xuotMAFm.js";
|
|
2
|
-
import { jsx as o, jsxs as h, Fragment as
|
|
3
|
-
import
|
|
2
|
+
import { jsx as o, jsxs as h, Fragment as Bt } from "react/jsx-runtime";
|
|
3
|
+
import qt from "i18next";
|
|
4
4
|
import { deepClone as pe } from "valtio/utils";
|
|
5
5
|
import { snapshot as Se, useSnapshot as oe, proxy as rt } from "valtio";
|
|
6
|
-
import { HelmetProvider as
|
|
7
|
-
import { memo as
|
|
8
|
-
import { useQuery as _e, useInfiniteQuery as
|
|
9
|
-
import { Trans as
|
|
10
|
-
import { useTypedTranslation as
|
|
6
|
+
import { HelmetProvider as Ut, Helmet as Pt } from "react-helmet-async";
|
|
7
|
+
import { memo as Wt, useEffect as C, useMemo as v, useRef as Y, useCallback as Te, useState as re, useId as Mt, Fragment as Vt, createContext as at, useContext as Qt } from "react";
|
|
8
|
+
import { useQuery as _e, useInfiniteQuery as $t, useQueryClient as Kt, QueryClient as Ht, QueryClientProvider as Gt } from "@tanstack/react-query";
|
|
9
|
+
import { Trans as jt, I18nextProvider as zt } from "react-i18next";
|
|
10
|
+
import { useTypedTranslation as V, initLocalisation as Yt } from "./localisation.js";
|
|
11
11
|
import { logger as b } from "./logger.js";
|
|
12
|
-
import { getTonTokenBalance as
|
|
13
|
-
import { getSolanaTokenBalance as
|
|
12
|
+
import { getTonTokenBalance as Zt } from "./utils/ton/getTonTokenBalance.js";
|
|
13
|
+
import { getSolanaTokenBalance as Xt } from "./utils/solana/getSolanaTokenBalance.js";
|
|
14
14
|
import { useWalletAddressForToken as ot } from "./hooks/useWalletAddressForToken.js";
|
|
15
15
|
import "@headlessui/react";
|
|
16
16
|
import "framer-motion";
|
|
17
17
|
import "lucide-react";
|
|
18
|
+
import "./features/ChainsDropdown/ChainItem.js";
|
|
18
19
|
import { cn as H } from "./utils/cn.js";
|
|
19
|
-
import { OneClickService as
|
|
20
|
-
import { CHAINS_LIST as ye, DEFAULT_CHAIN_ICON as
|
|
20
|
+
import { OneClickService as Jt, QuoteRequest as U, GetExecutionStatusResponse as ee } from "@defuse-protocol/one-click-sdk-typescript";
|
|
21
|
+
import { CHAINS_LIST as ye, DEFAULT_CHAIN_ICON as en, DEFAULT_CHAINS_ORDER as it, CHAIN_POA_MAP as ct, POA_EVM_CHAIN_ID as lt, CHAIN_BASE_TOKENS as tn, EVM_CHAIN_IDS_MAP as he, CHAIN_IDS_MAP as nn, EVM_CHAINS as sn } from "./constants/chains.js";
|
|
21
22
|
import "use-debounce";
|
|
22
|
-
import { derive as
|
|
23
|
-
import { getIsNativeNearDeposit as
|
|
24
|
-
import { getIsDirectTokenOnNearDeposit as
|
|
23
|
+
import { derive as rn } from "derive-valtio";
|
|
24
|
+
import { getIsNativeNearDeposit as an } from "./machine/computed/getIsNativeNearDeposit.js";
|
|
25
|
+
import { getIsDirectTokenOnNearDeposit as on } from "./machine/computed/getIsDirectTokenOnNearDeposit.js";
|
|
25
26
|
import "ethers";
|
|
26
27
|
import { moveTo as O, machine as Z } from "./machine/machine.js";
|
|
27
|
-
import
|
|
28
|
+
import cn from "lodash.once";
|
|
28
29
|
import { guardStates as D } from "./machine/guards/index.js";
|
|
29
|
-
import { parse as
|
|
30
|
-
import { createLoader as
|
|
31
|
-
import { isAlchemySupportedChain as
|
|
30
|
+
import { parse as ln } from "./ext/alchemy/parse.js";
|
|
31
|
+
import { createLoader as dn } from "./ext/alchemy/load.js";
|
|
32
|
+
import { isAlchemySupportedChain as un } from "./ext/alchemy/types.js";
|
|
32
33
|
import { fireEvent as p } from "./machine/events/utils/fireEvent.js";
|
|
33
34
|
import { NATIVE_NEAR_DUMB_ASSET_ID as $, TOKENS_DATA as be, WNEAR_ASSET_ID as ge } from "./constants/tokens.js";
|
|
34
|
-
import { isValidChain as
|
|
35
|
+
import { isValidChain as mn } from "./utils/checkers/isValidChain.js";
|
|
35
36
|
import { useWalletBalance as Ee } from "./hooks/useWalletBalance.js";
|
|
36
37
|
import { getIntentsAccountId as te } from "./utils/intents/getIntentsAccountId.js";
|
|
37
|
-
import { getIntentsBalances as
|
|
38
|
-
import { notReachable as
|
|
38
|
+
import { getIntentsBalances as fn } from "./utils/intents/getIntentsBalance.js";
|
|
39
|
+
import { notReachable as Ce } from "./utils/notReachable.js";
|
|
39
40
|
import { getTokenBalanceKey as G } from "./utils/intents/getTokenBalanceKey.js";
|
|
40
|
-
import { isDryQuote as
|
|
41
|
+
import { isDryQuote as Re } from "./machine/guards/checks/isDryQuote.js";
|
|
41
42
|
import { snakeCase as dt } from "change-case";
|
|
42
|
-
import
|
|
43
|
+
import pn, { CanceledError as ut, AxiosError as mt } from "axios";
|
|
43
44
|
import { oneClickApi as Ie, bridgeApi as ft } from "./network.js";
|
|
44
45
|
import { formatBigToHuman as j } from "./utils/formatters/formatBigToHuman.js";
|
|
45
46
|
import { getDryQuoteAddress as Pe } from "./utils/getDryQuoteAddress.js";
|
|
46
47
|
import { isEvmChain as Q } from "./utils/evm/isEvmChain.js";
|
|
47
|
-
import { checkNearAccountExists as
|
|
48
|
+
import { checkNearAccountExists as Tn } from "./utils/near/checkNearAccountExists.js";
|
|
48
49
|
import { isNotEmptyAmount as ne } from "./utils/checkers/isNotEmptyAmount.js";
|
|
49
50
|
import { isValidBigint as pt } from "./utils/checkers/isValidBigint.js";
|
|
50
51
|
import { isNearAddress as Tt } from "./utils/near/isNearAddress.js";
|
|
51
52
|
import { isBalanceSufficient as ve } from "./machine/guards/checks/isBalanceSufficient.js";
|
|
52
|
-
import { isQuoteError as De, isTransferError as xe, isAsyncSendAddressValidationError as
|
|
53
|
+
import { isQuoteError as De, isTransferError as xe, isAsyncSendAddressValidationError as hn } from "./machine/errors.js";
|
|
53
54
|
import { isSolanaAddress as ht } from "./utils/solana/isSolanaAddress.js";
|
|
54
55
|
import { isEvmAddress as gt } from "./utils/evm/isEvmAddress.js";
|
|
55
|
-
import { getMainTokenByChain as
|
|
56
|
-
import { getDefaultIntentsToken as
|
|
57
|
-
import { getTokenWithHighBalance as
|
|
58
|
-
import { isQuoteIdle as
|
|
59
|
-
import { isInputChanged as
|
|
60
|
-
import { isErrorChanged as
|
|
61
|
-
import { isOnlyErrorChanged as
|
|
62
|
-
import { isValidInitialState as
|
|
63
|
-
import { isWalletDisconnected as
|
|
64
|
-
import { isSendAddressForbidden as
|
|
65
|
-
import { isAmountChangedFromQuote as
|
|
66
|
-
import { reset as
|
|
56
|
+
import { getMainTokenByChain as gn } from "./utils/tokens/getMainTokenByChain.js";
|
|
57
|
+
import { getDefaultIntentsToken as In } from "./utils/tokens/getDefaultIntentsToken.js";
|
|
58
|
+
import { getTokenWithHighBalance as wn } from "./utils/tokens/getTokenWithHighBalance.js";
|
|
59
|
+
import { isQuoteIdle as kn } from "./machine/subscriptions/checkers/isQuoteIdle.js";
|
|
60
|
+
import { isInputChanged as An } from "./machine/subscriptions/checkers/isInputChanged.js";
|
|
61
|
+
import { isErrorChanged as Nn } from "./machine/subscriptions/checkers/isErrorChanged.js";
|
|
62
|
+
import { isOnlyErrorChanged as Sn } from "./machine/subscriptions/checkers/isOnlyErrorChanged.js";
|
|
63
|
+
import { isValidInitialState as _n } from "./machine/subscriptions/checkers/isValidInitialState.js";
|
|
64
|
+
import { isWalletDisconnected as yn } from "./machine/subscriptions/checkers/isWalletDisconnected.js";
|
|
65
|
+
import { isSendAddressForbidden as bn } from "./machine/subscriptions/checkers/isSendAddressForbidden.js";
|
|
66
|
+
import { isAmountChangedFromQuote as En } from "./machine/subscriptions/checkers/isAmountChangedFromQuote.js";
|
|
67
|
+
import { reset as Cn } from "./machine/events/reset.js";
|
|
67
68
|
import { tokenSelectRotate as we } from "./machine/events/tokenSelectRotate.js";
|
|
68
69
|
import { errorSet as Rn } from "./machine/events/errorSet.js";
|
|
69
|
-
import { quoteSet as
|
|
70
|
-
import { addressSet as
|
|
71
|
-
import { tokenSetAmount as
|
|
72
|
-
import { quoteSetStatus as
|
|
73
|
-
import { depositTypeSet as
|
|
74
|
-
import { externalDepositTxSet as
|
|
75
|
-
import { setInputsValidating as
|
|
76
|
-
import { walletAddressSet as
|
|
77
|
-
import { tokenSetBalance as
|
|
78
|
-
import { transferSetStatus as
|
|
79
|
-
import { getUsdTradeDelta as
|
|
80
|
-
import { getIsDirectNonNearWithdrawal as
|
|
70
|
+
import { quoteSet as vn } from "./machine/events/quoteSet.js";
|
|
71
|
+
import { addressSet as Dn } from "./machine/events/addressSet.js";
|
|
72
|
+
import { tokenSetAmount as xn } from "./machine/events/tokenSetAmount.js";
|
|
73
|
+
import { quoteSetStatus as On } from "./machine/events/quoteSetStatus.js";
|
|
74
|
+
import { depositTypeSet as Fn } from "./machine/events/depositTypeSet.js";
|
|
75
|
+
import { externalDepositTxSet as Ln } from "./machine/events/externalDepositTxSet.js";
|
|
76
|
+
import { setInputsValidating as Bn } from "./machine/events/setInputsValidating.js";
|
|
77
|
+
import { walletAddressSet as qn } from "./machine/events/walletAddressSet.js";
|
|
78
|
+
import { tokenSetBalance as Un } from "./machine/events/tokenSetBalance.js";
|
|
79
|
+
import { transferSetStatus as Pn } from "./machine/events/transferSetStatus.js";
|
|
80
|
+
import { getUsdTradeDelta as Wn } from "./machine/computed/getUsdTradeDelta.js";
|
|
81
|
+
import { getIsDirectNonNearWithdrawal as Mn } from "./machine/computed/getIsDirectNonNearWithdrawal.js";
|
|
81
82
|
import { getIsDirectTokenOnNearTransfer as Vn } from "./machine/computed/getIsDirectTokenOnNearTransfer.js";
|
|
82
|
-
import { getIsDirectNearTokenWithdrawal as
|
|
83
|
-
import { getIsSameAssetDiffChainWithdrawal as
|
|
83
|
+
import { getIsDirectNearTokenWithdrawal as Qn } from "./machine/computed/getIsDirectNearTokenWithdrawal.js";
|
|
84
|
+
import { getIsSameAssetDiffChainWithdrawal as $n } from "./machine/computed/getIsSameAssetDiffChainWithdrawal.js";
|
|
84
85
|
import "viem";
|
|
85
86
|
import { Button as A } from "./components/Button.js";
|
|
86
87
|
import { TinyNumber as Oe } from "./components/TinyNumber.js";
|
|
87
88
|
import { ErrorMessage as K } from "./components/ErrorMessage.js";
|
|
88
|
-
import { FT_DEPOSIT_GAS as We, FT_TRANSFER_GAS as
|
|
89
|
+
import { FT_DEPOSIT_GAS as We, FT_TRANSFER_GAS as Me } from "./utils/near/config.js";
|
|
89
90
|
import { a as Fe } from "./index-DEq3oXQF.js";
|
|
90
91
|
import { z as se } from "zod";
|
|
91
|
-
import { decodeQueryResult as
|
|
92
|
-
import { nearRpcClient as
|
|
93
|
-
import { getNearNep141MinStorageBalance as
|
|
92
|
+
import { decodeQueryResult as Kn } from "./utils/near/decodeQueryResult.js";
|
|
93
|
+
import { nearRpcClient as Hn } from "./utils/near/rpc.js";
|
|
94
|
+
import { getNearNep141MinStorageBalance as Gn } from "./utils/near/getNearNep141MinStorageBalance.js";
|
|
94
95
|
import { INTENTS_CONTRACT as ke } from "./constants/intents.js";
|
|
95
96
|
import { isEvmBaseToken as It } from "./utils/evm/isEvmBaseToken.js";
|
|
96
|
-
import { useMakeEvmTransfer as
|
|
97
|
-
import { useMakeSolanaTransfer as
|
|
97
|
+
import { useMakeEvmTransfer as jn } from "./hooks/useMakeEvmTransfer.js";
|
|
98
|
+
import { useMakeSolanaTransfer as zn } from "./hooks/useMakeSolanaTransfer.js";
|
|
98
99
|
import { isUserDeniedSigning as Ae } from "./utils/checkers/isUserDeniedSigning.js";
|
|
99
|
-
import { createIntentSignerNEP413 as
|
|
100
|
-
import { generateRandomBytes as
|
|
101
|
-
import { IntentSignerSolana as
|
|
102
|
-
import { localStorageTyped as
|
|
103
|
-
import { queryContract as
|
|
100
|
+
import { createIntentSignerNEP413 as Yn, BridgeSDK as Zn, createNearWithdrawalRoute as Xn, createInternalTransferRoute as Jn, MinWithdrawalAmountError as es, FeeExceedsAmountError as ts } from "@defuse-protocol/bridge-sdk";
|
|
101
|
+
import { generateRandomBytes as ns } from "./utils/near/getRandomBytes.js";
|
|
102
|
+
import { IntentSignerSolana as ss } from "./utils/intents/signers/solana.js";
|
|
103
|
+
import { localStorageTyped as Ve } from "./utils/localstorage.js";
|
|
104
|
+
import { queryContract as rs } from "./utils/near/queryContract.js";
|
|
104
105
|
import { utils as Qe } from "@defuse-protocol/internal-utils";
|
|
105
|
-
import { getTransactionLink as
|
|
106
|
-
import { switchEthereumChain as
|
|
106
|
+
import { getTransactionLink as as } from "./utils/formatters/getTransactionLink.js";
|
|
107
|
+
import { switchEthereumChain as os } from "./utils/evm/switchEthereumChain.js";
|
|
107
108
|
import "copy-text-to-clipboard";
|
|
108
109
|
import { SwapQuoteSkeleton as wt } from "./features/SwapQuote/SwapQuoteSkeleton.js";
|
|
109
110
|
import { Notes as de } from "./components/Notes.js";
|
|
110
|
-
import { Accordion as
|
|
111
|
+
import { Accordion as is } from "./components/Accordion.js";
|
|
111
112
|
import { formatUsdAmount as $e } from "./utils/formatters/formatUsdAmount.js";
|
|
112
|
-
import { formatTinyNumber as
|
|
113
|
-
import
|
|
114
|
-
import { Skeleton as
|
|
115
|
-
import { getBalancePortion as
|
|
116
|
-
import { getUsdDisplayAmount as
|
|
113
|
+
import { formatTinyNumber as cs } from "./utils/formatters/formatTinyNumber.js";
|
|
114
|
+
import ls from "clsx";
|
|
115
|
+
import { Skeleton as ds } from "./components/Skeleton.js";
|
|
116
|
+
import { getBalancePortion as us } from "./features/TokenInput/utils/getBalancePortion.js";
|
|
117
|
+
import { getUsdDisplayAmount as ms } from "./features/TokenInput/utils/getUsdDisplayAmount.js";
|
|
117
118
|
import { TokenInputHeading as kt } from "./features/TokenInput/TokenInputHeading.js";
|
|
118
|
-
import { noop as
|
|
119
|
+
import { noop as fs } from "./utils/noop.js";
|
|
119
120
|
import { Card as ie } from "./components/Card.js";
|
|
120
121
|
import { Badge as Ke } from "./components/Badge.js";
|
|
121
122
|
import { TokenIcon as At } from "./components/TokenIcon.js";
|
|
122
|
-
import { InputAmount as
|
|
123
|
-
import { TokenInputSkeleton as
|
|
124
|
-
import { getUsdDisplayBalance as
|
|
125
|
-
import { VList as
|
|
123
|
+
import { InputAmount as ps } from "./components/InputAmount.js";
|
|
124
|
+
import { TokenInputSkeleton as Ts } from "./features/TokenInput/TokenInputSkeleton.js";
|
|
125
|
+
import { getUsdDisplayBalance as hs } from "./utils/formatters/getUsdDisplayBalance.js";
|
|
126
|
+
import { VList as gs } from "virtua";
|
|
126
127
|
import { TokensListPlaceholder as Ne } from "./features/TokensList/TokensListPlaceholder.js";
|
|
127
|
-
import { Hr as
|
|
128
|
-
import { createTokenSorter as
|
|
128
|
+
import { Hr as Is } from "./components/Hr.js";
|
|
129
|
+
import { createTokenSorter as ws } from "./utils/tokens/sort.js";
|
|
129
130
|
import { createFilterByIntents as He } from "./utils/tokens/filterByIntents.js";
|
|
130
|
-
import { createFilterBySearch as
|
|
131
|
-
import { createFilterBySelectedChain as
|
|
131
|
+
import { createFilterBySearch as ks } from "./utils/tokens/filterBySearchString.js";
|
|
132
|
+
import { createFilterBySelectedChain as As } from "./utils/tokens/filterBySelectedChain.js";
|
|
132
133
|
import "bs58";
|
|
133
134
|
import "viem/chains";
|
|
134
135
|
import { isBrowser as Nt } from "browser-or-node";
|
|
135
136
|
import "qrcode.react";
|
|
136
|
-
import { createColorPalette as
|
|
137
|
-
import { ArmingCountdownFill as
|
|
137
|
+
import { createColorPalette as Ns } from "./theme/createColorPalette.js";
|
|
138
|
+
import { ArmingCountdownFill as Ss, BeenhereFill as _s, EncryptedFill as ys, AccountBalanceWalletFill as bs, CheckCircleFill as Es, GppBadFill as Cs } from "@material-symbols-svg/react-rounded";
|
|
138
139
|
import { useTimer as Rs } from "use-timer";
|
|
139
|
-
import {
|
|
140
|
-
import {
|
|
141
|
-
import {
|
|
142
|
-
import {
|
|
143
|
-
import {
|
|
144
|
-
import {
|
|
145
|
-
import {
|
|
146
|
-
import {
|
|
147
|
-
import {
|
|
148
|
-
|
|
140
|
+
import { useHandleKeyDown as St } from "./hooks/useHandleKeyDown.js";
|
|
141
|
+
import { CloseButton as _t } from "./components/CloseButton.js";
|
|
142
|
+
import { DEFAULT_RPCS as vs } from "./rpcs.js";
|
|
143
|
+
import { useAddClassToPortal as Ds } from "./hooks/useAddClassToPortal.js";
|
|
144
|
+
import { ErrorBoundary as xs } from "react-error-boundary";
|
|
145
|
+
import { isEvmToken as Os } from "./utils/evm/isEvmToken.js";
|
|
146
|
+
import { getEvmMainTokenBalance as Fs } from "./utils/evm/getEvmMainTokenBalance.js";
|
|
147
|
+
import { getNativeNearBalance as Ls } from "./utils/near/getNativeNearBalance.js";
|
|
148
|
+
import { getNearTokenBalance as Bs } from "./utils/near/getNearTokenBalance.js";
|
|
149
|
+
import { getEvmTokenBalance as qs } from "./utils/evm/getEvmTokenBalance.js";
|
|
150
|
+
function Us({ rpcs: e, token: t, connectedWallets: r }) {
|
|
149
151
|
const { walletSupportedChains: s, tonCenterApiKey: n, alchemyApiKey: a } = y(), { walletAddress: l } = ot(r, t);
|
|
150
152
|
return _e({
|
|
151
153
|
retry: 2,
|
|
@@ -155,49 +157,49 @@ function qs({ rpcs: e, token: t, connectedWallets: r }) {
|
|
|
155
157
|
if (!l)
|
|
156
158
|
return null;
|
|
157
159
|
if (t.blockchain === "near" && s.includes(t.blockchain))
|
|
158
|
-
return !e.near || e.near.length === 0 ? null : t.assetId === $ ?
|
|
160
|
+
return !e.near || e.near.length === 0 ? null : t.assetId === $ ? Ls(l, e.near) : Bs(t, l, e.near);
|
|
159
161
|
if (!s.includes("eth") && Q(t.blockchain))
|
|
160
162
|
return null;
|
|
161
163
|
if (Q(t.blockchain) && It(t)) {
|
|
162
164
|
const c = e[t.blockchain] ?? [];
|
|
163
|
-
return c.length > 0 ?
|
|
165
|
+
return c.length > 0 ? Fs(l, c[0]) : null;
|
|
164
166
|
}
|
|
165
|
-
if (
|
|
167
|
+
if (Os(t) || Q(t.blockchain)) {
|
|
166
168
|
const c = e[t.blockchain] ?? [];
|
|
167
|
-
return c.length > 0 ?
|
|
169
|
+
return c.length > 0 ? qs(t, l, c[0]) : null;
|
|
168
170
|
}
|
|
169
|
-
return t.blockchain === "ton" ?
|
|
171
|
+
return t.blockchain === "ton" ? Zt(t, l, n) : t.blockchain === "sol" && s.includes(t.blockchain) ? Xt(t, l, a) : (b.warn(
|
|
170
172
|
`Failed to fetch token balance for ${t.symbol} on ${t.blockchain}`
|
|
171
173
|
), null);
|
|
172
174
|
}
|
|
173
175
|
});
|
|
174
176
|
}
|
|
175
|
-
const
|
|
177
|
+
const Ps = ({
|
|
176
178
|
rpcs: e,
|
|
177
179
|
token: t,
|
|
178
180
|
onBalancesLoaded: r
|
|
179
|
-
}) => (
|
|
181
|
+
}) => (C(() => {
|
|
180
182
|
t.isIntent || !Object.keys(e).includes(t.blockchain) || r({ [t.assetId]: "0" });
|
|
181
|
-
}, [t.assetId]), null),
|
|
183
|
+
}, [t.assetId]), null), yt = Wt(
|
|
182
184
|
({ rpcs: e, token: t, connectedWallets: r, onBalancesLoaded: s }) => {
|
|
183
|
-
const { data: n } =
|
|
185
|
+
const { data: n } = Us({
|
|
184
186
|
rpcs: e,
|
|
185
187
|
token: t,
|
|
186
188
|
connectedWallets: r
|
|
187
189
|
});
|
|
188
|
-
return
|
|
190
|
+
return C(() => {
|
|
189
191
|
!t.isIntent && n != null && s({ [t.assetId]: n });
|
|
190
192
|
}, [t, n, s]), null;
|
|
191
193
|
},
|
|
192
194
|
(e, t) => e.token.assetId === t.token.assetId && e.connectedWallets === t.connectedWallets
|
|
193
195
|
);
|
|
194
|
-
|
|
195
|
-
const Ge = Object.assign(
|
|
196
|
-
Zero:
|
|
197
|
-
}),
|
|
196
|
+
yt.displayName = "TokenBalanceLoader";
|
|
197
|
+
const Ge = Object.assign(yt, {
|
|
198
|
+
Zero: Ps
|
|
199
|
+
}), Ws = (e) => {
|
|
198
200
|
const t = e.toLowerCase();
|
|
199
201
|
return be[t]?.icon ?? "";
|
|
200
|
-
}, je = (e) => ye[e].icon ??
|
|
202
|
+
}, je = (e) => ye[e].icon ?? en, Ms = (e) => `${e?.charAt(0).toUpperCase()}${e?.slice(1)}`, Vs = (e) => be[e]?.name ?? e, P = (e) => {
|
|
201
203
|
const {
|
|
202
204
|
showIntentTokens: t,
|
|
203
205
|
allowedTokensList: r,
|
|
@@ -208,23 +210,23 @@ const Ge = Object.assign(_t, {
|
|
|
208
210
|
fetchTargetTokens: c
|
|
209
211
|
} = y(), { data: d, ...u } = _e({
|
|
210
212
|
queryKey: ["tokens", e].filter(Boolean),
|
|
211
|
-
queryFn: async () => e === "source" && l ? l() : e === "target" && c ? c() :
|
|
213
|
+
queryFn: async () => e === "source" && l ? l() : e === "target" && c ? c() : Jt.getTokens()
|
|
212
214
|
}), i = v(() => {
|
|
213
215
|
if (!d)
|
|
214
216
|
return [];
|
|
215
217
|
const f = d.map((m) => {
|
|
216
218
|
const w = m.blockchain.toLowerCase();
|
|
217
|
-
return !
|
|
219
|
+
return !mn(w) || r && !r.includes(m.assetId) || e === "source" && s && !s.includes(m.assetId) || e === "target" && n && !n.includes(m.assetId) ? null : {
|
|
218
220
|
assetId: m.assetId,
|
|
219
221
|
symbol: m.symbol,
|
|
220
222
|
decimals: m.decimals,
|
|
221
223
|
price: m.price,
|
|
222
224
|
blockchain: w,
|
|
223
225
|
isIntent: !1,
|
|
224
|
-
icon: m.icon ??
|
|
226
|
+
icon: m.icon ?? Ws(m.symbol),
|
|
225
227
|
name: Vs(m.symbol),
|
|
226
228
|
chainIcon: je(w),
|
|
227
|
-
chainName: ye[m.blockchain]?.label ??
|
|
229
|
+
chainName: ye[m.blockchain]?.label ?? Ms(m.blockchain),
|
|
228
230
|
contractAddress: m.contractAddress
|
|
229
231
|
};
|
|
230
232
|
}).filter((m) => !!m).filter(a ?? (() => !0)), T = f.filter(
|
|
@@ -254,7 +256,7 @@ const Ge = Object.assign(_t, {
|
|
|
254
256
|
...u,
|
|
255
257
|
tokens: i
|
|
256
258
|
};
|
|
257
|
-
},
|
|
259
|
+
}, Qs = () => {
|
|
258
260
|
const { tokens: e } = P(), { tokens: t } = P("source"), { tokens: r } = P("target");
|
|
259
261
|
return { tokens: v(() => {
|
|
260
262
|
const n = {};
|
|
@@ -272,7 +274,7 @@ const Ge = Object.assign(_t, {
|
|
|
272
274
|
{ near: ["USDT", "USDC", "AURORA"] },
|
|
273
275
|
{ arb: ["ARB", "ETH", "USDT", "USDC"] },
|
|
274
276
|
{ btc: ["BTC"] }
|
|
275
|
-
],
|
|
277
|
+
], $s = (e) => [...e].sort((t, r) => {
|
|
276
278
|
const s = ue.findIndex(
|
|
277
279
|
(d) => Object.keys(d)[0] === t.blockchain
|
|
278
280
|
), n = ue.findIndex(
|
|
@@ -282,9 +284,9 @@ const Ge = Object.assign(_t, {
|
|
|
282
284
|
return s === -1 ? 1 : n === -1 ? -1 : s - n;
|
|
283
285
|
const a = ue[s]?.[t.blockchain] ?? [], l = a.indexOf(t.symbol), c = a.indexOf(r.symbol);
|
|
284
286
|
return l === -1 && c === -1 ? 0 : l === -1 ? 1 : c === -1 ? -1 : l - c;
|
|
285
|
-
}),
|
|
286
|
-
const { tokens: r } =
|
|
287
|
-
return v(() =>
|
|
287
|
+
}), Ks = ({ rpcs: e, connectedWallets: t }) => {
|
|
288
|
+
const { tokens: r } = Qs(), { walletSupportedChains: s } = y(), { setWalletBalance: n } = Ee(t);
|
|
289
|
+
return v(() => $s(r), [r]).map((l) => s.includes(l.blockchain) ? /* @__PURE__ */ o(
|
|
288
290
|
Ge,
|
|
289
291
|
{
|
|
290
292
|
rpcs: e,
|
|
@@ -303,7 +305,7 @@ const Ge = Object.assign(_t, {
|
|
|
303
305
|
G(l)
|
|
304
306
|
));
|
|
305
307
|
};
|
|
306
|
-
function
|
|
308
|
+
function Hs(e, t) {
|
|
307
309
|
const r = Array.from(
|
|
308
310
|
/* @__PURE__ */ new Set([...t ?? [], ...it])
|
|
309
311
|
), s = new Map(r.map((n, a) => [n, a]));
|
|
@@ -312,7 +314,7 @@ function Ks(e, t) {
|
|
|
312
314
|
return l !== c ? l - c : n.id.localeCompare(a.id, void 0, { sensitivity: "base" });
|
|
313
315
|
});
|
|
314
316
|
}
|
|
315
|
-
const
|
|
317
|
+
const Gs = (e) => {
|
|
316
318
|
const {
|
|
317
319
|
chainsOrder: t,
|
|
318
320
|
allowedChainsList: r,
|
|
@@ -323,18 +325,18 @@ const Hs = (e) => {
|
|
|
323
325
|
const l = Array.from(
|
|
324
326
|
new Set(a.map((c) => ye[c.blockchain]))
|
|
325
327
|
).filter((c) => !(r && !r.includes(c.id) || e === "source" && s && !s.includes(c.id) || e === "target" && n && !n.includes(c.id)));
|
|
326
|
-
return
|
|
328
|
+
return Hs(l, t);
|
|
327
329
|
}, [a, t, r]);
|
|
328
|
-
}, ze = 3,
|
|
330
|
+
}, ze = 3, bt = ({
|
|
329
331
|
connectedWallets: e,
|
|
330
332
|
alchemyApiKey: t,
|
|
331
333
|
...r
|
|
332
334
|
}) => {
|
|
333
|
-
const { ctx: s } = _(), { tokens: n } = P(), { walletSupportedChains: a } = y(), { setWalletBalance: l } = Ee(e), c = r.isEnabled && !!Object.values(e).length && a.length > 0, d =
|
|
335
|
+
const { ctx: s } = _(), { tokens: n } = P(), { walletSupportedChains: a } = y(), { setWalletBalance: l } = Ee(e), c = r.isEnabled && !!Object.values(e).length && a.length > 0, d = $t({
|
|
334
336
|
initialPageParam: null,
|
|
335
337
|
enabled: !!c && !!t,
|
|
336
338
|
queryKey: ["walletTokensBalance", e],
|
|
337
|
-
queryFn: async ({ pageParam: i }) =>
|
|
339
|
+
queryFn: async ({ pageParam: i }) => dn({ alchemyApiKey: t })({
|
|
338
340
|
pageParam: i ? `${i}` : null,
|
|
339
341
|
connectedWallets: e,
|
|
340
342
|
walletSupportedChains: a
|
|
@@ -344,21 +346,21 @@ const Hs = (e) => {
|
|
|
344
346
|
return i.pageKey;
|
|
345
347
|
}
|
|
346
348
|
});
|
|
347
|
-
|
|
349
|
+
C(() => {
|
|
348
350
|
c && d.data && d.hasNextPage && d.data.pages.length < ze && !d.isFetchingNextPage && d.fetchNextPage();
|
|
349
351
|
}, [c, d]);
|
|
350
352
|
const u = v(() => {
|
|
351
353
|
if (!d.data?.pages)
|
|
352
354
|
return {};
|
|
353
|
-
const i =
|
|
355
|
+
const i = ln(
|
|
354
356
|
n,
|
|
355
357
|
d.data.pages.flatMap((f) => f.data)
|
|
356
358
|
);
|
|
357
359
|
return n.forEach((f) => {
|
|
358
|
-
|
|
360
|
+
un(f.blockchain) && !(f.assetId in i) && (i[f.assetId] = "0");
|
|
359
361
|
}), i;
|
|
360
362
|
}, [d.data, n]);
|
|
361
|
-
return
|
|
363
|
+
return C(() => {
|
|
362
364
|
D(s, ["initial_wallet"]) && (l(e, u), s.sourceToken && Object.keys(u).includes(s.sourceToken.assetId) && p("tokenSetBalance", u[s.sourceToken.assetId]));
|
|
363
365
|
}, [u]), {
|
|
364
366
|
status: d.status,
|
|
@@ -374,7 +376,7 @@ const Hs = (e) => {
|
|
|
374
376
|
}), a = _e({
|
|
375
377
|
enabled: !!t && !!n && r.length > 0,
|
|
376
378
|
queryKey: ["intentsBalances", n],
|
|
377
|
-
queryFn: async () => n ? await
|
|
379
|
+
queryFn: async () => n ? await fn(n, s) : {}
|
|
378
380
|
}), l = v(() => {
|
|
379
381
|
switch (a.status) {
|
|
380
382
|
case "error":
|
|
@@ -389,23 +391,23 @@ const Hs = (e) => {
|
|
|
389
391
|
case "pending":
|
|
390
392
|
return {};
|
|
391
393
|
default:
|
|
392
|
-
return
|
|
394
|
+
return Ce(a, { throwError: !1 }), {};
|
|
393
395
|
}
|
|
394
396
|
}, [a]) ?? {};
|
|
395
397
|
return {
|
|
396
398
|
...a,
|
|
397
399
|
intentBalances: l
|
|
398
400
|
};
|
|
399
|
-
},
|
|
401
|
+
}, js = ({
|
|
400
402
|
isEnabled: e,
|
|
401
403
|
alchemyApiKey: t
|
|
402
404
|
}) => {
|
|
403
|
-
const { connectedWallets: r } = y(), { ctx: s } = _(), n =
|
|
405
|
+
const { connectedWallets: r } = y(), { ctx: s } = _(), n = Kt(), { refetch: a } = ce(), { refetch: l } = bt({
|
|
404
406
|
isEnabled: e,
|
|
405
407
|
connectedWallets: r,
|
|
406
408
|
alchemyApiKey: t ?? ""
|
|
407
409
|
});
|
|
408
|
-
|
|
410
|
+
C(() => {
|
|
409
411
|
const c = D(s, ["transfer_success"]);
|
|
410
412
|
!e || !c || (async () => (await a(), t && (await new Promise((d) => {
|
|
411
413
|
setTimeout(d, 1e4);
|
|
@@ -417,9 +419,9 @@ const Hs = (e) => {
|
|
|
417
419
|
() => ({ ...r, ...t }),
|
|
418
420
|
[r, t]
|
|
419
421
|
) };
|
|
420
|
-
},
|
|
422
|
+
}, zs = ({ isEnabled: e }) => {
|
|
421
423
|
const { ctx: t } = _(), { mergedBalance: r } = le();
|
|
422
|
-
|
|
424
|
+
C(() => {
|
|
423
425
|
if (!e)
|
|
424
426
|
return;
|
|
425
427
|
if (!t.sourceToken || !t.walletAddress) {
|
|
@@ -444,11 +446,11 @@ const Hs = (e) => {
|
|
|
444
446
|
"nep245:v2_1.omni.hot.tg:56_SZzgw3HSudhZcTwPWUTi2RJB19t": "nep141:wrap.near",
|
|
445
447
|
// BTC (near)
|
|
446
448
|
"nep141:btc.omft.near": "nep141:nbtc.bridge.near"
|
|
447
|
-
},
|
|
449
|
+
}, Ys = ({
|
|
448
450
|
isEnabled: e
|
|
449
451
|
}) => {
|
|
450
452
|
const { ctx: t } = _(), { tokens: r } = P();
|
|
451
|
-
|
|
453
|
+
C(() => {
|
|
452
454
|
if (!e)
|
|
453
455
|
return;
|
|
454
456
|
if (!t.sourceToken) {
|
|
@@ -483,20 +485,20 @@ const Hs = (e) => {
|
|
|
483
485
|
token: a ?? l
|
|
484
486
|
});
|
|
485
487
|
}, [r, t.sourceToken]);
|
|
486
|
-
},
|
|
488
|
+
}, Zs = ({ isEnabled: e }) => {
|
|
487
489
|
const { connectedWallets: t } = y(), { ctx: r, state: s } = _(), { walletAddress: n } = ot(
|
|
488
490
|
t,
|
|
489
491
|
r.sourceToken
|
|
490
492
|
);
|
|
491
|
-
|
|
493
|
+
C(() => {
|
|
492
494
|
if (!e)
|
|
493
495
|
return;
|
|
494
496
|
p("walletAddressSet", n), D(r, ["initial_dry", "initial_wallet"]) && (s === "initial_wallet" && !n ? O("initial_dry") : s === "initial_dry" && n && O("initial_wallet"));
|
|
495
497
|
}, [e, n, r, s]);
|
|
496
|
-
},
|
|
498
|
+
}, Xs = (e) => (["depositAddress"].forEach((t) => {
|
|
497
499
|
if (!(t in e))
|
|
498
500
|
return b.error(`Missing ${t} in quote response`), !1;
|
|
499
|
-
}), !0),
|
|
501
|
+
}), !0), Js = () => {
|
|
500
502
|
const { ctx: e } = _(), {
|
|
501
503
|
walletSupportedChains: t,
|
|
502
504
|
intentsAccountType: r,
|
|
@@ -504,7 +506,7 @@ const Hs = (e) => {
|
|
|
504
506
|
appFees: n,
|
|
505
507
|
fetchQuote: a,
|
|
506
508
|
slippageTolerance: l
|
|
507
|
-
} = y(), c =
|
|
509
|
+
} = y(), c = Re(e), d = Y(null), u = Y(new AbortController()), i = v(() => async (T, I) => {
|
|
508
510
|
const { signal: m } = u.current;
|
|
509
511
|
return a ? a(T, {
|
|
510
512
|
...I,
|
|
@@ -626,7 +628,7 @@ const Hs = (e) => {
|
|
|
626
628
|
...F,
|
|
627
629
|
deadline: void 0,
|
|
628
630
|
depositAddress: void 0
|
|
629
|
-
} : (
|
|
631
|
+
} : (Xs(F), {
|
|
630
632
|
dry: !1,
|
|
631
633
|
...F,
|
|
632
634
|
deadline: F.deadline,
|
|
@@ -637,7 +639,7 @@ const Hs = (e) => {
|
|
|
637
639
|
u.current.abort("Abort quote manually"), u.current = new AbortController();
|
|
638
640
|
}
|
|
639
641
|
};
|
|
640
|
-
},
|
|
642
|
+
}, er = () => {
|
|
641
643
|
const { ctx: e } = _(), { intentsAccountType: t } = y(), { isNativeNearDeposit: r } = z(), s = te({
|
|
642
644
|
addressType: t,
|
|
643
645
|
walletAddress: e.walletAddress ?? ""
|
|
@@ -762,7 +764,7 @@ const Hs = (e) => {
|
|
|
762
764
|
return;
|
|
763
765
|
let t = !1;
|
|
764
766
|
try {
|
|
765
|
-
p("setInputsValidating", !0), t = await
|
|
767
|
+
p("setInputsValidating", !0), t = await Tn(e.sendAddress);
|
|
766
768
|
} catch {
|
|
767
769
|
Ze({
|
|
768
770
|
code: "SEND_ADDRESS_IS_NOT_VERIFIED",
|
|
@@ -777,14 +779,14 @@ const Hs = (e) => {
|
|
|
777
779
|
}), O("initial_wallet");
|
|
778
780
|
return;
|
|
779
781
|
}
|
|
780
|
-
e.error ?
|
|
781
|
-
},
|
|
782
|
+
e.error ? hn(e.error) && (p("errorSet", null), O("input_valid_external")) : O("input_valid_external");
|
|
783
|
+
}, Et = (e) => {
|
|
782
784
|
const t = D(e, ["initial_dry"]), r = D(e, ["input_valid_dry"]);
|
|
783
785
|
if (!t && !r)
|
|
784
786
|
return;
|
|
785
787
|
let s;
|
|
786
788
|
return t && (e.sourceToken ? e.targetToken ? ne(e.sourceTokenAmount) ? e.walletAddress && !ve(e) && (s = { code: "SOURCE_BALANCE_INSUFFICIENT" }) : s = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : s = { code: "TARGET_TOKEN_IS_EMPTY" } : s = { code: "SOURCE_TOKEN_IS_EMPTY" }), !r && s ? p("errorSet", s) : e.error && !De(e.error) && !xe(e.error) && p("errorSet", null), r && s?.code === "SOURCE_BALANCE_INSUFFICIENT" && p("errorSet", s), r;
|
|
787
|
-
},
|
|
789
|
+
}, Ct = (e) => {
|
|
788
790
|
const t = D(e, ["initial_wallet"]), r = D(e, ["input_valid_external"]);
|
|
789
791
|
if (!t && !r)
|
|
790
792
|
return;
|
|
@@ -801,14 +803,14 @@ const Hs = (e) => {
|
|
|
801
803
|
const s = e.sourceTokenBalance;
|
|
802
804
|
let n;
|
|
803
805
|
return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? ne(e.sourceTokenAmount) ? e.isDepositFromExternalWallet || (!s || !pt(s) ? n = { code: "INVALID_SOURCE_BALANCE" } : ve(e) || (n = { code: "SOURCE_BALANCE_INSUFFICIENT" })) : n = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_NOT_INTENT" } : n = { code: "TARGET_TOKEN_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_IS_EMPTY" }), !r && n ? p("errorSet", n) : e.error && !De(e.error) && !xe(e.error) && p("errorSet", null), r;
|
|
804
|
-
},
|
|
805
|
-
const t =
|
|
806
|
+
}, vt = (e) => {
|
|
807
|
+
const t = Re(e), r = !t && e.targetToken?.isIntent === !0, s = !t && e.targetToken?.isIntent === !1;
|
|
806
808
|
if (t) {
|
|
807
|
-
const n =
|
|
809
|
+
const n = Et(e);
|
|
808
810
|
return O(n ? "input_valid_dry" : "initial_dry");
|
|
809
811
|
}
|
|
810
|
-
s &&
|
|
811
|
-
},
|
|
812
|
+
s && Ct(e) ? O("input_valid_external") : r && Rt(e) ? O("input_valid_internal") : O("initial_wallet");
|
|
813
|
+
}, tr = ({
|
|
812
814
|
isEnabled: e,
|
|
813
815
|
message: t,
|
|
814
816
|
type: r = "exact_in",
|
|
@@ -821,10 +823,10 @@ const Hs = (e) => {
|
|
|
821
823
|
isDirectNearTokenWithdrawal: d,
|
|
822
824
|
isDirectTokenOnNearTransfer: u,
|
|
823
825
|
isSameAssetDiffChainWithdrawal: i
|
|
824
|
-
} = z(), f =
|
|
826
|
+
} = z(), f = Re(n), T = e && !n.areInputsValidating && (i || (c || a) && n.isDepositFromExternalWallet || !d && !l && !c && !u), { make: I, cancel: m } = Js(), { make: w, cancel: N } = er(), E = Y(null), B = () => {
|
|
825
827
|
m(), N();
|
|
826
828
|
};
|
|
827
|
-
|
|
829
|
+
C(() => {
|
|
828
830
|
const L = D(n, ["input_valid_dry"]), k = D(n, ["input_valid_external"]), x = D(n, ["input_valid_internal"]);
|
|
829
831
|
(f && !L || !f && n.targetToken?.isIntent && !x || !f && !n.targetToken?.isIntent && !k || n.areInputsValidating) && B();
|
|
830
832
|
}, [B, f, n]);
|
|
@@ -854,7 +856,7 @@ const Hs = (e) => {
|
|
|
854
856
|
p("quoteSetStatus", "idle"), p("quoteSet", void 0), p("errorSet", null);
|
|
855
857
|
return;
|
|
856
858
|
}
|
|
857
|
-
p("quoteSetStatus", "error"), p("quoteSet", void 0), p("errorSet", k.data),
|
|
859
|
+
p("quoteSetStatus", "error"), p("quoteSet", void 0), p("errorSet", k.data), vt(n);
|
|
858
860
|
return;
|
|
859
861
|
}
|
|
860
862
|
b.error("Unhandled error in useMakeQuoteEffect:", k), p("quoteSetStatus", "error"), p("quoteSet", void 0), p("errorSet", {
|
|
@@ -865,9 +867,9 @@ const Hs = (e) => {
|
|
|
865
867
|
},
|
|
866
868
|
[n, f, w, I, t, r, T]
|
|
867
869
|
);
|
|
868
|
-
|
|
870
|
+
C(() => {
|
|
869
871
|
!T || !(f ? n.state === "input_valid_dry" : n.state === "input_valid_external" && !n.targetToken?.isIntent || n.state === "input_valid_internal" && n.targetToken?.isIntent) || n.quoteStatus !== "error" && (a && !n.isDepositFromExternalWallet || F({ isRefetch: !1 }));
|
|
870
|
-
}, [T, F, B, n.sourceToken, n.targetToken]),
|
|
872
|
+
}, [T, F, B, n.sourceToken, n.targetToken]), C(() => {
|
|
871
873
|
const L = () => {
|
|
872
874
|
E.current && (clearInterval(E.current), E.current = null);
|
|
873
875
|
};
|
|
@@ -879,18 +881,18 @@ const Hs = (e) => {
|
|
|
879
881
|
sol: "sol",
|
|
880
882
|
evm: "eth",
|
|
881
883
|
near: "near"
|
|
882
|
-
},
|
|
884
|
+
}, nr = ({
|
|
883
885
|
isEnabled: e,
|
|
884
886
|
skipIntents: t = !1,
|
|
885
887
|
target: r = "none"
|
|
886
888
|
}) => {
|
|
887
|
-
const { tokens: s } = P(), { ctx: n, state: a } = _(), { intentBalances: l } = ce(), { walletSupportedChains: c, chainsFilter: d, intentsAccountType: u } = y(), i =
|
|
889
|
+
const { tokens: s } = P(), { ctx: n, state: a } = _(), { intentBalances: l } = ce(), { walletSupportedChains: c, chainsFilter: d, intentsAccountType: u } = y(), i = wn({
|
|
888
890
|
tokens: s,
|
|
889
891
|
walletSupportedChains: c,
|
|
890
892
|
balances: l,
|
|
891
893
|
across: "intents"
|
|
892
894
|
}), [f, T] = v(() => !n.walletAddress && !t ? [
|
|
893
|
-
{ token:
|
|
895
|
+
{ token: In({ tokens: s }), status: "loaded" },
|
|
894
896
|
{ token: void 0, status: "loaded" }
|
|
895
897
|
] : d.source.intents !== "none" && !t ? i ? [
|
|
896
898
|
{ token: i, status: "loaded" },
|
|
@@ -899,7 +901,7 @@ const Hs = (e) => {
|
|
|
899
901
|
{ token: void 0, status: "loading" },
|
|
900
902
|
{ token: void 0, status: "loading" }
|
|
901
903
|
] : [
|
|
902
|
-
{ token:
|
|
904
|
+
{ token: gn({
|
|
903
905
|
tokens: s,
|
|
904
906
|
walletSupportedChains: c
|
|
905
907
|
}), status: "loaded" },
|
|
@@ -913,7 +915,7 @@ const Hs = (e) => {
|
|
|
913
915
|
c,
|
|
914
916
|
a
|
|
915
917
|
]);
|
|
916
|
-
|
|
918
|
+
C(() => {
|
|
917
919
|
if (!e)
|
|
918
920
|
return;
|
|
919
921
|
if (D(n, ["initial_dry", "initial_wallet"]) && (f.status === "loaded" && !n.sourceToken && p("tokenSelect", {
|
|
@@ -942,14 +944,14 @@ const Hs = (e) => {
|
|
|
942
944
|
}, [n, f, T, e]);
|
|
943
945
|
const I = (m, w) => {
|
|
944
946
|
const N = s.find(
|
|
945
|
-
(E) => !E.isIntent && E.blockchain === me[m] && E.symbol.toLowerCase() ===
|
|
947
|
+
(E) => !E.isIntent && E.blockchain === me[m] && E.symbol.toLowerCase() === tn[me[m]]?.toLowerCase()
|
|
946
948
|
) ?? w;
|
|
947
949
|
p("tokenSelect", {
|
|
948
950
|
variant: "source",
|
|
949
951
|
token: N
|
|
950
952
|
});
|
|
951
953
|
};
|
|
952
|
-
return
|
|
954
|
+
return C(() => {
|
|
953
955
|
const m = D(n, ["initial_dry", "initial_wallet"]);
|
|
954
956
|
if (!e || !m)
|
|
955
957
|
return;
|
|
@@ -966,31 +968,31 @@ const Hs = (e) => {
|
|
|
966
968
|
}, 3e3);
|
|
967
969
|
return () => clearTimeout(N);
|
|
968
970
|
}, [s, f, t]), { source: n.sourceToken, target: n.targetToken };
|
|
969
|
-
},
|
|
971
|
+
}, sr = ({
|
|
970
972
|
isEnabled: e,
|
|
971
973
|
alchemyApiKey: t
|
|
972
974
|
}) => {
|
|
973
975
|
const { connectedWallets: r } = y();
|
|
974
|
-
|
|
976
|
+
bt({
|
|
975
977
|
isEnabled: e,
|
|
976
978
|
connectedWallets: r,
|
|
977
979
|
alchemyApiKey: t ?? ""
|
|
978
980
|
});
|
|
979
|
-
},
|
|
981
|
+
}, rr = (e, t) => {
|
|
980
982
|
const { config: r } = Se(Ue);
|
|
981
983
|
return e.targetToken && !e.sendAddress && !!e.walletAddress && !e.targetToken.isIntent && !t.find((s) => s?.key === "sendAddress") && r.walletSupportedChains.includes(e.targetToken.blockchain);
|
|
982
|
-
},
|
|
984
|
+
}, ar = ({ debug: e }) => {
|
|
983
985
|
Z.onContextChange((t, r) => {
|
|
984
986
|
const s = r;
|
|
985
|
-
if (e && b.debug("[WIDGET] Context changed", s), e && t.error &&
|
|
987
|
+
if (e && b.debug("[WIDGET] Context changed", s), e && t.error && Nn(s) && b.debug(`[WIDGET] Error set to ${t.error.code}`), Sn(s) || En(t, s, e))
|
|
986
988
|
return;
|
|
987
|
-
if (
|
|
989
|
+
if (yn(t, s)) {
|
|
988
990
|
p("reset", { clearWalletAddress: !0 }), O("initial_dry");
|
|
989
991
|
return;
|
|
990
992
|
}
|
|
991
|
-
const { isChanged: n, isDry: a } =
|
|
993
|
+
const { isChanged: n, isDry: a } = An(t, s);
|
|
992
994
|
if (n) {
|
|
993
|
-
if (
|
|
995
|
+
if (_n(t)) {
|
|
994
996
|
const l = a ? "initial_dry" : "initial_wallet";
|
|
995
997
|
O(l, {
|
|
996
998
|
onMoved: () => {
|
|
@@ -1000,14 +1002,14 @@ const Hs = (e) => {
|
|
|
1000
1002
|
}
|
|
1001
1003
|
});
|
|
1002
1004
|
}
|
|
1003
|
-
|
|
1005
|
+
kn(t) || (t.quote = void 0, t.quoteStatus = "idle", t.transferStatus = { status: "idle" }), bn(t) && (t.sendAddress = void 0), rr(t, s) && (t.sendAddress = t.walletAddress), vt(t);
|
|
1004
1006
|
}
|
|
1005
1007
|
});
|
|
1006
|
-
},
|
|
1008
|
+
}, or = ({ debug: e }) => {
|
|
1007
1009
|
Z.onTransition((t, r) => {
|
|
1008
1010
|
e && b.debug(`===> [WIDGET] State moved from ${t} to ${r}`);
|
|
1009
1011
|
});
|
|
1010
|
-
},
|
|
1012
|
+
}, ir = (e, t) => {
|
|
1011
1013
|
const { variant: r, token: s } = t, { config: n } = Se(Ue);
|
|
1012
1014
|
switch (r) {
|
|
1013
1015
|
case "source":
|
|
@@ -1031,20 +1033,20 @@ const Hs = (e) => {
|
|
|
1031
1033
|
e.targetToken = s;
|
|
1032
1034
|
break;
|
|
1033
1035
|
default:
|
|
1034
|
-
|
|
1036
|
+
Ce(r, { throwError: !1 });
|
|
1035
1037
|
}
|
|
1036
|
-
},
|
|
1038
|
+
}, R = (e, t) => Z.on(
|
|
1037
1039
|
e,
|
|
1038
1040
|
(r, s) => t(r, s, Z)
|
|
1039
|
-
),
|
|
1040
|
-
|
|
1041
|
-
},
|
|
1041
|
+
), cr = () => {
|
|
1042
|
+
R("quoteSetStatus", On), R("walletAddressSet", qn), R("transferSetStatus", Pn), R("tokenSelectRotate", we), R("tokenSetBalance", Un), R("tokenSetAmount", xn), R("depositTypeSet", Fn), R("setInputsValidating", Bn), R("externalDepositTxSet", Ln), R("tokenSelect", ir), R("addressSet", Dn), R("errorSet", Rn), R("quoteSet", vn), R("reset", Cn), R("validateDryInputs", Et), R("validateExternalInputs", Ct), R("validateInternalInputs", Rt);
|
|
1043
|
+
}, lr = cn(({ debug: e }) => {
|
|
1042
1044
|
e && b.debug(
|
|
1043
|
-
"[WIDGET] Debug mode is enabled (package version: 3.15.
|
|
1044
|
-
),
|
|
1045
|
-
}),
|
|
1046
|
-
|
|
1047
|
-
|
|
1045
|
+
"[WIDGET] Debug mode is enabled (package version: 3.15.2)"
|
|
1046
|
+
), cr(), or({ debug: e }), ar({ debug: e });
|
|
1047
|
+
}), Pi = ({ listenTo: e, debug: t = !1 }) => {
|
|
1048
|
+
C(() => {
|
|
1049
|
+
lr({ debug: t });
|
|
1048
1050
|
}, [t]);
|
|
1049
1051
|
const r = e.find(
|
|
1050
1052
|
(a) => Array.isArray(a) && a[0] === "setBalancesUsingAlchemyExt"
|
|
@@ -1053,85 +1055,85 @@ const Hs = (e) => {
|
|
|
1053
1055
|
), n = e.find(
|
|
1054
1056
|
(a) => Array.isArray(a) && a[0] === "makeQuote"
|
|
1055
1057
|
);
|
|
1056
|
-
|
|
1058
|
+
sr({
|
|
1057
1059
|
isEnabled: !!r,
|
|
1058
1060
|
alchemyApiKey: r?.[1].alchemyApiKey
|
|
1059
|
-
}),
|
|
1061
|
+
}), nr({
|
|
1060
1062
|
isEnabled: !!s,
|
|
1061
1063
|
skipIntents: s?.[1].skipIntents,
|
|
1062
1064
|
target: s?.[1].target
|
|
1063
|
-
}),
|
|
1065
|
+
}), tr({
|
|
1064
1066
|
isEnabled: !!n,
|
|
1065
1067
|
message: n?.[1].message,
|
|
1066
1068
|
type: n?.[1].type,
|
|
1067
1069
|
refetchQuoteInterval: n?.[1].refetchQuoteInterval
|
|
1068
|
-
}),
|
|
1070
|
+
}), Zs({
|
|
1069
1071
|
isEnabled: e.includes("checkWalletConnection")
|
|
1070
|
-
}), js({
|
|
1071
|
-
isEnabled: e.includes("setSourceTokenBalance")
|
|
1072
1072
|
}), zs({
|
|
1073
|
+
isEnabled: e.includes("setSourceTokenBalance")
|
|
1074
|
+
}), Ys({
|
|
1073
1075
|
isEnabled: e.includes("setSourceTokenIntentsTarget")
|
|
1074
|
-
}),
|
|
1076
|
+
}), js({
|
|
1075
1077
|
isEnabled: e.includes("updateBalances"),
|
|
1076
1078
|
alchemyApiKey: r?.[1].alchemyApiKey
|
|
1077
1079
|
});
|
|
1078
|
-
},
|
|
1080
|
+
}, dr = Z.getStore();
|
|
1079
1081
|
class W extends Error {
|
|
1080
1082
|
context;
|
|
1081
1083
|
_is_widget_error = !0;
|
|
1082
1084
|
constructor(t, r) {
|
|
1083
|
-
super(t), this.name = "WidgetError", this.cause = r?.cause, this.context = Se(
|
|
1085
|
+
super(t), this.name = "WidgetError", this.cause = r?.cause, this.context = Se(dr).context;
|
|
1084
1086
|
}
|
|
1085
1087
|
}
|
|
1086
|
-
class
|
|
1088
|
+
class Dt extends W {
|
|
1087
1089
|
data;
|
|
1088
1090
|
constructor(t) {
|
|
1089
1091
|
super(t.code), this.data = t, this.name = "MachineError";
|
|
1090
1092
|
}
|
|
1091
1093
|
}
|
|
1092
|
-
class q extends
|
|
1094
|
+
class q extends Dt {
|
|
1093
1095
|
constructor(t) {
|
|
1094
1096
|
super(t), this.name = "QuoteError";
|
|
1095
1097
|
}
|
|
1096
1098
|
}
|
|
1097
|
-
class g extends
|
|
1099
|
+
class g extends Dt {
|
|
1098
1100
|
constructor(t) {
|
|
1099
1101
|
super(t), this.name = "TransferError";
|
|
1100
1102
|
}
|
|
1101
1103
|
}
|
|
1102
|
-
const
|
|
1103
|
-
usdTradeDelta: (e) =>
|
|
1104
|
-
isDirectNearTokenWithdrawal: (e) =>
|
|
1105
|
-
isDirectNonNearWithdrawal: (e) =>
|
|
1106
|
-
isDirectTokenOnNearDeposit: (e) =>
|
|
1107
|
-
isNativeNearDeposit: (e) =>
|
|
1108
|
-
isSameAssetDiffChainWithdrawal: (e) =>
|
|
1109
|
-
isDirectTokenOnNearTransfer: (e) => Vn(e(
|
|
1110
|
-
}), z = () => oe(
|
|
1111
|
-
const e = oe(
|
|
1104
|
+
const Wi = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e && !!e._is_widget_error, M = Z.getStore(), ur = rn({
|
|
1105
|
+
usdTradeDelta: (e) => Wn(e(M.context)),
|
|
1106
|
+
isDirectNearTokenWithdrawal: (e) => Qn(e(M.context)),
|
|
1107
|
+
isDirectNonNearWithdrawal: (e) => Mn(e(M.context)),
|
|
1108
|
+
isDirectTokenOnNearDeposit: (e) => on(e(M.context)),
|
|
1109
|
+
isNativeNearDeposit: (e) => an(e(M.context)),
|
|
1110
|
+
isSameAssetDiffChainWithdrawal: (e) => $n(e(M.context)),
|
|
1111
|
+
isDirectTokenOnNearTransfer: (e) => Vn(e(M.context))
|
|
1112
|
+
}), z = () => oe(ur), _ = () => {
|
|
1113
|
+
const e = oe(M);
|
|
1112
1114
|
return {
|
|
1113
1115
|
state: e.state,
|
|
1114
1116
|
ctx: e.context
|
|
1115
1117
|
};
|
|
1116
|
-
},
|
|
1117
|
-
const t = oe(
|
|
1118
|
+
}, Mi = (e) => {
|
|
1119
|
+
const t = oe(M);
|
|
1118
1120
|
if (!D(t.context, [e]))
|
|
1119
1121
|
throw new W(
|
|
1120
1122
|
`[WIDGET] Attempt to access snapshot for ${e} state while context does not match`
|
|
1121
1123
|
);
|
|
1122
1124
|
return t.context;
|
|
1123
|
-
},
|
|
1125
|
+
}, mr = async ({
|
|
1124
1126
|
contractId: e,
|
|
1125
1127
|
accountId: t
|
|
1126
1128
|
}) => {
|
|
1127
1129
|
try {
|
|
1128
|
-
const r = { account_id: t }, s = Fe.from(JSON.stringify(r)).toString("base64"), n = await
|
|
1130
|
+
const r = { account_id: t }, s = Fe.from(JSON.stringify(r)).toString("base64"), n = await Hn.query({
|
|
1129
1131
|
request_type: "call_function",
|
|
1130
1132
|
method_name: "storage_balance_of",
|
|
1131
1133
|
account_id: e,
|
|
1132
1134
|
args_base64: s,
|
|
1133
1135
|
finality: "optimistic"
|
|
1134
|
-
}), a =
|
|
1136
|
+
}), a = Kn(
|
|
1135
1137
|
n,
|
|
1136
1138
|
se.union([se.null(), se.object({ total: se.string() })])
|
|
1137
1139
|
);
|
|
@@ -1140,7 +1142,7 @@ const qi = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e
|
|
|
1140
1142
|
throw new W("Error fetching balance", { cause: r });
|
|
1141
1143
|
}
|
|
1142
1144
|
};
|
|
1143
|
-
function
|
|
1145
|
+
function fr(e) {
|
|
1144
1146
|
const { ctx: t } = _(), { isNativeNearDeposit: r } = z(), s = t.sourceToken?.contractAddress, n = t.quote?.amountIn ?? t.sourceTokenAmount;
|
|
1145
1147
|
return {
|
|
1146
1148
|
make: async (l, c) => {
|
|
@@ -1210,7 +1212,7 @@ function mr(e) {
|
|
|
1210
1212
|
methodName: "ft_transfer_call",
|
|
1211
1213
|
deposit: "1",
|
|
1212
1214
|
// 1 yocto required by NEP-141
|
|
1213
|
-
gas:
|
|
1215
|
+
gas: Me,
|
|
1214
1216
|
args: {
|
|
1215
1217
|
amount: n,
|
|
1216
1218
|
receiver_id: l,
|
|
@@ -1247,10 +1249,10 @@ function mr(e) {
|
|
|
1247
1249
|
});
|
|
1248
1250
|
try {
|
|
1249
1251
|
const [i, f] = await Promise.all([
|
|
1250
|
-
|
|
1252
|
+
Gn({
|
|
1251
1253
|
contractId: s
|
|
1252
1254
|
}),
|
|
1253
|
-
|
|
1255
|
+
mr({
|
|
1254
1256
|
contractId: s,
|
|
1255
1257
|
accountId: l
|
|
1256
1258
|
})
|
|
@@ -1272,7 +1274,7 @@ function mr(e) {
|
|
|
1272
1274
|
amount: n,
|
|
1273
1275
|
msg: c ?? ""
|
|
1274
1276
|
},
|
|
1275
|
-
gas:
|
|
1277
|
+
gas: Me,
|
|
1276
1278
|
deposit: "1"
|
|
1277
1279
|
}
|
|
1278
1280
|
});
|
|
@@ -1301,13 +1303,13 @@ function mr(e) {
|
|
|
1301
1303
|
}
|
|
1302
1304
|
};
|
|
1303
1305
|
}
|
|
1304
|
-
const
|
|
1306
|
+
const pr = ({
|
|
1305
1307
|
makeTransfer: e,
|
|
1306
1308
|
providers: t
|
|
1307
1309
|
}) => {
|
|
1308
|
-
const { ctx: r } = _(), { alchemyApiKey: s } = y(), { make: n } =
|
|
1310
|
+
const { ctx: r } = _(), { alchemyApiKey: s } = y(), { make: n } = jn({
|
|
1309
1311
|
provider: t?.evm
|
|
1310
|
-
}), { make: a } =
|
|
1312
|
+
}), { make: a } = zn({
|
|
1311
1313
|
provider: t?.sol,
|
|
1312
1314
|
alchemyApiKey: s
|
|
1313
1315
|
}), l = (d) => {
|
|
@@ -1375,7 +1377,7 @@ const fr = ({
|
|
|
1375
1377
|
const T = i instanceof Error && Ae(i.message);
|
|
1376
1378
|
if (T)
|
|
1377
1379
|
return;
|
|
1378
|
-
throw
|
|
1380
|
+
throw pn.isAxiosError(i) ? (f = i.response?.data?.detail ?? i.message ?? "Failed to make deposit. Please try again.", new g({
|
|
1379
1381
|
code: "QUOTE_ERROR",
|
|
1380
1382
|
meta: { message: f }
|
|
1381
1383
|
})) : f === "No quotes found" ? new g({
|
|
@@ -1390,7 +1392,7 @@ const fr = ({
|
|
|
1390
1392
|
}
|
|
1391
1393
|
} };
|
|
1392
1394
|
};
|
|
1393
|
-
class
|
|
1395
|
+
class Tr {
|
|
1394
1396
|
constructor(t, r) {
|
|
1395
1397
|
this.account = t, this.provider = r;
|
|
1396
1398
|
}
|
|
@@ -1419,10 +1421,10 @@ class pr {
|
|
|
1419
1421
|
};
|
|
1420
1422
|
}
|
|
1421
1423
|
}
|
|
1422
|
-
const
|
|
1424
|
+
const hr = ({
|
|
1423
1425
|
walletAddress: e,
|
|
1424
1426
|
getProvider: t
|
|
1425
|
-
}) =>
|
|
1427
|
+
}) => Yn({
|
|
1426
1428
|
accountId: e,
|
|
1427
1429
|
signMessage: async (r) => {
|
|
1428
1430
|
const s = t();
|
|
@@ -1446,7 +1448,7 @@ const Tr = ({
|
|
|
1446
1448
|
signature: n.signature
|
|
1447
1449
|
};
|
|
1448
1450
|
}
|
|
1449
|
-
}),
|
|
1451
|
+
}), gr = (e, t) => {
|
|
1450
1452
|
if (t) {
|
|
1451
1453
|
if (e.sendAddress)
|
|
1452
1454
|
return e.sendAddress;
|
|
@@ -1461,8 +1463,8 @@ const Tr = ({
|
|
|
1461
1463
|
meta: { message: "Quote is required for intents non-direct transfer" }
|
|
1462
1464
|
});
|
|
1463
1465
|
return e.quote.depositAddress;
|
|
1464
|
-
},
|
|
1465
|
-
let r =
|
|
1466
|
+
}, Ir = async (e, t) => {
|
|
1467
|
+
let r = Ve.getItem("nearWalletsPk")[t];
|
|
1466
1468
|
if (!e.signMessage)
|
|
1467
1469
|
throw new g({
|
|
1468
1470
|
code: "DIRECT_TRANSFER_ERROR",
|
|
@@ -1473,14 +1475,14 @@ const Tr = ({
|
|
|
1473
1475
|
const a = await e.signMessage({
|
|
1474
1476
|
message: "Authenticate",
|
|
1475
1477
|
recipient: "intents.near",
|
|
1476
|
-
nonce: Fe.from(
|
|
1478
|
+
nonce: Fe.from(ns(32))
|
|
1477
1479
|
});
|
|
1478
1480
|
if (!a)
|
|
1479
1481
|
throw new g({
|
|
1480
1482
|
code: "DIRECT_TRANSFER_ERROR",
|
|
1481
1483
|
meta: { message: "Signing message failed" }
|
|
1482
1484
|
});
|
|
1483
|
-
r = a.publicKey,
|
|
1485
|
+
r = a.publicKey, Ve.setItem("nearWalletsPk", {
|
|
1484
1486
|
[t]: a.publicKey
|
|
1485
1487
|
});
|
|
1486
1488
|
} catch {
|
|
@@ -1493,7 +1495,7 @@ const Tr = ({
|
|
|
1493
1495
|
walletAddress: t,
|
|
1494
1496
|
addressType: "near"
|
|
1495
1497
|
});
|
|
1496
|
-
if (!await
|
|
1498
|
+
if (!await rs({
|
|
1497
1499
|
contractId: ke,
|
|
1498
1500
|
methodName: "has_public_key",
|
|
1499
1501
|
args: {
|
|
@@ -1527,7 +1529,7 @@ const Tr = ({
|
|
|
1527
1529
|
meta: { message: "Unable to add public key to intents account" }
|
|
1528
1530
|
});
|
|
1529
1531
|
}
|
|
1530
|
-
},
|
|
1532
|
+
}, wr = ({ providers: e }) => {
|
|
1531
1533
|
const { ctx: t } = _(), { appName: r, intentsAccountType: s } = y(), {
|
|
1532
1534
|
isNativeNearDeposit: n,
|
|
1533
1535
|
isDirectNearTokenWithdrawal: a,
|
|
@@ -1567,7 +1569,7 @@ const Tr = ({
|
|
|
1567
1569
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1568
1570
|
meta: { message: "No EVM provider configured" }
|
|
1569
1571
|
});
|
|
1570
|
-
i = new
|
|
1572
|
+
i = new Tr(
|
|
1571
1573
|
{ walletAddress: t.walletAddress },
|
|
1572
1574
|
e.evm
|
|
1573
1575
|
);
|
|
@@ -1578,7 +1580,7 @@ const Tr = ({
|
|
|
1578
1580
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1579
1581
|
meta: { message: "No SOL provider configured" }
|
|
1580
1582
|
});
|
|
1581
|
-
i = new
|
|
1583
|
+
i = new ss(
|
|
1582
1584
|
{ walletAddress: t.walletAddress },
|
|
1583
1585
|
e.sol
|
|
1584
1586
|
);
|
|
@@ -1589,24 +1591,24 @@ const Tr = ({
|
|
|
1589
1591
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1590
1592
|
meta: { message: "No NEAR provider configured" }
|
|
1591
1593
|
});
|
|
1592
|
-
await
|
|
1594
|
+
await Ir(e.near(), t.walletAddress), i = hr({
|
|
1593
1595
|
walletAddress: t.walletAddress,
|
|
1594
1596
|
getProvider: e.near
|
|
1595
1597
|
});
|
|
1596
1598
|
break;
|
|
1597
1599
|
}
|
|
1598
1600
|
default:
|
|
1599
|
-
|
|
1601
|
+
Ce(s);
|
|
1600
1602
|
}
|
|
1601
|
-
const f = new
|
|
1603
|
+
const f = new Zn({ referral: dt(r) });
|
|
1602
1604
|
f.setIntentSigner(i);
|
|
1603
1605
|
let T;
|
|
1604
|
-
n ? T = void 0 : a ? T =
|
|
1606
|
+
n ? T = void 0 : a ? T = Xn(d ?? void 0) : l ? T = void 0 : T = Jn();
|
|
1605
1607
|
const I = f.createWithdrawal({
|
|
1606
1608
|
withdrawalParams: {
|
|
1607
1609
|
assetId: t.sourceToken.assetId,
|
|
1608
1610
|
amount: BigInt(t.sourceTokenAmount),
|
|
1609
|
-
destinationAddress:
|
|
1611
|
+
destinationAddress: gr(
|
|
1610
1612
|
t,
|
|
1611
1613
|
a || l
|
|
1612
1614
|
),
|
|
@@ -1622,11 +1624,11 @@ const Tr = ({
|
|
|
1622
1624
|
const w = await I.waitForIntentSettlement();
|
|
1623
1625
|
return await I.waitForWithdrawalCompletion(), {
|
|
1624
1626
|
hash: w.hash,
|
|
1625
|
-
transactionLink:
|
|
1627
|
+
transactionLink: as(nn.near, w.hash),
|
|
1626
1628
|
intent: m
|
|
1627
1629
|
};
|
|
1628
1630
|
} catch (m) {
|
|
1629
|
-
if (b.error("[TRANSFER ERROR]", m), m instanceof
|
|
1631
|
+
if (b.error("[TRANSFER ERROR]", m), m instanceof es)
|
|
1630
1632
|
throw new g({
|
|
1631
1633
|
code: "MIN_WITHDRAWAL_AMOUNT_ERROR",
|
|
1632
1634
|
meta: {
|
|
@@ -1636,7 +1638,7 @@ const Tr = ({
|
|
|
1636
1638
|
)
|
|
1637
1639
|
}
|
|
1638
1640
|
});
|
|
1639
|
-
if (m instanceof
|
|
1641
|
+
if (m instanceof ts)
|
|
1640
1642
|
throw new g({
|
|
1641
1643
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1642
1644
|
meta: { message: "Fee is above the maximum allowed" }
|
|
@@ -1654,7 +1656,7 @@ const Tr = ({
|
|
|
1654
1656
|
});
|
|
1655
1657
|
}
|
|
1656
1658
|
} };
|
|
1657
|
-
},
|
|
1659
|
+
}, kr = ({
|
|
1658
1660
|
message: e,
|
|
1659
1661
|
providers: t,
|
|
1660
1662
|
makeTransfer: r
|
|
@@ -1663,10 +1665,10 @@ const Tr = ({
|
|
|
1663
1665
|
isDirectTokenOnNearDeposit: n,
|
|
1664
1666
|
isDirectTokenOnNearTransfer: a,
|
|
1665
1667
|
isNativeNearDeposit: l
|
|
1666
|
-
} = z(), { make: c } =
|
|
1668
|
+
} = z(), { make: c } = wr({ providers: t }), { make: d } = pr({
|
|
1667
1669
|
makeTransfer: r,
|
|
1668
1670
|
providers: t
|
|
1669
|
-
}), { make: u } =
|
|
1671
|
+
}), { make: u } = fr(
|
|
1670
1672
|
t?.near
|
|
1671
1673
|
);
|
|
1672
1674
|
return { make: async () => {
|
|
@@ -1713,19 +1715,19 @@ const Tr = ({
|
|
|
1713
1715
|
}
|
|
1714
1716
|
return p("transferSetStatus", { status: "success" }), O("transfer_success"), f;
|
|
1715
1717
|
} };
|
|
1716
|
-
},
|
|
1718
|
+
}, Ar = async (e) => {
|
|
1717
1719
|
if (!e)
|
|
1718
1720
|
return;
|
|
1719
1721
|
const t = await e.request({
|
|
1720
1722
|
method: "eth_chainId"
|
|
1721
1723
|
});
|
|
1722
1724
|
return parseInt(t, 16);
|
|
1723
|
-
},
|
|
1725
|
+
}, Nr = ({ providers: e }) => {
|
|
1724
1726
|
const { ctx: t } = _(), [r, s] = re(!1), [n, a] = re(!1), l = Te(async () => {
|
|
1725
1727
|
const d = typeof e?.evm == "function" ? await e.evm() : e?.evm;
|
|
1726
1728
|
if (!t.sourceToken || !d)
|
|
1727
1729
|
return !1;
|
|
1728
|
-
const u = await
|
|
1730
|
+
const u = await Ar(d);
|
|
1729
1731
|
if (!Q(t.sourceToken.blockchain))
|
|
1730
1732
|
return !1;
|
|
1731
1733
|
const i = he[t.sourceToken.blockchain];
|
|
@@ -1738,14 +1740,14 @@ const Tr = ({
|
|
|
1738
1740
|
if (!u)
|
|
1739
1741
|
return !1;
|
|
1740
1742
|
try {
|
|
1741
|
-
return s(!0), await
|
|
1743
|
+
return s(!0), await os(u, d), !0;
|
|
1742
1744
|
} catch (i) {
|
|
1743
1745
|
return b.error("Failed to switch chain:", i), !1;
|
|
1744
1746
|
} finally {
|
|
1745
1747
|
s(!1);
|
|
1746
1748
|
}
|
|
1747
1749
|
}, [t.sourceToken, e]);
|
|
1748
|
-
return
|
|
1750
|
+
return C(() => {
|
|
1749
1751
|
l().then(a);
|
|
1750
1752
|
}, [l]), {
|
|
1751
1753
|
isSwitchingChainRequired: n,
|
|
@@ -1756,7 +1758,7 @@ const Tr = ({
|
|
|
1756
1758
|
size: "lg",
|
|
1757
1759
|
variant: "primary"
|
|
1758
1760
|
}, Le = (e) => {
|
|
1759
|
-
const { t } =
|
|
1761
|
+
const { t } = V();
|
|
1760
1762
|
if (e.error?.code === "TOKEN_IS_NOT_SUPPORTED")
|
|
1761
1763
|
return /* @__PURE__ */ o(A, { state: "error", ...S, children: t("submit.error.invalidAddress", "Invalid address") });
|
|
1762
1764
|
if (e.state === "initial_wallet" && e.error?.code === "SEND_ADDRESS_IS_EMPTY")
|
|
@@ -1774,7 +1776,7 @@ const Tr = ({
|
|
|
1774
1776
|
if (e.error?.code === "QUOTE_AMOUNT_IS_TOO_LOW" || e.error?.code === "MIN_WITHDRAWAL_AMOUNT_ERROR")
|
|
1775
1777
|
return /* @__PURE__ */ h("div", { className: "gap-sw-md flex flex-col", children: [
|
|
1776
1778
|
/* @__PURE__ */ o(A, { state: "error", ...S, children: t("submit.error.amountTooLow.label", "Amount is too low") }),
|
|
1777
|
-
/* @__PURE__ */ o(K, { children: /* @__PURE__ */ h(
|
|
1779
|
+
/* @__PURE__ */ o(K, { children: /* @__PURE__ */ h(jt, { i18nKey: "submit.error.amountTooLow.message", children: [
|
|
1778
1780
|
"Amount you entered is very low. Please try increasing it",
|
|
1779
1781
|
" ",
|
|
1780
1782
|
/* @__PURE__ */ h("span", { className: "text-nowrap", children: [
|
|
@@ -1824,19 +1826,19 @@ const Tr = ({
|
|
|
1824
1826
|
] });
|
|
1825
1827
|
if (e.error?.code === "SOURCE_BALANCE_INSUFFICIENT")
|
|
1826
1828
|
return /* @__PURE__ */ o(A, { state: "error", ...S, children: t("submit.error.insufficientBalance", "Insufficient balance") });
|
|
1827
|
-
},
|
|
1828
|
-
const { t } =
|
|
1829
|
+
}, Sr = ({ onClick: e }) => {
|
|
1830
|
+
const { t } = V();
|
|
1829
1831
|
return /* @__PURE__ */ o(A, { state: "disabled", ...S, onClick: e, children: t("submit.error.connectWallet", "Connect wallet") });
|
|
1830
|
-
},
|
|
1832
|
+
}, _r = () => {
|
|
1831
1833
|
const { ctx: e } = _();
|
|
1832
1834
|
return Le(e) ?? null;
|
|
1833
|
-
},
|
|
1834
|
-
const { providers: t, makeTransfer: r, onSuccess: s } = e, { ctx: n } = _(), { t: a } =
|
|
1835
|
+
}, yr = (e) => {
|
|
1836
|
+
const { providers: t, makeTransfer: r, onSuccess: s } = e, { ctx: n } = _(), { t: a } = V(), {
|
|
1835
1837
|
isNativeNearDeposit: l,
|
|
1836
1838
|
isDirectNonNearWithdrawal: c,
|
|
1837
1839
|
isDirectTokenOnNearDeposit: d,
|
|
1838
1840
|
isDirectNearTokenWithdrawal: u
|
|
1839
|
-
} = z(), { make: i } =
|
|
1841
|
+
} = z(), { make: i } = kr({ providers: t, makeTransfer: r }), { isSwitchingChainRequired: f, switchChain: T, isSwitchingChain: I } = Nr({ providers: t }), m = Le(n), w = async () => {
|
|
1840
1842
|
if (f && !await T())
|
|
1841
1843
|
return;
|
|
1842
1844
|
const N = await i();
|
|
@@ -1877,18 +1879,18 @@ const Tr = ({
|
|
|
1877
1879
|
}
|
|
1878
1880
|
})() })
|
|
1879
1881
|
] }) : n.quoteStatus === "pending" ? /* @__PURE__ */ o(A, { state: "loading", ...S, children: n.quote ? a("submit.pending.quote.refreshing", "Refreshing quote") : a("submit.pending.quote.finalizing", "Finalizing quote") }) : n.error ? /* @__PURE__ */ o(A, { state: "disabled", ...S, children: e.label }) : !n.quote && !c && !d && !u && !l ? /* @__PURE__ */ o(A, { state: "disabled", ...S, children: e.label }) : /* @__PURE__ */ o(A, { ...S, onClick: w, children: e.label });
|
|
1880
|
-
}, yr = (e) => {
|
|
1881
|
-
const { t } = M(), { ctx: r } = _(), s = Le(r);
|
|
1882
|
-
return r.isDepositFromExternalWallet ? ne(r.sourceTokenAmount) ? r.externalDepositTxReceived ? /* @__PURE__ */ o(A, { state: "loading", ...S, children: t("submit.pending.externalDeposit.processing", "Processing") }) : /* @__PURE__ */ o(A, { state: "loading", ...S, children: t("submit.pending.externalDeposit.waiting", "Waiting for transaction") }) : /* @__PURE__ */ o(A, { ...S, state: "disabled", children: t("submit.disabled.enterAmount", "Enter amount") }) : s || /* @__PURE__ */ o(_r, { ...e });
|
|
1883
1882
|
}, br = (e) => {
|
|
1883
|
+
const { t } = V(), { ctx: r } = _(), s = Le(r);
|
|
1884
|
+
return r.isDepositFromExternalWallet ? ne(r.sourceTokenAmount) ? r.externalDepositTxReceived ? /* @__PURE__ */ o(A, { state: "loading", ...S, children: t("submit.pending.externalDeposit.processing", "Processing") }) : /* @__PURE__ */ o(A, { state: "loading", ...S, children: t("submit.pending.externalDeposit.waiting", "Waiting for transaction") }) : /* @__PURE__ */ o(A, { ...S, state: "disabled", children: t("submit.disabled.enterAmount", "Enter amount") }) : s || /* @__PURE__ */ o(yr, { ...e });
|
|
1885
|
+
}, Er = (e) => {
|
|
1884
1886
|
const { ctx: t } = _(), r = y();
|
|
1885
|
-
return t.walletAddress ? /* @__PURE__ */ o(
|
|
1887
|
+
return t.walletAddress ? /* @__PURE__ */ o(br, { ...e }) : /* @__PURE__ */ o(Sr, { onClick: r.onWalletSignin });
|
|
1886
1888
|
};
|
|
1887
|
-
|
|
1888
|
-
const
|
|
1889
|
-
const { t } =
|
|
1889
|
+
Er.Error = _r;
|
|
1890
|
+
const Cr = ({ className: e }) => {
|
|
1891
|
+
const { t } = V(), { slippageTolerance: r } = y(), { ctx: s } = _(), n = s.sourceToken && s.targetToken && s.sourceToken.price / s.targetToken.price;
|
|
1890
1892
|
return s.sourceToken ? /* @__PURE__ */ o(
|
|
1891
|
-
|
|
1893
|
+
is,
|
|
1892
1894
|
{
|
|
1893
1895
|
expandedByDefault: !1,
|
|
1894
1896
|
expandedHeightPx: s.walletAddress ? 80 : 50,
|
|
@@ -1898,7 +1900,7 @@ const Er = ({ className: e }) => {
|
|
|
1898
1900
|
title: s.sourceToken && s.targetToken ? /* @__PURE__ */ h("span", { style: { borderBottomWidth: "2px", borderStyle: "dotted" }, children: [
|
|
1899
1901
|
`1 ${s.sourceToken.symbol} ≈ `,
|
|
1900
1902
|
" ",
|
|
1901
|
-
|
|
1903
|
+
cs(n ?? 0),
|
|
1902
1904
|
" ",
|
|
1903
1905
|
`${s.targetToken.symbol}`,
|
|
1904
1906
|
/* @__PURE__ */ o("span", { className: "text-sw-gray-50", children: ` (${$e(s.sourceToken.price)})` })
|
|
@@ -1927,7 +1929,7 @@ const Er = ({ className: e }) => {
|
|
|
1927
1929
|
] })
|
|
1928
1930
|
}
|
|
1929
1931
|
) : /* @__PURE__ */ o(wt, {});
|
|
1930
|
-
},
|
|
1932
|
+
}, Vi = Object.assign(Cr, {
|
|
1931
1933
|
Skeleton: wt
|
|
1932
1934
|
}), Rr = ({
|
|
1933
1935
|
token: e,
|
|
@@ -1936,12 +1938,12 @@ const Er = ({ className: e }) => {
|
|
|
1936
1938
|
onClick: s
|
|
1937
1939
|
}) => {
|
|
1938
1940
|
const n = y();
|
|
1939
|
-
return !e.isIntent && !n.walletSupportedChains.includes(e.blockchain) ? /* @__PURE__ */ o("span", {}) : t === void 0 ? /* @__PURE__ */ o(
|
|
1941
|
+
return !e.isIntent && !n.walletSupportedChains.includes(e.blockchain) ? /* @__PURE__ */ o("span", {}) : t === void 0 ? /* @__PURE__ */ o(ds, { width: 100 }) : /* @__PURE__ */ o(
|
|
1940
1942
|
"span",
|
|
1941
1943
|
{
|
|
1942
1944
|
onClick: t ? s : void 0,
|
|
1943
1945
|
style: t ? { borderBottomWidth: "2px", borderStyle: "dotted" } : void 0,
|
|
1944
|
-
className:
|
|
1946
|
+
className: ls("text-sw-label-sm", {
|
|
1945
1947
|
"text-sw-status-error": r,
|
|
1946
1948
|
"text-sw-gray-100": !r,
|
|
1947
1949
|
"cursor-pointer": !!t && !!s
|
|
@@ -1967,10 +1969,10 @@ const Er = ({ className: e }) => {
|
|
|
1967
1969
|
heading: d,
|
|
1968
1970
|
onMsg: u
|
|
1969
1971
|
}) => {
|
|
1970
|
-
const i =
|
|
1972
|
+
const i = Mt(), { ctx: f } = _(), { t: T } = V(), { hideTokenInputHeadings: I } = y(), m = ms(e, r, n), w = (N) => {
|
|
1971
1973
|
u({
|
|
1972
1974
|
type: "on_change_amount",
|
|
1973
|
-
amount:
|
|
1975
|
+
amount: us(t, e.decimals, N)
|
|
1974
1976
|
});
|
|
1975
1977
|
};
|
|
1976
1978
|
return /* @__PURE__ */ h(ie, { className: "flex flex-col", "aria-label": d, children: [
|
|
@@ -1984,11 +1986,11 @@ const Er = ({ className: e }) => {
|
|
|
1984
1986
|
),
|
|
1985
1987
|
children: [
|
|
1986
1988
|
/* @__PURE__ */ o(
|
|
1987
|
-
|
|
1989
|
+
ps,
|
|
1988
1990
|
{
|
|
1989
1991
|
value: r,
|
|
1990
1992
|
name: i,
|
|
1991
|
-
setValue:
|
|
1993
|
+
setValue: fs,
|
|
1992
1994
|
placeholder: "0",
|
|
1993
1995
|
state: a === "default" || a === "disabled" ? a : "error",
|
|
1994
1996
|
onChange: (N) => {
|
|
@@ -2050,7 +2052,7 @@ const Er = ({ className: e }) => {
|
|
|
2050
2052
|
onClick: () => w(1)
|
|
2051
2053
|
}
|
|
2052
2054
|
),
|
|
2053
|
-
!!t && l && c && /* @__PURE__ */ h(
|
|
2055
|
+
!!t && l && c && /* @__PURE__ */ h(Bt, { children: [
|
|
2054
2056
|
/* @__PURE__ */ o(
|
|
2055
2057
|
Ke,
|
|
2056
2058
|
{
|
|
@@ -2114,11 +2116,11 @@ const Er = ({ className: e }) => {
|
|
|
2114
2116
|
]
|
|
2115
2117
|
}
|
|
2116
2118
|
);
|
|
2117
|
-
},
|
|
2119
|
+
}, xt = (e) => {
|
|
2118
2120
|
const { mergedBalance: t } = le(), [r, s] = re(
|
|
2119
2121
|
e ? t[G(e)] : void 0
|
|
2120
2122
|
);
|
|
2121
|
-
return
|
|
2123
|
+
return C(() => {
|
|
2122
2124
|
let n;
|
|
2123
2125
|
if (e) {
|
|
2124
2126
|
const a = t[G(e)];
|
|
@@ -2134,22 +2136,22 @@ const Er = ({ className: e }) => {
|
|
|
2134
2136
|
n && clearTimeout(n);
|
|
2135
2137
|
};
|
|
2136
2138
|
}, [e, t]), r;
|
|
2137
|
-
},
|
|
2139
|
+
}, Ot = (e, t) => {
|
|
2138
2140
|
const { tokens: r } = P(e), s = Array.from(
|
|
2139
2141
|
new Set(r.map((n) => n.assetId))
|
|
2140
2142
|
);
|
|
2141
|
-
|
|
2143
|
+
C(() => {
|
|
2142
2144
|
const n = s.length === 1 ? r[0] : null;
|
|
2143
2145
|
n && t({ type: "on_select_token", token: n });
|
|
2144
2146
|
}, [r]);
|
|
2145
|
-
},
|
|
2147
|
+
}, vr = ({
|
|
2146
2148
|
onMsg: e,
|
|
2147
2149
|
isChanging: t = !0,
|
|
2148
2150
|
showBalance: r = !0,
|
|
2149
2151
|
heading: s
|
|
2150
2152
|
}) => {
|
|
2151
|
-
const { ctx: n } = _(), a =
|
|
2152
|
-
|
|
2153
|
+
const { ctx: n } = _(), a = xt(n.sourceToken);
|
|
2154
|
+
Ot("source", e);
|
|
2153
2155
|
const l = v(() => {
|
|
2154
2156
|
if (!t && n.quoteStatus === "pending")
|
|
2155
2157
|
return "disabled";
|
|
@@ -2173,13 +2175,13 @@ const Er = ({ className: e }) => {
|
|
|
2173
2175
|
onMsg: e
|
|
2174
2176
|
}
|
|
2175
2177
|
) : /* @__PURE__ */ o(qe, { heading: s, onMsg: e });
|
|
2176
|
-
},
|
|
2178
|
+
}, Dr = ({
|
|
2177
2179
|
isChanging: e = !1,
|
|
2178
2180
|
onMsg: t,
|
|
2179
2181
|
heading: r
|
|
2180
2182
|
}) => {
|
|
2181
|
-
const { ctx: s } = _(), { usdTradeDelta: n } = z(), a =
|
|
2182
|
-
|
|
2183
|
+
const { ctx: s } = _(), { usdTradeDelta: n } = z(), a = xt(s.targetToken);
|
|
2184
|
+
Ot("target", t);
|
|
2183
2185
|
const l = v(() => !e && s.quoteStatus === "pending" ? "disabled" : "default", [e, s.quoteStatus]);
|
|
2184
2186
|
return s.targetToken ? /* @__PURE__ */ o(
|
|
2185
2187
|
Be,
|
|
@@ -2196,11 +2198,11 @@ const Er = ({ className: e }) => {
|
|
|
2196
2198
|
onMsg: t
|
|
2197
2199
|
}
|
|
2198
2200
|
) : /* @__PURE__ */ o(qe, { heading: r, onMsg: t });
|
|
2199
|
-
},
|
|
2200
|
-
Skeleton:
|
|
2201
|
-
Source:
|
|
2202
|
-
Target:
|
|
2203
|
-
}), Je = 58,
|
|
2201
|
+
}, xr = ({ token: e, heading: t, ...r }) => e ? /* @__PURE__ */ o(Be, { ...r, token: e, heading: t }) : /* @__PURE__ */ o(qe, { onMsg: r.onMsg, heading: t }), Qi = Object.assign(xr, {
|
|
2202
|
+
Skeleton: Ts,
|
|
2203
|
+
Source: vr,
|
|
2204
|
+
Target: Dr
|
|
2205
|
+
}), Je = 58, Ft = ({
|
|
2204
2206
|
token: e,
|
|
2205
2207
|
balance: t,
|
|
2206
2208
|
showBalance: r = !0,
|
|
@@ -2208,7 +2210,7 @@ const Er = ({ className: e }) => {
|
|
|
2208
2210
|
className: n,
|
|
2209
2211
|
onMsg: a
|
|
2210
2212
|
}) => {
|
|
2211
|
-
const { ctx: l } = _(), { walletSupportedChains: c, appName: d } = y(), u =
|
|
2213
|
+
const { ctx: l } = _(), { walletSupportedChains: c, appName: d } = y(), u = hs(t, e), i = c.includes(e.blockchain) || e.isIntent, f = t !== "0" && t !== 0 && t !== void 0;
|
|
2212
2214
|
return /* @__PURE__ */ o("li", { className: "list-none group", children: /* @__PURE__ */ h(
|
|
2213
2215
|
"div",
|
|
2214
2216
|
{
|
|
@@ -2268,7 +2270,7 @@ const Er = ({ className: e }) => {
|
|
|
2268
2270
|
// NEAR (bsc)
|
|
2269
2271
|
"nep141:eth-0xe0f63a424a4439cbe457d80e4f4b51ad25b2c56c.omft.near"
|
|
2270
2272
|
// SPX (eth)
|
|
2271
|
-
],
|
|
2273
|
+
], Or = () => {
|
|
2272
2274
|
const { tokens: e } = P();
|
|
2273
2275
|
return {
|
|
2274
2276
|
uniqueIntentsTokens: v(() => {
|
|
@@ -2278,20 +2280,20 @@ const Er = ({ className: e }) => {
|
|
|
2278
2280
|
return [...t, ...s];
|
|
2279
2281
|
}, [e])
|
|
2280
2282
|
};
|
|
2281
|
-
},
|
|
2283
|
+
}, Fr = ({
|
|
2282
2284
|
variant: e,
|
|
2283
2285
|
search: t,
|
|
2284
2286
|
selectedChain: r,
|
|
2285
2287
|
chainsFilter: s,
|
|
2286
2288
|
walletSupportedChains: n
|
|
2287
2289
|
}) => {
|
|
2288
|
-
|
|
2289
|
-
const { tokens: a } = P(e), { mergedBalance: l } = le(), { intentBalances: c } = ce(), { uniqueIntentsTokens: d } =
|
|
2290
|
+
Gs(e);
|
|
2291
|
+
const { tokens: a } = P(e), { mergedBalance: l } = le(), { intentBalances: c } = ce(), { uniqueIntentsTokens: d } = Or(), u = ws(
|
|
2290
2292
|
l,
|
|
2291
2293
|
n,
|
|
2292
2294
|
t
|
|
2293
|
-
), i = a.filter(
|
|
2294
|
-
|
|
2295
|
+
), i = a.filter(ks({ search: t })).filter(
|
|
2296
|
+
As({
|
|
2295
2297
|
selectedChain: r,
|
|
2296
2298
|
chainsFilter: s,
|
|
2297
2299
|
walletSupportedChains: n,
|
|
@@ -2304,7 +2306,7 @@ const Er = ({ className: e }) => {
|
|
|
2304
2306
|
intents: i.filter(He({ isIntent: !0 })).sort(u),
|
|
2305
2307
|
wallet: i.filter(He({ isIntent: !1 })).sort(u)
|
|
2306
2308
|
};
|
|
2307
|
-
},
|
|
2309
|
+
}, Lr = (e, t) => e.length === 0 && t ? "EMPTY_SEARCH" : e.length === 0 && !t ? "NO_TOKENS" : "HAS_TOKENS", Br = ({
|
|
2308
2310
|
variant: e,
|
|
2309
2311
|
search: t,
|
|
2310
2312
|
className: r,
|
|
@@ -2315,13 +2317,13 @@ const Er = ({ className: e }) => {
|
|
|
2315
2317
|
chainIsNotSupported: c,
|
|
2316
2318
|
onMsg: d
|
|
2317
2319
|
}) => {
|
|
2318
|
-
const { t: u } =
|
|
2320
|
+
const { t: u } = V(), { ctx: i } = _(), { walletSupportedChains: f, appName: T } = y(), { mergedBalance: I } = le(), m = Fr({
|
|
2319
2321
|
variant: e,
|
|
2320
2322
|
search: t,
|
|
2321
2323
|
chainsFilter: a,
|
|
2322
2324
|
selectedChain: l,
|
|
2323
2325
|
walletSupportedChains: f
|
|
2324
|
-
}), w = i.walletAddress ? s : !1, N =
|
|
2326
|
+
}), w = i.walletAddress ? s : !1, N = Lr(m.all, t), E = v(
|
|
2325
2327
|
() => [{ label: null, tokens: m.all }],
|
|
2326
2328
|
[m.all]
|
|
2327
2329
|
), B = v(
|
|
@@ -2356,7 +2358,7 @@ const Er = ({ className: e }) => {
|
|
|
2356
2358
|
);
|
|
2357
2359
|
case "HAS_TOKENS":
|
|
2358
2360
|
return /* @__PURE__ */ o("div", { className: H("gap-sw-lg flex flex-col", r), children: /* @__PURE__ */ o(
|
|
2359
|
-
|
|
2361
|
+
gs,
|
|
2360
2362
|
{
|
|
2361
2363
|
className: "hide-scrollbar",
|
|
2362
2364
|
style: {
|
|
@@ -2367,13 +2369,13 @@ const Er = ({ className: e }) => {
|
|
|
2367
2369
|
children: (w ? B : E).map(
|
|
2368
2370
|
({ label: k, tokens: x }) => /* @__PURE__ */ h(Vt, { children: [
|
|
2369
2371
|
x.length && k ? /* @__PURE__ */ h("header", { className: "pb-sw-lg flex flex-col", children: [
|
|
2370
|
-
/* @__PURE__ */ o(
|
|
2372
|
+
/* @__PURE__ */ o(Is, {}),
|
|
2371
2373
|
/* @__PURE__ */ o("span", { className: "text-sw-label-sm pt-sw-xl text-sw-gray-100", children: `${k} — ${x.length}` })
|
|
2372
2374
|
] }) : null,
|
|
2373
2375
|
x.map((X) => {
|
|
2374
2376
|
const J = G(X);
|
|
2375
2377
|
return /* @__PURE__ */ o(
|
|
2376
|
-
|
|
2378
|
+
Ft,
|
|
2377
2379
|
{
|
|
2378
2380
|
token: X,
|
|
2379
2381
|
showBalance: n,
|
|
@@ -2406,10 +2408,10 @@ const Er = ({ className: e }) => {
|
|
|
2406
2408
|
}
|
|
2407
2409
|
);
|
|
2408
2410
|
}
|
|
2409
|
-
},
|
|
2411
|
+
}, $i = Object.assign(Br, {
|
|
2410
2412
|
Placeholder: Ne,
|
|
2411
|
-
Item:
|
|
2412
|
-
}),
|
|
2413
|
+
Item: Ft
|
|
2414
|
+
}), qr = (e, t) => {
|
|
2413
2415
|
const r = t.assetId.substring(t.assetId.indexOf(":") + 1), s = (a) => {
|
|
2414
2416
|
const l = (u) => u.replace(/(\.\d*?[1-9])0+$/, "$1").replace(/\.0+$/, ""), c = l(t.amount), d = l(
|
|
2415
2417
|
a.amount.toLocaleString("en-US", {
|
|
@@ -2422,12 +2424,12 @@ const Er = ({ className: e }) => {
|
|
|
2422
2424
|
return (e.result.deposits || []).find(
|
|
2423
2425
|
(a) => a.chain === t.chainId && a.account_id === t.intentsAccountId && a.address === t.depositAddress && a.near_token_id === r && n(a) && s(a)
|
|
2424
2426
|
);
|
|
2425
|
-
},
|
|
2427
|
+
}, Ur = {
|
|
2426
2428
|
CREDITED: ee.status.PROCESSING,
|
|
2427
2429
|
PENDING: ee.status.PROCESSING,
|
|
2428
2430
|
COMPLETED: ee.status.SUCCESS,
|
|
2429
2431
|
FAILED: ee.status.FAILED
|
|
2430
|
-
},
|
|
2432
|
+
}, Ki = ({ depositAddress: e }) => {
|
|
2431
2433
|
const { ctx: t } = _(), { intentsAccountType: r } = y(), [s, n] = re(null), a = te({
|
|
2432
2434
|
addressType: r,
|
|
2433
2435
|
walletAddress: t.walletAddress
|
|
@@ -2459,7 +2461,7 @@ const Er = ({ className: e }) => {
|
|
|
2459
2461
|
chain: i
|
|
2460
2462
|
}
|
|
2461
2463
|
]
|
|
2462
|
-
}), I =
|
|
2464
|
+
}), I = qr(T.data, {
|
|
2463
2465
|
intentsAccountId: a,
|
|
2464
2466
|
initiatedAtDate: f,
|
|
2465
2467
|
depositAddress: e,
|
|
@@ -2468,7 +2470,7 @@ const Er = ({ className: e }) => {
|
|
|
2468
2470
|
amount: d
|
|
2469
2471
|
});
|
|
2470
2472
|
return I ? {
|
|
2471
|
-
status:
|
|
2473
|
+
status: Ur[I.status],
|
|
2472
2474
|
swapDetails: {
|
|
2473
2475
|
intentHashes: [""],
|
|
2474
2476
|
destinationChainTxHashes: [{ hash: I.tx_hash ?? "" }]
|
|
@@ -2481,7 +2483,7 @@ const Er = ({ className: e }) => {
|
|
|
2481
2483
|
}
|
|
2482
2484
|
};
|
|
2483
2485
|
} };
|
|
2484
|
-
},
|
|
2486
|
+
}, Pr = (e, t, r) => {
|
|
2485
2487
|
if (Nt) {
|
|
2486
2488
|
let s = document.body;
|
|
2487
2489
|
r instanceof HTMLElement && (s = r), Object.entries(e).forEach(([n, a]) => {
|
|
@@ -2489,19 +2491,19 @@ const Er = ({ className: e }) => {
|
|
|
2489
2491
|
});
|
|
2490
2492
|
}
|
|
2491
2493
|
}, tt = (e, t, r, s, n) => {
|
|
2492
|
-
const a =
|
|
2493
|
-
a &&
|
|
2494
|
-
},
|
|
2494
|
+
const a = Ns(s, n, t);
|
|
2495
|
+
a && Pr(a, e, r);
|
|
2496
|
+
}, Wr = (e, t) => {
|
|
2495
2497
|
const { primaryColor: r, surfaceColor: s, colorScheme: n = "dark" } = t;
|
|
2496
2498
|
r && tt("accent", 500, e, r, n), s && tt("gray", 950, e, s, n);
|
|
2497
|
-
},
|
|
2499
|
+
}, Mr = at(void 0), Vr = ({ children: e, theme: t }) => {
|
|
2498
2500
|
const { themeParentElementSelector: r } = y(), s = v(() => t, [t]);
|
|
2499
|
-
return
|
|
2501
|
+
return C(() => {
|
|
2500
2502
|
if (t && Nt) {
|
|
2501
2503
|
const n = r ? document.querySelector(r) : null;
|
|
2502
|
-
|
|
2504
|
+
Wr(n, t);
|
|
2503
2505
|
}
|
|
2504
|
-
}, [t]), /* @__PURE__ */ o(
|
|
2506
|
+
}, [t]), /* @__PURE__ */ o(Mr.Provider, { value: s, children: e });
|
|
2505
2507
|
}, fe = ({
|
|
2506
2508
|
text: e,
|
|
2507
2509
|
icon: t
|
|
@@ -2524,27 +2526,27 @@ const Er = ({ className: e }) => {
|
|
|
2524
2526
|
/* @__PURE__ */ o("span", { className: "text-sw-label-md", children: e })
|
|
2525
2527
|
]
|
|
2526
2528
|
}
|
|
2527
|
-
),
|
|
2528
|
-
const { t: s } =
|
|
2529
|
+
), Qr = ({ isSigned: e, isSigning: t, onMsg: r }) => {
|
|
2530
|
+
const { t: s } = V(), n = () => r({ type: "on_close" });
|
|
2531
|
+
St("Escape", n);
|
|
2532
|
+
const a = Rs({
|
|
2529
2533
|
endTime: 0,
|
|
2530
2534
|
autostart: !1,
|
|
2531
2535
|
timerType: "DECREMENTAL",
|
|
2532
2536
|
initialTime: 7,
|
|
2533
|
-
onTimeOver:
|
|
2534
|
-
r({ type: "on_close" });
|
|
2535
|
-
}
|
|
2537
|
+
onTimeOver: n
|
|
2536
2538
|
});
|
|
2537
|
-
return
|
|
2538
|
-
e ?
|
|
2539
|
+
return C(() => {
|
|
2540
|
+
e ? a.start() : a.reset();
|
|
2539
2541
|
}, [e]), /* @__PURE__ */ h(ie, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
|
|
2540
2542
|
/* @__PURE__ */ o(
|
|
2541
|
-
|
|
2543
|
+
_t,
|
|
2542
2544
|
{
|
|
2543
|
-
onClick:
|
|
2545
|
+
onClick: n,
|
|
2544
2546
|
className: "absolute top-sw-2xl right-sw-2xl"
|
|
2545
2547
|
}
|
|
2546
2548
|
),
|
|
2547
|
-
/* @__PURE__ */ o(
|
|
2549
|
+
/* @__PURE__ */ o(Ss, { size: 48, className: "text-sw-status-warning" }),
|
|
2548
2550
|
/* @__PURE__ */ h("header", { className: "flex flex-col gap-sw-lg", children: [
|
|
2549
2551
|
/* @__PURE__ */ o("h1", { className: "text-sw-label-lg text-sw-gray-50", children: s(
|
|
2550
2552
|
"walletCompatibility.modal.title.initial",
|
|
@@ -2563,7 +2565,7 @@ const Er = ({ className: e }) => {
|
|
|
2563
2565
|
"walletCompatibility.modal.feature.secureTransactions",
|
|
2564
2566
|
"Read-only signature – no gas required."
|
|
2565
2567
|
),
|
|
2566
|
-
icon:
|
|
2568
|
+
icon: _s
|
|
2567
2569
|
}
|
|
2568
2570
|
),
|
|
2569
2571
|
/* @__PURE__ */ o(
|
|
@@ -2573,7 +2575,7 @@ const Er = ({ className: e }) => {
|
|
|
2573
2575
|
"walletCompatibility.modal.feature.fullAccess",
|
|
2574
2576
|
"No access to your funds, no hidden permissions."
|
|
2575
2577
|
),
|
|
2576
|
-
icon:
|
|
2578
|
+
icon: ys
|
|
2577
2579
|
}
|
|
2578
2580
|
),
|
|
2579
2581
|
/* @__PURE__ */ o(
|
|
@@ -2583,7 +2585,7 @@ const Er = ({ className: e }) => {
|
|
|
2583
2585
|
"walletCompatibility.modal.feature.fundProtection",
|
|
2584
2586
|
"Only checks whether your wallet is supported."
|
|
2585
2587
|
),
|
|
2586
|
-
icon:
|
|
2588
|
+
icon: bs
|
|
2587
2589
|
}
|
|
2588
2590
|
)
|
|
2589
2591
|
] }),
|
|
@@ -2596,16 +2598,16 @@ const Er = ({ className: e }) => {
|
|
|
2596
2598
|
"Wallet verified"
|
|
2597
2599
|
),
|
|
2598
2600
|
className: "bg-sw-status-success text-sw-gray-950",
|
|
2599
|
-
icon:
|
|
2601
|
+
icon: Es
|
|
2600
2602
|
}
|
|
2601
2603
|
),
|
|
2602
|
-
|
|
2604
|
+
a.status === "RUNNING" && /* @__PURE__ */ o(
|
|
2603
2605
|
nt,
|
|
2604
2606
|
{
|
|
2605
2607
|
className: "text-sw-gray-400",
|
|
2606
2608
|
label: s("walletCompatibility.modal.button.closeTimer", {
|
|
2607
2609
|
defaultValue: "Popup will close in {{count}} sec...",
|
|
2608
|
-
count:
|
|
2610
|
+
count: a.time
|
|
2609
2611
|
})
|
|
2610
2612
|
}
|
|
2611
2613
|
)
|
|
@@ -2634,17 +2636,17 @@ const Er = ({ className: e }) => {
|
|
|
2634
2636
|
)
|
|
2635
2637
|
] })
|
|
2636
2638
|
] });
|
|
2637
|
-
},
|
|
2638
|
-
const { t } =
|
|
2639
|
-
return /* @__PURE__ */ h(ie, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
|
|
2639
|
+
}, $r = ({ onMsg: e }) => {
|
|
2640
|
+
const { t } = V(), r = () => e({ type: "on_close" });
|
|
2641
|
+
return St("Escape", r), /* @__PURE__ */ h(ie, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
|
|
2640
2642
|
/* @__PURE__ */ o(
|
|
2641
|
-
|
|
2643
|
+
_t,
|
|
2642
2644
|
{
|
|
2643
|
-
onClick:
|
|
2645
|
+
onClick: r,
|
|
2644
2646
|
className: "absolute top-sw-2xl right-sw-2xl"
|
|
2645
2647
|
}
|
|
2646
2648
|
),
|
|
2647
|
-
/* @__PURE__ */ o(
|
|
2649
|
+
/* @__PURE__ */ o(Cs, { size: 48, className: "text-sw-status-error" }),
|
|
2648
2650
|
/* @__PURE__ */ h("header", { className: "flex flex-col gap-sw-lg", children: [
|
|
2649
2651
|
/* @__PURE__ */ o("h1", { className: "text-sw-label-lg text-sw-gray-50", children: t(
|
|
2650
2652
|
"walletCompatibility.modal.title.error",
|
|
@@ -2680,9 +2682,9 @@ const Er = ({ className: e }) => {
|
|
|
2680
2682
|
)
|
|
2681
2683
|
] })
|
|
2682
2684
|
] });
|
|
2683
|
-
},
|
|
2684
|
-
Error:
|
|
2685
|
-
}),
|
|
2685
|
+
}, Hi = Object.assign(Qr, {
|
|
2686
|
+
Error: $r
|
|
2687
|
+
}), Kr = (e) => null, Hr = (e) => (t) => {
|
|
2686
2688
|
if (t instanceof W)
|
|
2687
2689
|
throw t;
|
|
2688
2690
|
const r = new W(
|
|
@@ -2690,49 +2692,49 @@ const Er = ({ className: e }) => {
|
|
|
2690
2692
|
{ cause: t }
|
|
2691
2693
|
);
|
|
2692
2694
|
throw r.context = e, r;
|
|
2693
|
-
},
|
|
2695
|
+
}, Gr = ({ children: e }) => {
|
|
2694
2696
|
const { ctx: t } = _();
|
|
2695
2697
|
return /* @__PURE__ */ o(
|
|
2696
|
-
|
|
2698
|
+
xs,
|
|
2697
2699
|
{
|
|
2698
|
-
FallbackComponent:
|
|
2699
|
-
onError:
|
|
2700
|
+
FallbackComponent: Kr,
|
|
2701
|
+
onError: Hr(t),
|
|
2700
2702
|
children: e
|
|
2701
2703
|
}
|
|
2702
2704
|
);
|
|
2703
|
-
},
|
|
2705
|
+
}, jr = new Ht({
|
|
2704
2706
|
defaultOptions: {
|
|
2705
2707
|
queries: {
|
|
2706
2708
|
staleTime: 2e3 * 60,
|
|
2707
2709
|
retry: st.env.NODE_ENV === "test" ? !1 : 3
|
|
2708
2710
|
}
|
|
2709
2711
|
}
|
|
2710
|
-
}),
|
|
2712
|
+
}), zr = ["fms", "abg", "stjack", "noear", "testnebula"], ae = {
|
|
2711
2713
|
appName: "Unknown",
|
|
2712
2714
|
appIcon: "https://wtmcxrwapthiogjpxwfr.supabase.co/storage/v1/object/public/swap-widget/unknown.svg",
|
|
2713
2715
|
slippageTolerance: 100,
|
|
2714
2716
|
// 1%
|
|
2715
2717
|
intentsAccountType: "evm",
|
|
2716
|
-
walletSupportedChains:
|
|
2718
|
+
walletSupportedChains: sn,
|
|
2717
2719
|
connectedWallets: {},
|
|
2718
2720
|
enableAutoTokensSwitching: !0,
|
|
2719
2721
|
showIntentTokens: !0,
|
|
2720
2722
|
chainsOrder: it,
|
|
2721
|
-
filterTokens: (e) => !
|
|
2723
|
+
filterTokens: (e) => !zr.includes(e.symbol.toLocaleLowerCase()),
|
|
2722
2724
|
chainsFilter: {
|
|
2723
2725
|
source: { external: "wallet-supported", intents: "none" },
|
|
2724
2726
|
target: { external: "all", intents: "none" }
|
|
2725
2727
|
}
|
|
2726
|
-
},
|
|
2728
|
+
}, Lt = at({
|
|
2727
2729
|
config: ae
|
|
2728
2730
|
}), Ue = rt({
|
|
2729
2731
|
config: ae
|
|
2730
2732
|
}), y = () => {
|
|
2731
|
-
const e =
|
|
2733
|
+
const e = Qt(Lt);
|
|
2732
2734
|
return oe(e).config;
|
|
2733
|
-
},
|
|
2735
|
+
}, Yr = (e) => {
|
|
2734
2736
|
Ue.config = pe(e);
|
|
2735
|
-
},
|
|
2737
|
+
}, Gi = ({
|
|
2736
2738
|
children: e,
|
|
2737
2739
|
config: t,
|
|
2738
2740
|
balanceViaRpc: r = !0,
|
|
@@ -2749,102 +2751,102 @@ const Er = ({ className: e }) => {
|
|
|
2749
2751
|
})
|
|
2750
2752
|
})
|
|
2751
2753
|
);
|
|
2752
|
-
return
|
|
2754
|
+
return C(() => {
|
|
2753
2755
|
const c = pe({
|
|
2754
2756
|
...ae,
|
|
2755
2757
|
...t
|
|
2756
2758
|
});
|
|
2757
|
-
Object.assign(l.current.config, c),
|
|
2758
|
-
}, [t]),
|
|
2759
|
-
/* @__PURE__ */ h(
|
|
2760
|
-
/* @__PURE__ */ h(
|
|
2759
|
+
Object.assign(l.current.config, c), Yr(c);
|
|
2760
|
+
}, [t]), Yt(s ?? {}), Ds("headlessui-portal-root", "sw"), /* @__PURE__ */ o(Gt, { client: jr, children: /* @__PURE__ */ o(zt, { i18n: qt, children: /* @__PURE__ */ h(Lt.Provider, { value: l.current, children: [
|
|
2761
|
+
/* @__PURE__ */ h(Ut, { children: [
|
|
2762
|
+
/* @__PURE__ */ h(Pt, { children: [
|
|
2761
2763
|
/* @__PURE__ */ o("link", { rel: "preconnect", href: "https://rsms.me/" }),
|
|
2762
2764
|
/* @__PURE__ */ o("link", { rel: "stylesheet", href: "https://rsms.me/inter/inter.css" })
|
|
2763
2765
|
] }),
|
|
2764
|
-
/* @__PURE__ */ o(Vr, { theme: a, children: st.env.NODE_ENV === "test" ? e : /* @__PURE__ */ o(
|
|
2766
|
+
/* @__PURE__ */ o(Vr, { theme: a, children: st.env.NODE_ENV === "test" ? e : /* @__PURE__ */ o(Gr, { children: e }) })
|
|
2765
2767
|
] }),
|
|
2766
2768
|
r && /* @__PURE__ */ o(
|
|
2767
|
-
|
|
2769
|
+
Ks,
|
|
2768
2770
|
{
|
|
2769
|
-
rpcs: n ??
|
|
2771
|
+
rpcs: n ?? vs,
|
|
2770
2772
|
connectedWallets: t.connectedWallets ?? {}
|
|
2771
2773
|
}
|
|
2772
2774
|
)
|
|
2773
2775
|
] }) }) });
|
|
2774
2776
|
};
|
|
2775
2777
|
export {
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2778
|
+
mr as $,
|
|
2779
|
+
Ki as A,
|
|
2780
|
+
Ks as B,
|
|
2781
|
+
Mr as C,
|
|
2782
|
+
Us as D,
|
|
2781
2783
|
Ge as E,
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2784
|
+
js as F,
|
|
2785
|
+
zs as G,
|
|
2786
|
+
Ys as H,
|
|
2787
|
+
Zs as I,
|
|
2788
|
+
er as J,
|
|
2789
|
+
Et as K,
|
|
2790
|
+
Ct as L,
|
|
2791
|
+
Dt as M,
|
|
2790
2792
|
Rt as N,
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
+
vt as O,
|
|
2794
|
+
tr as P,
|
|
2793
2795
|
q as Q,
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2796
|
+
nr as R,
|
|
2797
|
+
Er as S,
|
|
2798
|
+
xr as T,
|
|
2799
|
+
sr as U,
|
|
2800
|
+
rr as V,
|
|
2801
|
+
Gi as W,
|
|
2802
|
+
ar as X,
|
|
2803
|
+
or as Y,
|
|
2804
|
+
ir as Z,
|
|
2805
|
+
cr as _,
|
|
2806
|
+
Mi as a,
|
|
2807
|
+
fr as a0,
|
|
2808
|
+
Tr as a1,
|
|
2809
|
+
hr as a2,
|
|
2810
|
+
Cr as a3,
|
|
2809
2811
|
Rr as a4,
|
|
2810
2812
|
Be as a5,
|
|
2811
2813
|
qe as a6,
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2814
|
+
Ot as a7,
|
|
2815
|
+
vr as a8,
|
|
2816
|
+
Dr as a9,
|
|
2815
2817
|
Je as aa,
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2818
|
+
Ft as ab,
|
|
2819
|
+
Or as ac,
|
|
2820
|
+
Br as ad,
|
|
2819
2821
|
Vr as ae,
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2822
|
+
Qr as af,
|
|
2823
|
+
$r as ag,
|
|
2824
|
+
Gr as ah,
|
|
2823
2825
|
Ue as ai,
|
|
2824
2826
|
_ as b,
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2827
|
+
Pi as c,
|
|
2828
|
+
Gs as d,
|
|
2829
|
+
Qs as e,
|
|
2828
2830
|
ce as f,
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2831
|
+
wr as g,
|
|
2832
|
+
Js as h,
|
|
2833
|
+
kr as i,
|
|
2834
|
+
pr as j,
|
|
2833
2835
|
le as k,
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
+
Nr as l,
|
|
2837
|
+
Fr as m,
|
|
2836
2838
|
P as n,
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2839
|
+
Vi as o,
|
|
2840
|
+
Qi as p,
|
|
2841
|
+
$i as q,
|
|
2842
|
+
lr as r,
|
|
2843
|
+
xt as s,
|
|
2844
|
+
bt as t,
|
|
2843
2845
|
z as u,
|
|
2844
2846
|
W as v,
|
|
2845
2847
|
g as w,
|
|
2846
|
-
|
|
2848
|
+
Wi as x,
|
|
2847
2849
|
y,
|
|
2848
|
-
|
|
2850
|
+
Hi as z
|
|
2849
2851
|
};
|
|
2850
|
-
//# sourceMappingURL=config-
|
|
2852
|
+
//# sourceMappingURL=config-CJfcVohD.js.map
|