@aurora-is-near/intents-swap-widget 3.14.0-redesign.2 → 3.14.0-redesign.7
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/components/BlockingError.js +15 -9
- package/dist/components/BlockingError.js.map +1 -1
- package/dist/components/CloseButton.js +1 -1
- package/dist/components/CloseButton.js.map +1 -1
- package/dist/{config-Bmc4hOIl.js → config-Behl5hcc.js} +1179 -952
- package/dist/config-Behl5hcc.js.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +4 -6
- 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/index.js +1 -1
- package/dist/features/DepositMethodSwitcher.js +26 -29
- package/dist/features/DepositMethodSwitcher.js.map +1 -1
- package/dist/features/ErrorBoundary.js +1 -1
- package/dist/features/ExternalDeposit.js +27 -28
- package/dist/features/ExternalDeposit.js.map +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/SummaryItem.js +2 -2
- package/dist/features/SuccessScreen/SummaryItem.js.map +1 -1
- package/dist/features/SuccessScreen/index.js +20 -20
- package/dist/features/SuccessScreen/index.js.map +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 +1 -1
- package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js +13 -191
- package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js.map +1 -1
- package/dist/features/WalletCompatibilityCheck/index.js +21 -26
- package/dist/features/WalletCompatibilityCheck/index.js.map +1 -1
- package/dist/features/index.js +1 -1
- package/dist/hooks/index.js +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/useIntentsBalance.js +1 -1
- package/dist/hooks/useIsCompatibilityCheckRequired.d.ts +1 -1
- package/dist/hooks/useIsCompatibilityCheckRequired.js +2 -2
- package/dist/hooks/useIsCompatibilityCheckRequired.js.map +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/useToggleTheme.js +20 -17
- package/dist/hooks/useToggleTheme.js.map +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 +1 -1
- package/dist/machine/computed/getIsDirectNearTokenWithdrawal.js +1 -1
- package/dist/machine/computed/getIsDirectNearTokenWithdrawal.js.map +1 -1
- package/dist/machine/computed/getIsDirectTokenOnNearDeposit.js +1 -1
- package/dist/machine/computed/getIsDirectTokenOnNearDeposit.js.map +1 -1
- package/dist/machine/computed/getIsDirectTokenOnNearTransfer.js +1 -1
- package/dist/machine/computed/getIsDirectTokenOnNearTransfer.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/styles.css +1 -1
- package/dist/theme/ThemeProvider.js +7 -24
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/types/config.d.ts +1 -0
- package/dist/types/localisation.d.ts +1 -1
- package/dist/utils/intents/signers/near.js +1 -1
- package/dist/utils/intents/signers/privy.js +1 -1
- package/dist/utils/localstorage.js +41 -28
- package/dist/utils/localstorage.js.map +1 -1
- package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +11 -12
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js.map +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositSkeleton.js +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js +27 -26
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js.map +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapSkeleton.js +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +5 -6
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js.map +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawSkeleton.js +1 -1
- package/package.json +3 -2
- package/src/components/BlockingError.tsx +7 -4
- package/src/components/CloseButton.tsx +1 -1
- package/src/features/DepositMethodSwitcher.tsx +5 -17
- package/src/features/ExternalDeposit.tsx +8 -7
- package/src/features/SubmitButton/index.tsx +40 -0
- package/src/features/SuccessScreen/SummaryItem.tsx +2 -2
- package/src/features/SuccessScreen/index.tsx +5 -3
- package/src/features/SwapQuote/SwapQuote.tsx +1 -1
- package/src/features/WalletCompatibilityCheck/WalletCompatibilityModal.tsx +3 -0
- package/src/features/WalletCompatibilityCheck/index.tsx +4 -8
- package/src/hooks/useExternalDepositStatus/usePoaExternalDepositStatus.ts +2 -1
- package/src/hooks/useIsCompatibilityCheckRequired.ts +1 -1
- package/src/hooks/useToggleTheme.ts +11 -4
- package/src/machine/computed/getIsDirectNearTokenWithdrawal.ts +2 -1
- package/src/machine/computed/getIsDirectTokenOnNearDeposit.ts +2 -1
- package/src/machine/computed/getIsDirectTokenOnNearTransfer.ts +2 -1
- package/src/theme/ThemeProvider.tsx +33 -14
- package/src/types/config.ts +1 -0
- package/src/types/localisation.ts +4 -0
- package/src/utils/localstorage.ts +35 -10
- package/src/widgets/WidgetDeposit/WidgetDepositContent.tsx +3 -3
- package/src/widgets/WidgetSwap/WidgetSwapContent.tsx +5 -3
- package/src/widgets/WidgetWithdraw/WidgetWithdrawContent.tsx +3 -3
- package/dist/config-Bmc4hOIl.js.map +0 -1
- package/dist/features/SuccessScreen/CloseButton.d.ts +0 -5
- package/dist/features/SuccessScreen/CloseButton.js +0 -15
- package/dist/features/SuccessScreen/CloseButton.js.map +0 -1
- package/src/features/SuccessScreen/CloseButton.tsx +0 -14
|
@@ -1,152 +1,154 @@
|
|
|
1
|
-
import { p as
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import { deepClone as
|
|
5
|
-
import { snapshot as
|
|
6
|
-
import { HelmetProvider as
|
|
7
|
-
import { memo as
|
|
8
|
-
import { useQuery as
|
|
9
|
-
import { Trans as
|
|
10
|
-
import { useTypedTranslation as
|
|
1
|
+
import { p as st } from "./index-xuotMAFm.js";
|
|
2
|
+
import { jsx as o, jsxs as T, Fragment as Ft } from "react/jsx-runtime";
|
|
3
|
+
import Lt from "i18next";
|
|
4
|
+
import { deepClone as pe } from "valtio/utils";
|
|
5
|
+
import { snapshot as Ne, useSnapshot as oe, proxy as rt } from "valtio";
|
|
6
|
+
import { HelmetProvider as Bt, Helmet as qt } from "react-helmet-async";
|
|
7
|
+
import { memo as Ut, useEffect as C, useMemo as v, useRef as Y, useCallback as he, useState as re, useId as Pt, Fragment as Wt, createContext as at, useContext as Vt } from "react";
|
|
8
|
+
import { useQuery as _e, useInfiniteQuery as Mt, useQueryClient as Qt, QueryClient as $t, QueryClientProvider as Kt } from "@tanstack/react-query";
|
|
9
|
+
import { Trans as Ht, I18nextProvider as Gt } from "react-i18next";
|
|
10
|
+
import { useTypedTranslation as M, initLocalisation as jt } from "./localisation.js";
|
|
11
11
|
import { logger as b } from "./logger.js";
|
|
12
|
-
import { getTonTokenBalance as
|
|
13
|
-
import { getSolanaTokenBalance as
|
|
14
|
-
import { useWalletAddressForToken as
|
|
12
|
+
import { getTonTokenBalance as zt } from "./utils/ton/getTonTokenBalance.js";
|
|
13
|
+
import { getSolanaTokenBalance as Yt } from "./utils/solana/getSolanaTokenBalance.js";
|
|
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 { cn as
|
|
19
|
-
import { OneClickService as
|
|
20
|
-
import { CHAINS_LIST as
|
|
18
|
+
import { cn as H } from "./utils/cn.js";
|
|
19
|
+
import { OneClickService as Zt, QuoteRequest as U, GetExecutionStatusResponse as ee } from "@defuse-protocol/one-click-sdk-typescript";
|
|
20
|
+
import { CHAINS_LIST as ye, DEFAULT_CHAIN_ICON as Xt, DEFAULT_CHAINS_ORDER as it, CHAIN_POA_MAP as ct, POA_EVM_CHAIN_ID as lt, CHAIN_BASE_TOKENS as Jt, EVM_CHAIN_IDS_MAP as Te, CHAIN_IDS_MAP as en, EVM_CHAINS as tn } from "./constants/chains.js";
|
|
21
21
|
import "use-debounce";
|
|
22
|
-
import { derive as
|
|
23
|
-
import { getIsNativeNearDeposit as
|
|
24
|
-
import { getIsDirectTokenOnNearDeposit as
|
|
22
|
+
import { derive as nn } from "derive-valtio";
|
|
23
|
+
import { getIsNativeNearDeposit as sn } from "./machine/computed/getIsNativeNearDeposit.js";
|
|
24
|
+
import { getIsDirectTokenOnNearDeposit as rn } from "./machine/computed/getIsDirectTokenOnNearDeposit.js";
|
|
25
25
|
import "ethers";
|
|
26
|
-
import { moveTo as O, machine as
|
|
27
|
-
import
|
|
28
|
-
import { guardStates as
|
|
29
|
-
import { parse as
|
|
30
|
-
import { createLoader as
|
|
31
|
-
import { isAlchemySupportedChain as
|
|
26
|
+
import { moveTo as O, machine as Z } from "./machine/machine.js";
|
|
27
|
+
import an from "lodash.once";
|
|
28
|
+
import { guardStates as D } from "./machine/guards/index.js";
|
|
29
|
+
import { parse as on } from "./ext/alchemy/parse.js";
|
|
30
|
+
import { createLoader as cn } from "./ext/alchemy/load.js";
|
|
31
|
+
import { isAlchemySupportedChain as ln } from "./ext/alchemy/types.js";
|
|
32
32
|
import { fireEvent as p } from "./machine/events/utils/fireEvent.js";
|
|
33
|
-
import { NATIVE_NEAR_DUMB_ASSET_ID as
|
|
34
|
-
import { isValidChain as
|
|
33
|
+
import { NATIVE_NEAR_DUMB_ASSET_ID as $, TOKENS_DATA as be, WNEAR_ASSET_ID as ge } from "./constants/tokens.js";
|
|
34
|
+
import { isValidChain as dn } from "./utils/checkers/isValidChain.js";
|
|
35
35
|
import { useWalletBalance as Ee } from "./hooks/useWalletBalance.js";
|
|
36
|
-
import { getIntentsAccountId as
|
|
37
|
-
import { getIntentsBalances as
|
|
38
|
-
import { notReachable as
|
|
39
|
-
import { getTokenBalanceKey as
|
|
40
|
-
import { isDryQuote as
|
|
41
|
-
import { snakeCase as
|
|
42
|
-
import
|
|
43
|
-
import { oneClickApi as
|
|
44
|
-
import { formatBigToHuman as
|
|
45
|
-
import { getDryQuoteAddress as
|
|
46
|
-
import { isEvmChain as
|
|
47
|
-
import { checkNearAccountExists as
|
|
48
|
-
import { isNotEmptyAmount as
|
|
49
|
-
import { isValidBigint as
|
|
50
|
-
import { isNearAddress as
|
|
51
|
-
import { isBalanceSufficient as
|
|
52
|
-
import { isQuoteError as De, isTransferError as
|
|
53
|
-
import { isSolanaAddress as
|
|
54
|
-
import { isEvmAddress as
|
|
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
|
|
67
|
-
import { tokenSelectRotate as
|
|
68
|
-
import { errorSet as
|
|
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
|
|
81
|
-
import { getIsDirectTokenOnNearTransfer as
|
|
82
|
-
import { getIsDirectNearTokenWithdrawal as
|
|
83
|
-
import { getIsSameAssetDiffChainWithdrawal as
|
|
36
|
+
import { getIntentsAccountId as te } from "./utils/intents/getIntentsAccountId.js";
|
|
37
|
+
import { getIntentsBalances as un } from "./utils/intents/getIntentsBalance.js";
|
|
38
|
+
import { notReachable as Ce } from "./utils/notReachable.js";
|
|
39
|
+
import { getTokenBalanceKey as G } from "./utils/intents/getTokenBalanceKey.js";
|
|
40
|
+
import { isDryQuote as Re } from "./machine/guards/checks/isDryQuote.js";
|
|
41
|
+
import { snakeCase as dt } from "change-case";
|
|
42
|
+
import mn, { CanceledError as ut, AxiosError as mt } from "axios";
|
|
43
|
+
import { oneClickApi as Ie, bridgeApi as ft } from "./network.js";
|
|
44
|
+
import { formatBigToHuman as z } from "./utils/formatters/formatBigToHuman.js";
|
|
45
|
+
import { getDryQuoteAddress as Pe } from "./utils/getDryQuoteAddress.js";
|
|
46
|
+
import { isEvmChain as Q } from "./utils/evm/isEvmChain.js";
|
|
47
|
+
import { checkNearAccountExists as fn } from "./utils/near/checkNearAccountExists.js";
|
|
48
|
+
import { isNotEmptyAmount as ne } from "./utils/checkers/isNotEmptyAmount.js";
|
|
49
|
+
import { isValidBigint as pt } from "./utils/checkers/isValidBigint.js";
|
|
50
|
+
import { isNearAddress as ht } from "./utils/near/isNearAddress.js";
|
|
51
|
+
import { isBalanceSufficient as ve } from "./machine/guards/checks/isBalanceSufficient.js";
|
|
52
|
+
import { isQuoteError as De, isTransferError as xe, isAsyncSendAddressValidationError as pn } from "./machine/errors.js";
|
|
53
|
+
import { isSolanaAddress as Tt } from "./utils/solana/isSolanaAddress.js";
|
|
54
|
+
import { isEvmAddress as gt } from "./utils/evm/isEvmAddress.js";
|
|
55
|
+
import { getMainTokenByChain as hn } from "./utils/tokens/getMainTokenByChain.js";
|
|
56
|
+
import { getDefaultIntentsToken as Tn } from "./utils/tokens/getDefaultIntentsToken.js";
|
|
57
|
+
import { getTokenWithHighBalance as gn } from "./utils/tokens/getTokenWithHighBalance.js";
|
|
58
|
+
import { isQuoteIdle as In } from "./machine/subscriptions/checkers/isQuoteIdle.js";
|
|
59
|
+
import { isInputChanged as wn } from "./machine/subscriptions/checkers/isInputChanged.js";
|
|
60
|
+
import { isErrorChanged as kn } from "./machine/subscriptions/checkers/isErrorChanged.js";
|
|
61
|
+
import { isOnlyErrorChanged as An } from "./machine/subscriptions/checkers/isOnlyErrorChanged.js";
|
|
62
|
+
import { isValidInitialState as Sn } from "./machine/subscriptions/checkers/isValidInitialState.js";
|
|
63
|
+
import { isWalletDisconnected as Nn } from "./machine/subscriptions/checkers/isWalletDisconnected.js";
|
|
64
|
+
import { isSendAddressForbidden as _n } from "./machine/subscriptions/checkers/isSendAddressForbidden.js";
|
|
65
|
+
import { isAmountChangedFromQuote as yn } from "./machine/subscriptions/checkers/isAmountChangedFromQuote.js";
|
|
66
|
+
import { reset as bn } from "./machine/events/reset.js";
|
|
67
|
+
import { tokenSelectRotate as we } from "./machine/events/tokenSelectRotate.js";
|
|
68
|
+
import { errorSet as En } from "./machine/events/errorSet.js";
|
|
69
|
+
import { quoteSet as Cn } from "./machine/events/quoteSet.js";
|
|
70
|
+
import { addressSet as Rn } from "./machine/events/addressSet.js";
|
|
71
|
+
import { tokenSetAmount as vn } from "./machine/events/tokenSetAmount.js";
|
|
72
|
+
import { quoteSetStatus as Dn } from "./machine/events/quoteSetStatus.js";
|
|
73
|
+
import { depositTypeSet as xn } from "./machine/events/depositTypeSet.js";
|
|
74
|
+
import { externalDepositTxSet as On } from "./machine/events/externalDepositTxSet.js";
|
|
75
|
+
import { setInputsValidating as Fn } from "./machine/events/setInputsValidating.js";
|
|
76
|
+
import { walletAddressSet as Ln } from "./machine/events/walletAddressSet.js";
|
|
77
|
+
import { tokenSetBalance as Bn } from "./machine/events/tokenSetBalance.js";
|
|
78
|
+
import { transferSetStatus as qn } from "./machine/events/transferSetStatus.js";
|
|
79
|
+
import { getUsdTradeDelta as Un } from "./machine/computed/getUsdTradeDelta.js";
|
|
80
|
+
import { getIsDirectNonNearWithdrawal as Pn } from "./machine/computed/getIsDirectNonNearWithdrawal.js";
|
|
81
|
+
import { getIsDirectTokenOnNearTransfer as Wn } from "./machine/computed/getIsDirectTokenOnNearTransfer.js";
|
|
82
|
+
import { getIsDirectNearTokenWithdrawal as Vn } from "./machine/computed/getIsDirectNearTokenWithdrawal.js";
|
|
83
|
+
import { getIsSameAssetDiffChainWithdrawal as Mn } from "./machine/computed/getIsSameAssetDiffChainWithdrawal.js";
|
|
84
84
|
import "viem";
|
|
85
|
-
import { Button as
|
|
86
|
-
import { TinyNumber as
|
|
87
|
-
import { ErrorMessage as
|
|
88
|
-
import { FT_DEPOSIT_GAS as
|
|
89
|
-
import { a as
|
|
90
|
-
import { z as
|
|
91
|
-
import { decodeQueryResult as
|
|
92
|
-
import { nearRpcClient as
|
|
93
|
-
import { getNearNep141MinStorageBalance as
|
|
94
|
-
import { INTENTS_CONTRACT as
|
|
95
|
-
import { isEth as
|
|
96
|
-
import { useMakeEvmTransfer as
|
|
97
|
-
import { useMakeSolanaTransfer as
|
|
98
|
-
import { isUserDeniedSigning as
|
|
99
|
-
import { createIntentSignerNEP413 as
|
|
100
|
-
import { generateRandomBytes as
|
|
101
|
-
import { IntentSignerSolana as
|
|
102
|
-
import { localStorageTyped as
|
|
103
|
-
import { queryContract as
|
|
104
|
-
import { utils as
|
|
105
|
-
import { getTransactionLink as
|
|
106
|
-
import { switchEthereumChain as
|
|
85
|
+
import { Button as A } from "./components/Button.js";
|
|
86
|
+
import { TinyNumber as Oe } from "./components/TinyNumber.js";
|
|
87
|
+
import { ErrorMessage as K } from "./components/ErrorMessage.js";
|
|
88
|
+
import { FT_DEPOSIT_GAS as We, FT_TRANSFER_GAS as Ve } from "./utils/near/config.js";
|
|
89
|
+
import { a as Fe } from "./index-DEq3oXQF.js";
|
|
90
|
+
import { z as se } from "zod";
|
|
91
|
+
import { decodeQueryResult as Qn } from "./utils/near/decodeQueryResult.js";
|
|
92
|
+
import { nearRpcClient as $n } from "./utils/near/rpc.js";
|
|
93
|
+
import { getNearNep141MinStorageBalance as Kn } from "./utils/near/getNearNep141MinStorageBalance.js";
|
|
94
|
+
import { INTENTS_CONTRACT as ke } from "./constants/intents.js";
|
|
95
|
+
import { isEth as Hn } from "./utils/evm/isEth.js";
|
|
96
|
+
import { useMakeEvmTransfer as Gn } from "./hooks/useMakeEvmTransfer.js";
|
|
97
|
+
import { useMakeSolanaTransfer as jn } from "./hooks/useMakeSolanaTransfer.js";
|
|
98
|
+
import { isUserDeniedSigning as Ae } from "./utils/checkers/isUserDeniedSigning.js";
|
|
99
|
+
import { createIntentSignerNEP413 as zn, BridgeSDK as Yn, createNearWithdrawalRoute as Zn, createInternalTransferRoute as Xn } from "@defuse-protocol/bridge-sdk";
|
|
100
|
+
import { generateRandomBytes as Jn } from "./utils/near/getRandomBytes.js";
|
|
101
|
+
import { IntentSignerSolana as es } from "./utils/intents/signers/solana.js";
|
|
102
|
+
import { localStorageTyped as Me } from "./utils/localstorage.js";
|
|
103
|
+
import { queryContract as ts } from "./utils/near/queryContract.js";
|
|
104
|
+
import { utils as Qe } from "@defuse-protocol/internal-utils";
|
|
105
|
+
import { getTransactionLink as ns } from "./utils/formatters/getTransactionLink.js";
|
|
106
|
+
import { switchEthereumChain as ss } from "./utils/evm/switchEthereumChain.js";
|
|
107
107
|
import "copy-text-to-clipboard";
|
|
108
|
-
import { SwapQuoteSkeleton as
|
|
109
|
-
import { Notes as
|
|
110
|
-
import { Accordion as
|
|
111
|
-
import { formatUsdAmount as
|
|
112
|
-
import { formatTinyNumber as
|
|
113
|
-
import
|
|
114
|
-
import { Skeleton as
|
|
115
|
-
import { getBalancePortion as
|
|
116
|
-
import { getUsdDisplayAmount as
|
|
117
|
-
import { TokenInputHeading as
|
|
118
|
-
import { noop as
|
|
119
|
-
import { Card as
|
|
120
|
-
import { Badge as
|
|
121
|
-
import { TokenIcon as
|
|
122
|
-
import { InputAmount as
|
|
123
|
-
import { TokenInputSkeleton as
|
|
124
|
-
import { getUsdDisplayBalance as
|
|
125
|
-
import { VList as
|
|
126
|
-
import { TokensListPlaceholder as
|
|
127
|
-
import { Hr as
|
|
128
|
-
import { createTokenSorter as
|
|
129
|
-
import { createFilterByIntents as
|
|
130
|
-
import { createFilterBySearch as
|
|
131
|
-
import { createFilterBySelectedChain as
|
|
108
|
+
import { SwapQuoteSkeleton as It } from "./features/SwapQuote/SwapQuoteSkeleton.js";
|
|
109
|
+
import { Notes as de } from "./components/Notes.js";
|
|
110
|
+
import { Accordion as rs } from "./components/Accordion.js";
|
|
111
|
+
import { formatUsdAmount as $e } from "./utils/formatters/formatUsdAmount.js";
|
|
112
|
+
import { formatTinyNumber as as } from "./utils/formatters/formatTinyNumber.js";
|
|
113
|
+
import os from "clsx";
|
|
114
|
+
import { Skeleton as is } from "./components/Skeleton.js";
|
|
115
|
+
import { getBalancePortion as cs } from "./features/TokenInput/utils/getBalancePortion.js";
|
|
116
|
+
import { getUsdDisplayAmount as ls } from "./features/TokenInput/utils/getUsdDisplayAmount.js";
|
|
117
|
+
import { TokenInputHeading as wt } from "./features/TokenInput/TokenInputHeading.js";
|
|
118
|
+
import { noop as ds } from "./utils/noop.js";
|
|
119
|
+
import { Card as ie } from "./components/Card.js";
|
|
120
|
+
import { Badge as Ke } from "./components/Badge.js";
|
|
121
|
+
import { TokenIcon as kt } from "./components/TokenIcon.js";
|
|
122
|
+
import { InputAmount as us } from "./components/InputAmount.js";
|
|
123
|
+
import { TokenInputSkeleton as ms } from "./features/TokenInput/TokenInputSkeleton.js";
|
|
124
|
+
import { getUsdDisplayBalance as fs } from "./utils/formatters/getUsdDisplayBalance.js";
|
|
125
|
+
import { VList as ps } from "virtua";
|
|
126
|
+
import { TokensListPlaceholder as Se } from "./features/TokensList/TokensListPlaceholder.js";
|
|
127
|
+
import { Hr as hs } from "./components/Hr.js";
|
|
128
|
+
import { createTokenSorter as Ts } from "./utils/tokens/sort.js";
|
|
129
|
+
import { createFilterByIntents as He } from "./utils/tokens/filterByIntents.js";
|
|
130
|
+
import { createFilterBySearch as gs } from "./utils/tokens/filterBySearchString.js";
|
|
131
|
+
import { createFilterBySelectedChain as Is } from "./utils/tokens/filterBySelectedChain.js";
|
|
132
132
|
import "bs58";
|
|
133
133
|
import "viem/chains";
|
|
134
|
-
import "browser-or-node";
|
|
134
|
+
import { isBrowser as At } from "browser-or-node";
|
|
135
135
|
import "qrcode.react";
|
|
136
|
-
import {
|
|
137
|
-
import "
|
|
138
|
-
import {
|
|
139
|
-
import {
|
|
140
|
-
import {
|
|
141
|
-
import {
|
|
142
|
-
import {
|
|
143
|
-
import {
|
|
144
|
-
import {
|
|
145
|
-
import {
|
|
146
|
-
import {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
136
|
+
import { createColorPalette as ws } from "./theme/createColorPalette.js";
|
|
137
|
+
import { ArmingCountdownFill as ks, BeenhereFill as As, EncryptedFill as Ss, AccountBalanceWalletFill as Ns, CheckCircleFill as _s, GppBadFill as ys } from "@material-symbols-svg/react-rounded";
|
|
138
|
+
import { useTimer as bs } from "use-timer";
|
|
139
|
+
import { CloseButton as St } from "./components/CloseButton.js";
|
|
140
|
+
import { DEFAULT_RPCS as Es } from "./rpcs.js";
|
|
141
|
+
import { useAddClassToPortal as Cs } from "./hooks/useAddClassToPortal.js";
|
|
142
|
+
import { ErrorBoundary as Rs } from "react-error-boundary";
|
|
143
|
+
import { isEvmToken as vs } from "./utils/evm/isEvmToken.js";
|
|
144
|
+
import { isEvmBaseToken as Ds } from "./utils/evm/isEvmBaseToken.js";
|
|
145
|
+
import { getEvmMainTokenBalance as xs } from "./utils/evm/getEvmMainTokenBalance.js";
|
|
146
|
+
import { getNativeNearBalance as Os } from "./utils/near/getNativeNearBalance.js";
|
|
147
|
+
import { getNearTokenBalance as Fs } from "./utils/near/getNearTokenBalance.js";
|
|
148
|
+
import { getEvmTokenBalance as Ls } from "./utils/evm/getEvmTokenBalance.js";
|
|
149
|
+
function Bs({ rpcs: e, token: t, connectedWallets: r }) {
|
|
150
|
+
const { walletSupportedChains: s, tonCenterApiKey: n, alchemyApiKey: a } = y(), { walletAddress: l } = ot(r, t);
|
|
151
|
+
return _e({
|
|
150
152
|
retry: 2,
|
|
151
153
|
enabled: !!l && Object.keys(e).includes(t.blockchain),
|
|
152
154
|
queryKey: ["tokenBalance", t.assetId, r],
|
|
@@ -154,49 +156,49 @@ function Ns({ rpcs: e, token: t, connectedWallets: r }) {
|
|
|
154
156
|
if (!l)
|
|
155
157
|
return null;
|
|
156
158
|
if (t.blockchain === "near" && s.includes(t.blockchain))
|
|
157
|
-
return !e.near || e.near.length === 0 ? null : t.assetId ===
|
|
158
|
-
if (!s.includes("eth") &&
|
|
159
|
+
return !e.near || e.near.length === 0 ? null : t.assetId === $ ? Os(l, e.near) : Fs(t, l, e.near);
|
|
160
|
+
if (!s.includes("eth") && Q(t.blockchain))
|
|
159
161
|
return null;
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
return
|
|
162
|
+
if (Q(t.blockchain) && Ds(t)) {
|
|
163
|
+
const c = e[t.blockchain] ?? [];
|
|
164
|
+
return c.length > 0 ? xs(l, c[0]) : null;
|
|
163
165
|
}
|
|
164
|
-
if (
|
|
165
|
-
const
|
|
166
|
-
return
|
|
166
|
+
if (vs(t) || Q(t.blockchain)) {
|
|
167
|
+
const c = e[t.blockchain] ?? [];
|
|
168
|
+
return c.length > 0 ? Ls(t, l, c[0]) : null;
|
|
167
169
|
}
|
|
168
|
-
return t.blockchain === "ton" ?
|
|
170
|
+
return t.blockchain === "ton" ? zt(t, l, n) : t.blockchain === "sol" && s.includes(t.blockchain) ? Yt(t, l, a) : (b.warn(
|
|
169
171
|
`Failed to fetch token balance for ${t.symbol} on ${t.blockchain}`
|
|
170
172
|
), null);
|
|
171
173
|
}
|
|
172
174
|
});
|
|
173
175
|
}
|
|
174
|
-
const
|
|
176
|
+
const qs = ({
|
|
175
177
|
rpcs: e,
|
|
176
178
|
token: t,
|
|
177
179
|
onBalancesLoaded: r
|
|
178
|
-
}) => (
|
|
180
|
+
}) => (C(() => {
|
|
179
181
|
t.isIntent || !Object.keys(e).includes(t.blockchain) || r({ [t.assetId]: "0" });
|
|
180
|
-
}, [t.assetId]), null),
|
|
182
|
+
}, [t.assetId]), null), Nt = Ut(
|
|
181
183
|
({ rpcs: e, token: t, connectedWallets: r, onBalancesLoaded: s }) => {
|
|
182
|
-
const { data: n } =
|
|
184
|
+
const { data: n } = Bs({
|
|
183
185
|
rpcs: e,
|
|
184
186
|
token: t,
|
|
185
187
|
connectedWallets: r
|
|
186
188
|
});
|
|
187
|
-
return
|
|
189
|
+
return C(() => {
|
|
188
190
|
!t.isIntent && n != null && s({ [t.assetId]: n });
|
|
189
191
|
}, [t, n, s]), null;
|
|
190
192
|
},
|
|
191
193
|
(e, t) => e.token.assetId === t.token.assetId && e.connectedWallets === t.connectedWallets
|
|
192
194
|
);
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
Zero:
|
|
196
|
-
}),
|
|
195
|
+
Nt.displayName = "TokenBalanceLoader";
|
|
196
|
+
const Ge = Object.assign(Nt, {
|
|
197
|
+
Zero: qs
|
|
198
|
+
}), Us = (e) => {
|
|
197
199
|
const t = e.toLowerCase();
|
|
198
|
-
return
|
|
199
|
-
},
|
|
200
|
+
return be[t]?.icon ?? "";
|
|
201
|
+
}, je = (e) => ye[e].icon ?? Xt, Ps = (e) => `${e?.charAt(0).toUpperCase()}${e?.slice(1)}`, Ws = (e) => be[e]?.name ?? e, P = (e) => {
|
|
200
202
|
const {
|
|
201
203
|
showIntentTokens: t,
|
|
202
204
|
allowedTokensList: r,
|
|
@@ -204,58 +206,58 @@ const Ke = Object.assign(gt, {
|
|
|
204
206
|
allowedTargetTokensList: n,
|
|
205
207
|
filterTokens: a,
|
|
206
208
|
fetchSourceTokens: l,
|
|
207
|
-
fetchTargetTokens:
|
|
208
|
-
} =
|
|
209
|
+
fetchTargetTokens: c
|
|
210
|
+
} = y(), { data: d, ...u } = _e({
|
|
209
211
|
queryKey: ["tokens", e].filter(Boolean),
|
|
210
|
-
queryFn: async () => e === "source" && l ? l() : e === "target" &&
|
|
211
|
-
}),
|
|
212
|
+
queryFn: async () => e === "source" && l ? l() : e === "target" && c ? c() : Zt.getTokens()
|
|
213
|
+
}), i = v(() => {
|
|
212
214
|
if (!d)
|
|
213
215
|
return [];
|
|
214
216
|
const m = d.map((f) => {
|
|
215
|
-
const
|
|
216
|
-
return !
|
|
217
|
+
const w = f.blockchain.toLowerCase();
|
|
218
|
+
return !dn(w) || r && !r.includes(f.assetId) || e === "source" && s && !s.includes(f.assetId) || e === "target" && n && !n.includes(f.assetId) ? null : {
|
|
217
219
|
assetId: f.assetId,
|
|
218
220
|
symbol: f.symbol,
|
|
219
221
|
decimals: f.decimals,
|
|
220
222
|
price: f.price,
|
|
221
|
-
blockchain:
|
|
223
|
+
blockchain: w,
|
|
222
224
|
isIntent: !1,
|
|
223
|
-
icon: f.icon ??
|
|
224
|
-
name:
|
|
225
|
-
chainIcon:
|
|
226
|
-
chainName:
|
|
225
|
+
icon: f.icon ?? Us(f.symbol),
|
|
226
|
+
name: Ws(f.symbol),
|
|
227
|
+
chainIcon: je(w),
|
|
228
|
+
chainName: ye[f.blockchain]?.label ?? Ps(f.blockchain),
|
|
227
229
|
contractAddress: f.contractAddress
|
|
228
230
|
};
|
|
229
|
-
}).filter((f) => !!f).filter(a ?? (() => !0)),
|
|
231
|
+
}).filter((f) => !!f).filter(a ?? (() => !0)), h = m.filter(
|
|
230
232
|
(f) => f.symbol.toLowerCase() !== "wnear"
|
|
231
|
-
),
|
|
232
|
-
return
|
|
233
|
+
), g = m.find((f) => f.symbol.toLowerCase() === "wnear");
|
|
234
|
+
return g && h.push({
|
|
233
235
|
name: "NEAR",
|
|
234
236
|
symbol: "NEAR",
|
|
235
237
|
chainName: "Near",
|
|
236
238
|
blockchain: "near",
|
|
237
|
-
assetId:
|
|
238
|
-
chainIcon:
|
|
239
|
-
icon:
|
|
240
|
-
price:
|
|
241
|
-
contractAddress:
|
|
239
|
+
assetId: $,
|
|
240
|
+
chainIcon: je("near"),
|
|
241
|
+
icon: be.near?.icon ?? "",
|
|
242
|
+
price: g?.price ?? 0,
|
|
243
|
+
contractAddress: g?.contractAddress,
|
|
242
244
|
isIntent: !1,
|
|
243
245
|
decimals: 24
|
|
244
246
|
}), t ? [
|
|
245
|
-
...
|
|
247
|
+
...h,
|
|
246
248
|
// add intents tokens to the full list
|
|
247
249
|
...m.map(
|
|
248
250
|
(f) => f.symbol.toLowerCase() === "wnear" ? { ...f, symbol: "NEAR", name: "NEAR", isIntent: !0 } : { ...f, isIntent: !0 }
|
|
249
251
|
)
|
|
250
|
-
] :
|
|
252
|
+
] : h;
|
|
251
253
|
}, [d, t, a]);
|
|
252
254
|
return {
|
|
253
255
|
...u,
|
|
254
|
-
tokens:
|
|
256
|
+
tokens: i
|
|
255
257
|
};
|
|
256
|
-
},
|
|
258
|
+
}, Vs = () => {
|
|
257
259
|
const { tokens: e } = P(), { tokens: t } = P("source"), { tokens: r } = P("target");
|
|
258
|
-
return { tokens:
|
|
260
|
+
return { tokens: v(() => {
|
|
259
261
|
const n = {};
|
|
260
262
|
return [
|
|
261
263
|
...e,
|
|
@@ -266,169 +268,169 @@ const Ke = Object.assign(gt, {
|
|
|
266
268
|
n[l] = a;
|
|
267
269
|
}), Object.values(n);
|
|
268
270
|
}, [e, t, r]) };
|
|
269
|
-
},
|
|
271
|
+
}, ue = [
|
|
270
272
|
{ eth: ["ETH", "USDT", "USDC", "AURORA"] },
|
|
271
273
|
{ near: ["USDT", "USDC", "AURORA"] },
|
|
272
274
|
{ arb: ["ARB", "ETH", "USDT", "USDC"] },
|
|
273
275
|
{ btc: ["BTC"] }
|
|
274
|
-
],
|
|
275
|
-
const s =
|
|
276
|
+
], Ms = (e) => [...e].sort((t, r) => {
|
|
277
|
+
const s = ue.findIndex(
|
|
276
278
|
(d) => Object.keys(d)[0] === t.blockchain
|
|
277
|
-
), n =
|
|
279
|
+
), n = ue.findIndex(
|
|
278
280
|
(d) => Object.keys(d)[0] === r.blockchain
|
|
279
281
|
);
|
|
280
282
|
if (s !== n)
|
|
281
283
|
return s === -1 ? 1 : n === -1 ? -1 : s - n;
|
|
282
|
-
const a =
|
|
283
|
-
return l === -1 &&
|
|
284
|
-
}),
|
|
285
|
-
const { tokens: r } =
|
|
286
|
-
return
|
|
287
|
-
|
|
284
|
+
const a = ue[s]?.[t.blockchain] ?? [], l = a.indexOf(t.symbol), c = a.indexOf(r.symbol);
|
|
285
|
+
return l === -1 && c === -1 ? 0 : l === -1 ? 1 : c === -1 ? -1 : l - c;
|
|
286
|
+
}), Qs = ({ rpcs: e, connectedWallets: t }) => {
|
|
287
|
+
const { tokens: r } = Vs(), { walletSupportedChains: s } = y(), { setWalletBalance: n } = Ee(t);
|
|
288
|
+
return v(() => Ms(r), [r]).map((l) => s.includes(l.blockchain) ? /* @__PURE__ */ o(
|
|
289
|
+
Ge,
|
|
288
290
|
{
|
|
289
291
|
rpcs: e,
|
|
290
292
|
token: l,
|
|
291
293
|
connectedWallets: t,
|
|
292
|
-
onBalancesLoaded: (
|
|
294
|
+
onBalancesLoaded: (c) => n(t, c)
|
|
293
295
|
},
|
|
294
|
-
|
|
295
|
-
) : /* @__PURE__ */
|
|
296
|
-
|
|
296
|
+
G(l)
|
|
297
|
+
) : /* @__PURE__ */ o(
|
|
298
|
+
Ge.Zero,
|
|
297
299
|
{
|
|
298
300
|
rpcs: e,
|
|
299
301
|
token: l,
|
|
300
|
-
onBalancesLoaded: (
|
|
302
|
+
onBalancesLoaded: (c) => n(t, c)
|
|
301
303
|
},
|
|
302
|
-
|
|
304
|
+
G(l)
|
|
303
305
|
));
|
|
304
306
|
};
|
|
305
|
-
function
|
|
307
|
+
function $s(e, t) {
|
|
306
308
|
const r = Array.from(
|
|
307
|
-
/* @__PURE__ */ new Set([...t ?? [], ...
|
|
309
|
+
/* @__PURE__ */ new Set([...t ?? [], ...it])
|
|
308
310
|
), s = new Map(r.map((n, a) => [n, a]));
|
|
309
311
|
return [...e].sort((n, a) => {
|
|
310
|
-
const l = s.has(n.id) ? s.get(n.id) : 1 / 0,
|
|
311
|
-
return l !==
|
|
312
|
+
const l = s.has(n.id) ? s.get(n.id) : 1 / 0, c = s.has(a.id) ? s.get(a.id) : 1 / 0;
|
|
313
|
+
return l !== c ? l - c : n.id.localeCompare(a.id, void 0, { sensitivity: "base" });
|
|
312
314
|
});
|
|
313
315
|
}
|
|
314
|
-
const
|
|
316
|
+
const Ks = (e) => {
|
|
315
317
|
const {
|
|
316
318
|
chainsOrder: t,
|
|
317
319
|
allowedChainsList: r,
|
|
318
320
|
allowedSourceChainsList: s,
|
|
319
321
|
allowedTargetChainsList: n
|
|
320
|
-
} =
|
|
321
|
-
return
|
|
322
|
+
} = y(), { tokens: a } = P();
|
|
323
|
+
return v(() => {
|
|
322
324
|
const l = Array.from(
|
|
323
|
-
new Set(a.map((
|
|
324
|
-
).filter((
|
|
325
|
-
return
|
|
325
|
+
new Set(a.map((c) => ye[c.blockchain]))
|
|
326
|
+
).filter((c) => !(r && !r.includes(c.id) || e === "source" && s && !s.includes(c.id) || e === "target" && n && !n.includes(c.id)));
|
|
327
|
+
return $s(l, t);
|
|
326
328
|
}, [a, t, r]);
|
|
327
|
-
},
|
|
329
|
+
}, ze = 3, _t = ({
|
|
328
330
|
connectedWallets: e,
|
|
329
331
|
alchemyApiKey: t,
|
|
330
332
|
...r
|
|
331
333
|
}) => {
|
|
332
|
-
const { ctx: s } =
|
|
334
|
+
const { ctx: s } = _(), { tokens: n } = P(), { walletSupportedChains: a } = y(), { setWalletBalance: l } = Ee(e), c = r.isEnabled && !!Object.values(e).length && a.length > 0, d = Mt({
|
|
333
335
|
initialPageParam: null,
|
|
334
|
-
enabled: !!
|
|
336
|
+
enabled: !!c && !!t,
|
|
335
337
|
queryKey: ["walletTokensBalance", e],
|
|
336
|
-
queryFn: async ({ pageParam:
|
|
337
|
-
pageParam:
|
|
338
|
+
queryFn: async ({ pageParam: i }) => cn({ alchemyApiKey: t })({
|
|
339
|
+
pageParam: i ? `${i}` : null,
|
|
338
340
|
connectedWallets: e,
|
|
339
341
|
walletSupportedChains: a
|
|
340
342
|
}),
|
|
341
|
-
getNextPageParam: (
|
|
342
|
-
if (
|
|
343
|
-
return
|
|
343
|
+
getNextPageParam: (i, m) => {
|
|
344
|
+
if (i.pageKey && !(m.length >= ze))
|
|
345
|
+
return i.pageKey;
|
|
344
346
|
}
|
|
345
347
|
});
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}, [
|
|
349
|
-
const u =
|
|
348
|
+
C(() => {
|
|
349
|
+
c && d.data && d.hasNextPage && d.data.pages.length < ze && !d.isFetchingNextPage && d.fetchNextPage();
|
|
350
|
+
}, [c, d]);
|
|
351
|
+
const u = v(() => {
|
|
350
352
|
if (!d.data?.pages)
|
|
351
353
|
return {};
|
|
352
|
-
const
|
|
354
|
+
const i = on(
|
|
353
355
|
n,
|
|
354
356
|
d.data.pages.flatMap((m) => m.data)
|
|
355
357
|
);
|
|
356
358
|
return n.forEach((m) => {
|
|
357
|
-
|
|
358
|
-
}),
|
|
359
|
+
ln(m.blockchain) && !(m.assetId in i) && (i[m.assetId] = "0");
|
|
360
|
+
}), i;
|
|
359
361
|
}, [d.data, n]);
|
|
360
|
-
return
|
|
361
|
-
|
|
362
|
+
return C(() => {
|
|
363
|
+
D(s, ["initial_wallet"]) && (l(e, u), s.sourceToken && Object.keys(u).includes(s.sourceToken.assetId) && p("tokenSetBalance", u[s.sourceToken.assetId]));
|
|
362
364
|
}, [u]), {
|
|
363
365
|
status: d.status,
|
|
364
366
|
refetch: d.refetch,
|
|
365
367
|
balances: u
|
|
366
368
|
};
|
|
367
|
-
},
|
|
368
|
-
const { intentsAccountType: e } =
|
|
369
|
+
}, ce = () => {
|
|
370
|
+
const { intentsAccountType: e } = y(), {
|
|
369
371
|
ctx: { walletAddress: t }
|
|
370
|
-
} =
|
|
372
|
+
} = _(), { tokens: r } = P(), s = r.filter((c) => c.isIntent).map((c) => c.assetId), n = te({
|
|
371
373
|
walletAddress: t,
|
|
372
374
|
addressType: e
|
|
373
|
-
}), a =
|
|
375
|
+
}), a = _e({
|
|
374
376
|
enabled: !!t && !!n && r.length > 0,
|
|
375
377
|
queryKey: ["intentsBalances", n],
|
|
376
|
-
queryFn: async () => n ? await
|
|
377
|
-
}), l =
|
|
378
|
+
queryFn: async () => n ? await un(n, s) : {}
|
|
379
|
+
}), l = v(() => {
|
|
378
380
|
switch (a.status) {
|
|
379
381
|
case "error":
|
|
380
382
|
return b.error("Unable to load intents balances:", a.error), {};
|
|
381
383
|
case "success":
|
|
382
384
|
return Object.fromEntries(
|
|
383
|
-
Object.entries(a.data).map(([
|
|
384
|
-
`intent-${
|
|
385
|
+
Object.entries(a.data).map(([c, d]) => [
|
|
386
|
+
`intent-${c}`,
|
|
385
387
|
d
|
|
386
388
|
])
|
|
387
389
|
);
|
|
388
390
|
case "pending":
|
|
389
391
|
return {};
|
|
390
392
|
default:
|
|
391
|
-
return
|
|
393
|
+
return Ce(a, { throwError: !1 }), {};
|
|
392
394
|
}
|
|
393
395
|
}, [a]) ?? {};
|
|
394
396
|
return {
|
|
395
397
|
...a,
|
|
396
398
|
intentBalances: l
|
|
397
399
|
};
|
|
398
|
-
},
|
|
400
|
+
}, Hs = ({
|
|
399
401
|
isEnabled: e,
|
|
400
402
|
alchemyApiKey: t
|
|
401
403
|
}) => {
|
|
402
|
-
const { connectedWallets: r } =
|
|
404
|
+
const { connectedWallets: r } = y(), { ctx: s } = _(), n = Qt(), { refetch: a } = ce(), { refetch: l } = _t({
|
|
403
405
|
isEnabled: e,
|
|
404
406
|
connectedWallets: r,
|
|
405
407
|
alchemyApiKey: t ?? ""
|
|
406
408
|
});
|
|
407
|
-
|
|
408
|
-
const
|
|
409
|
-
!e || !
|
|
409
|
+
C(() => {
|
|
410
|
+
const c = D(s, ["transfer_success"]);
|
|
411
|
+
!e || !c || (async () => (await a(), t && (await new Promise((d) => {
|
|
410
412
|
setTimeout(d, 1e4);
|
|
411
413
|
}), await l()), await n.invalidateQueries({ queryKey: ["tokenBalance"] })))();
|
|
412
414
|
}, [s.state, e, t]);
|
|
413
|
-
},
|
|
414
|
-
const { connectedWallets: e } =
|
|
415
|
-
return { mergedBalance:
|
|
415
|
+
}, le = () => {
|
|
416
|
+
const { connectedWallets: e } = y(), { intentBalances: t } = ce(), { walletBalance: r } = Ee(e);
|
|
417
|
+
return { mergedBalance: v(
|
|
416
418
|
() => ({ ...r, ...t }),
|
|
417
419
|
[r, t]
|
|
418
420
|
) };
|
|
419
|
-
},
|
|
420
|
-
const { ctx: t } =
|
|
421
|
-
|
|
421
|
+
}, Gs = ({ isEnabled: e }) => {
|
|
422
|
+
const { ctx: t } = _(), { mergedBalance: r } = le();
|
|
423
|
+
C(() => {
|
|
422
424
|
if (!e)
|
|
423
425
|
return;
|
|
424
426
|
if (!t.sourceToken || !t.walletAddress) {
|
|
425
427
|
p("tokenSetBalance", void 0);
|
|
426
428
|
return;
|
|
427
429
|
}
|
|
428
|
-
const s =
|
|
430
|
+
const s = G(t.sourceToken);
|
|
429
431
|
p("tokenSetBalance", r[s]);
|
|
430
432
|
}, [r, t.sourceToken]);
|
|
431
|
-
},
|
|
433
|
+
}, Ye = {
|
|
432
434
|
// cbBTC (eth)
|
|
433
435
|
"nep141:eth-0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf.omft.near": "nep141:nbtc.bridge.near",
|
|
434
436
|
// cbBTC (base)
|
|
@@ -443,11 +445,11 @@ const xs = (e) => {
|
|
|
443
445
|
"nep245:v2_1.omni.hot.tg:56_SZzgw3HSudhZcTwPWUTi2RJB19t": "nep141:wrap.near",
|
|
444
446
|
// BTC (near)
|
|
445
447
|
"nep141:btc.omft.near": "nep141:nbtc.bridge.near"
|
|
446
|
-
},
|
|
448
|
+
}, js = ({
|
|
447
449
|
isEnabled: e
|
|
448
450
|
}) => {
|
|
449
|
-
const { ctx: t } =
|
|
450
|
-
|
|
451
|
+
const { ctx: t } = _(), { tokens: r } = P();
|
|
452
|
+
C(() => {
|
|
451
453
|
if (!e)
|
|
452
454
|
return;
|
|
453
455
|
if (!t.sourceToken) {
|
|
@@ -455,121 +457,121 @@ const xs = (e) => {
|
|
|
455
457
|
return;
|
|
456
458
|
}
|
|
457
459
|
const { sourceToken: s } = t;
|
|
458
|
-
if (t.sourceToken.assetId in
|
|
459
|
-
const
|
|
460
|
-
(d) => d.isIntent && d.assetId ===
|
|
460
|
+
if (t.sourceToken.assetId in Ye) {
|
|
461
|
+
const c = r.find(
|
|
462
|
+
(d) => d.isIntent && d.assetId === Ye[s.assetId]
|
|
461
463
|
);
|
|
462
464
|
p("tokenSelect", {
|
|
463
465
|
variant: "target",
|
|
464
|
-
token:
|
|
466
|
+
token: c
|
|
465
467
|
});
|
|
466
468
|
return;
|
|
467
469
|
}
|
|
468
470
|
const n = r.find(
|
|
469
|
-
(
|
|
471
|
+
(c) => c.isIntent && c.symbol === s.symbol && c.blockchain === "near"
|
|
470
472
|
);
|
|
471
473
|
if (n) {
|
|
472
474
|
p("tokenSelect", { variant: "target", token: n });
|
|
473
475
|
return;
|
|
474
476
|
}
|
|
475
477
|
const a = r.find(
|
|
476
|
-
(
|
|
478
|
+
(c) => c.isIntent && c.assetId === s.assetId
|
|
477
479
|
), l = r.find(
|
|
478
|
-
(
|
|
480
|
+
(c) => c.isIntent && c.symbol === "USDC" && c.blockchain === "near"
|
|
479
481
|
);
|
|
480
482
|
p("tokenSelect", {
|
|
481
483
|
variant: "target",
|
|
482
484
|
token: a ?? l
|
|
483
485
|
});
|
|
484
486
|
}, [r, t.sourceToken]);
|
|
485
|
-
},
|
|
486
|
-
const { connectedWallets: t } =
|
|
487
|
+
}, zs = ({ isEnabled: e }) => {
|
|
488
|
+
const { connectedWallets: t } = y(), { ctx: r, state: s } = _(), { walletAddress: n } = ot(
|
|
487
489
|
t,
|
|
488
490
|
r.sourceToken
|
|
489
491
|
);
|
|
490
|
-
|
|
492
|
+
C(() => {
|
|
491
493
|
if (!e)
|
|
492
494
|
return;
|
|
493
|
-
p("walletAddressSet", n),
|
|
495
|
+
p("walletAddressSet", n), D(r, ["initial_dry", "initial_wallet"]) && (s === "initial_wallet" && !n ? O("initial_dry") : s === "initial_dry" && n && O("initial_wallet"));
|
|
494
496
|
}, [e, n, r, s]);
|
|
495
|
-
},
|
|
497
|
+
}, Ys = (e) => (["depositAddress"].forEach((t) => {
|
|
496
498
|
if (!(t in e))
|
|
497
499
|
return b.error(`Missing ${t} in quote response`), !1;
|
|
498
|
-
}), !0),
|
|
499
|
-
const { ctx: e } =
|
|
500
|
+
}), !0), Zs = () => {
|
|
501
|
+
const { ctx: e } = _(), {
|
|
500
502
|
walletSupportedChains: t,
|
|
501
503
|
intentsAccountType: r,
|
|
502
504
|
appName: s,
|
|
503
505
|
appFees: n,
|
|
504
506
|
fetchQuote: a,
|
|
505
507
|
slippageTolerance: l
|
|
506
|
-
} =
|
|
508
|
+
} = y(), c = Re(e), d = Y(null), u = Y(new AbortController()), i = v(() => async (h, g) => {
|
|
507
509
|
const { signal: f } = u.current;
|
|
508
|
-
return a ? a(
|
|
509
|
-
...
|
|
510
|
+
return a ? a(h, {
|
|
511
|
+
...g,
|
|
510
512
|
signal: f
|
|
511
|
-
}) : (await
|
|
513
|
+
}) : (await Ie.post(
|
|
512
514
|
"https://1click.chaindefuser.com/v0/quote",
|
|
513
|
-
|
|
515
|
+
h,
|
|
514
516
|
{ signal: f }
|
|
515
517
|
)).data.quote;
|
|
516
|
-
}, [
|
|
518
|
+
}, [Ie]);
|
|
517
519
|
return {
|
|
518
520
|
make: async ({
|
|
519
|
-
message:
|
|
520
|
-
quoteType:
|
|
521
|
+
message: h,
|
|
522
|
+
quoteType: g = "exact_in",
|
|
521
523
|
options: f = {}
|
|
522
524
|
} = {}) => {
|
|
523
|
-
if (!
|
|
525
|
+
if (!D(e, [
|
|
524
526
|
"input_valid_dry",
|
|
525
527
|
"input_valid_external",
|
|
526
528
|
"input_valid_internal",
|
|
527
529
|
"quote_success_internal",
|
|
528
530
|
"quote_success_external"
|
|
529
531
|
])) {
|
|
530
|
-
const
|
|
531
|
-
throw b.error(`[WIDGET] ${
|
|
532
|
+
const k = `Unable to run quote in current state ${e.state}`;
|
|
533
|
+
throw b.error(`[WIDGET] ${k}`), new q({
|
|
532
534
|
code: "QUOTE_INVALID_INITIAL",
|
|
533
|
-
meta: { isDry:
|
|
535
|
+
meta: { isDry: c, message: k }
|
|
534
536
|
});
|
|
535
537
|
}
|
|
536
|
-
const S =
|
|
538
|
+
const S = te({
|
|
537
539
|
addressType: r,
|
|
538
|
-
walletAddress:
|
|
540
|
+
walletAddress: c ? (
|
|
539
541
|
// address on the target chain should be a dry quote recipient
|
|
540
|
-
|
|
542
|
+
Pe(e.targetToken.blockchain)
|
|
541
543
|
) : e.walletAddress ?? ""
|
|
542
|
-
}),
|
|
544
|
+
}), E = S && (e.sourceToken.isIntent || !t.includes(e.sourceToken.blockchain)), B = () => c ? Pe(
|
|
543
545
|
e.sourceToken.blockchain,
|
|
544
546
|
e.sourceToken.isIntent
|
|
545
|
-
) :
|
|
547
|
+
) : E ? S : e.walletAddress ?? "";
|
|
546
548
|
if (!S) {
|
|
547
|
-
const
|
|
548
|
-
throw b.error(`[WIDGET] ${
|
|
549
|
+
const k = "No corresponding intents account to run a quote";
|
|
550
|
+
throw b.error(`[WIDGET] ${k}`), new q({
|
|
549
551
|
code: "QUOTE_INVALID_INITIAL",
|
|
550
|
-
meta: { isDry:
|
|
552
|
+
meta: { isDry: c, message: k }
|
|
551
553
|
});
|
|
552
554
|
}
|
|
553
555
|
d.current && (u.current.abort("Abort previous quote (auto)"), u.current = new AbortController());
|
|
554
556
|
let F;
|
|
555
557
|
const L = {
|
|
556
558
|
// Settings
|
|
557
|
-
dry:
|
|
559
|
+
dry: c,
|
|
558
560
|
slippageTolerance: l,
|
|
559
561
|
deadline: new Date(Date.now() + 3600 * 1e3).toISOString(),
|
|
560
562
|
// 1 hour
|
|
561
|
-
swapType:
|
|
563
|
+
swapType: g === "exact_out" ? U.swapType.EXACT_OUTPUT : U.swapType.EXACT_INPUT,
|
|
562
564
|
// Target
|
|
563
|
-
destinationAsset: e.targetToken.assetId ===
|
|
565
|
+
destinationAsset: e.targetToken.assetId === $ ? ge : e.targetToken.assetId,
|
|
564
566
|
// Source
|
|
565
|
-
originAsset: e.sourceToken.assetId ===
|
|
566
|
-
amount:
|
|
567
|
+
originAsset: e.sourceToken.assetId === $ ? ge : e.sourceToken.assetId,
|
|
568
|
+
amount: g === "exact_out" ? e.targetTokenAmount : e.sourceTokenAmount,
|
|
567
569
|
// Experimental
|
|
568
570
|
quoteWaitingTimeMs: 0
|
|
569
571
|
};
|
|
570
|
-
|
|
572
|
+
h && (L.customRecipientMsg = h), s && (L.referral = dt(s)), n && (L.appFees = [...n]);
|
|
571
573
|
try {
|
|
572
|
-
e.sourceToken.isIntent && e.targetToken.isIntent && (d.current =
|
|
574
|
+
e.sourceToken.isIntent && e.targetToken.isIntent && (d.current = i(
|
|
573
575
|
{
|
|
574
576
|
...L,
|
|
575
577
|
recipient: S,
|
|
@@ -580,7 +582,7 @@ const xs = (e) => {
|
|
|
580
582
|
refundType: U.refundType.INTENTS
|
|
581
583
|
},
|
|
582
584
|
f
|
|
583
|
-
), F = await d.current), d.current =
|
|
585
|
+
), F = await d.current), d.current = i(
|
|
584
586
|
{
|
|
585
587
|
...L,
|
|
586
588
|
recipient: !e.targetToken.isIntent && e.sendAddress ? e.sendAddress : S,
|
|
@@ -588,44 +590,44 @@ const xs = (e) => {
|
|
|
588
590
|
depositType: e.sourceToken.isIntent ? U.depositType.INTENTS : U.depositType.ORIGIN_CHAIN,
|
|
589
591
|
// Refund
|
|
590
592
|
refundTo: B(),
|
|
591
|
-
refundType:
|
|
593
|
+
refundType: E ? U.refundType.INTENTS : U.refundType.ORIGIN_CHAIN
|
|
592
594
|
},
|
|
593
595
|
f
|
|
594
596
|
), F = await d.current;
|
|
595
|
-
} catch (
|
|
596
|
-
if (
|
|
597
|
+
} catch (k) {
|
|
598
|
+
if (k instanceof ut)
|
|
597
599
|
return;
|
|
598
|
-
b.error("Quote error: ",
|
|
599
|
-
let
|
|
600
|
-
if (
|
|
601
|
-
if (
|
|
602
|
-
const
|
|
600
|
+
b.error("Quote error: ", k);
|
|
601
|
+
let x = k instanceof Error ? k.message : "";
|
|
602
|
+
if (k instanceof mt) {
|
|
603
|
+
if (x = k.response?.data.message || x, x.includes("Amount is too low")) {
|
|
604
|
+
const X = x.match(/\d+/), J = X ? X[0] : void 0;
|
|
603
605
|
throw new q({
|
|
604
606
|
code: "QUOTE_AMOUNT_IS_TOO_LOW",
|
|
605
607
|
meta: {
|
|
606
|
-
minAmount: (J &&
|
|
608
|
+
minAmount: (J && z(J, e.sourceToken.decimals)) ?? "0"
|
|
607
609
|
}
|
|
608
610
|
});
|
|
609
611
|
}
|
|
610
|
-
throw
|
|
612
|
+
throw x.includes("recipient is not valid") ? new q({
|
|
611
613
|
code: "TOKEN_IS_NOT_SUPPORTED"
|
|
612
|
-
}) :
|
|
614
|
+
}) : x.includes("Failed to get a deposit address") ? new q({
|
|
613
615
|
code: "QUOTE_NO_ONE_TIME_ADDRESS"
|
|
614
|
-
}) :
|
|
616
|
+
}) : k;
|
|
615
617
|
}
|
|
616
618
|
throw new q({
|
|
617
619
|
code: "QUOTE_FAILED",
|
|
618
620
|
meta: {
|
|
619
|
-
message:
|
|
621
|
+
message: x || "Failed to fetch quote. Please try again."
|
|
620
622
|
}
|
|
621
623
|
});
|
|
622
624
|
}
|
|
623
|
-
return
|
|
625
|
+
return c ? {
|
|
624
626
|
dry: !0,
|
|
625
627
|
...F,
|
|
626
628
|
deadline: void 0,
|
|
627
629
|
depositAddress: void 0
|
|
628
|
-
} : (
|
|
630
|
+
} : (Ys(F), {
|
|
629
631
|
dry: !1,
|
|
630
632
|
...F,
|
|
631
633
|
deadline: F.deadline,
|
|
@@ -636,11 +638,11 @@ const xs = (e) => {
|
|
|
636
638
|
u.current.abort("Abort quote manually"), u.current = new AbortController();
|
|
637
639
|
}
|
|
638
640
|
};
|
|
639
|
-
},
|
|
640
|
-
const { ctx: e } =
|
|
641
|
+
}, Xs = () => {
|
|
642
|
+
const { ctx: e } = _(), { intentsAccountType: t } = y(), { isNativeNearDeposit: r } = j(), s = te({
|
|
641
643
|
addressType: t,
|
|
642
644
|
walletAddress: e.walletAddress ?? ""
|
|
643
|
-
}), n = Y(null), a = Y(new AbortController()), l =
|
|
645
|
+
}), n = Y(null), a = Y(new AbortController()), l = v(() => async (d) => ft.post(
|
|
644
646
|
"",
|
|
645
647
|
{
|
|
646
648
|
id: 1,
|
|
@@ -656,20 +658,20 @@ const xs = (e) => {
|
|
|
656
658
|
{
|
|
657
659
|
signal: a.current.signal
|
|
658
660
|
}
|
|
659
|
-
), [
|
|
661
|
+
), [Ie]);
|
|
660
662
|
return {
|
|
661
663
|
make: async () => {
|
|
662
|
-
if (!
|
|
664
|
+
if (!D(e, [
|
|
663
665
|
"input_valid_dry",
|
|
664
666
|
"input_valid_external",
|
|
665
667
|
"input_valid_internal",
|
|
666
668
|
"quote_success_internal",
|
|
667
669
|
"quote_success_external"
|
|
668
670
|
])) {
|
|
669
|
-
const
|
|
670
|
-
throw b.error(`[WIDGET] ${
|
|
671
|
+
const i = `Unable to run quote in current state ${e.state}`;
|
|
672
|
+
throw b.error(`[WIDGET] ${i}`), new q({
|
|
671
673
|
code: "QUOTE_INVALID_INITIAL",
|
|
672
|
-
meta: { isDry: !1, message:
|
|
674
|
+
meta: { isDry: !1, message: i }
|
|
673
675
|
});
|
|
674
676
|
}
|
|
675
677
|
if (r && !e.isDepositFromExternalWallet || !r && e.sourceToken.assetId !== e.targetToken.assetId)
|
|
@@ -697,17 +699,17 @@ const xs = (e) => {
|
|
|
697
699
|
}
|
|
698
700
|
});
|
|
699
701
|
if (!s) {
|
|
700
|
-
const
|
|
701
|
-
throw b.error(`[WIDGET] ${
|
|
702
|
+
const i = "No corresponding intents account to run a quote";
|
|
703
|
+
throw b.error(`[WIDGET] ${i}`), new q({
|
|
702
704
|
code: "QUOTE_INVALID_INITIAL",
|
|
703
|
-
meta: { isDry: !1, message:
|
|
705
|
+
meta: { isDry: !1, message: i }
|
|
704
706
|
});
|
|
705
707
|
}
|
|
706
708
|
n.current && (a.current.abort("Abort previous quote (auto)"), a.current = new AbortController());
|
|
707
|
-
let u =
|
|
709
|
+
let u = ct[e.targetToken.blockchain];
|
|
708
710
|
if (!u)
|
|
709
|
-
if (
|
|
710
|
-
u =
|
|
711
|
+
if (Q(e.targetToken.blockchain))
|
|
712
|
+
u = lt;
|
|
711
713
|
else
|
|
712
714
|
throw new q({
|
|
713
715
|
code: "QUOTE_INVALID_INITIAL",
|
|
@@ -722,12 +724,12 @@ const xs = (e) => {
|
|
|
722
724
|
amountIn: e.sourceTokenAmount,
|
|
723
725
|
amountOut: e.targetTokenAmount,
|
|
724
726
|
amountInUsd: `${parseFloat(
|
|
725
|
-
|
|
727
|
+
z(e.sourceTokenAmount, e.sourceToken.decimals)
|
|
726
728
|
) * e.sourceToken.price}`,
|
|
727
729
|
amountOutUsd: `${parseFloat(
|
|
728
|
-
|
|
730
|
+
z(e.targetTokenAmount, e.targetToken.decimals)
|
|
729
731
|
) * e.targetToken.price}`,
|
|
730
|
-
amountOutFormatted:
|
|
732
|
+
amountOutFormatted: z(
|
|
731
733
|
e.targetTokenAmount,
|
|
732
734
|
e.targetToken.decimals
|
|
733
735
|
),
|
|
@@ -736,11 +738,11 @@ const xs = (e) => {
|
|
|
736
738
|
timeEstimate: 0,
|
|
737
739
|
dry: !1
|
|
738
740
|
};
|
|
739
|
-
} catch (
|
|
740
|
-
if (
|
|
741
|
+
} catch (i) {
|
|
742
|
+
if (i instanceof ut)
|
|
741
743
|
return;
|
|
742
|
-
if (b.error(
|
|
743
|
-
const m =
|
|
744
|
+
if (b.error(i), i instanceof mt) {
|
|
745
|
+
const m = i.response?.data.message || i.message;
|
|
744
746
|
throw new q({
|
|
745
747
|
code: "QUOTE_FAILED",
|
|
746
748
|
meta: {
|
|
@@ -754,153 +756,153 @@ const xs = (e) => {
|
|
|
754
756
|
a.current.abort("Abort quote manually"), a.current = new AbortController();
|
|
755
757
|
}
|
|
756
758
|
};
|
|
757
|
-
},
|
|
759
|
+
}, Ze = (e) => {
|
|
758
760
|
p("errorSet", e), p("quoteSet", void 0), p("quoteSetStatus", "idle"), p("transferSetStatus", { status: "idle" });
|
|
759
|
-
},
|
|
761
|
+
}, Xe = async (e) => {
|
|
760
762
|
if (!e.sendAddress)
|
|
761
763
|
return;
|
|
762
764
|
let t = !1;
|
|
763
765
|
try {
|
|
764
|
-
p("setInputsValidating", !0), t = await
|
|
766
|
+
p("setInputsValidating", !0), t = await fn(e.sendAddress);
|
|
765
767
|
} catch {
|
|
766
|
-
|
|
768
|
+
Ze({
|
|
767
769
|
code: "SEND_ADDRESS_IS_NOT_VERIFIED",
|
|
768
770
|
meta: { address: e.sendAddress, chain: "near" }
|
|
769
771
|
}), p("setInputsValidating", !1), O("initial_wallet");
|
|
770
772
|
return;
|
|
771
773
|
}
|
|
772
774
|
if (p("setInputsValidating", !1), !t) {
|
|
773
|
-
|
|
775
|
+
Ze({
|
|
774
776
|
code: "SEND_ADDRESS_IS_NOT_FOUND",
|
|
775
777
|
meta: { address: e.sendAddress, chain: "near" }
|
|
776
778
|
}), O("initial_wallet");
|
|
777
779
|
return;
|
|
778
780
|
}
|
|
779
|
-
e.error ?
|
|
780
|
-
},
|
|
781
|
-
const t =
|
|
781
|
+
e.error ? pn(e.error) && (p("errorSet", null), O("input_valid_external")) : O("input_valid_external");
|
|
782
|
+
}, yt = (e) => {
|
|
783
|
+
const t = D(e, ["initial_dry"]), r = D(e, ["input_valid_dry"]);
|
|
782
784
|
if (!t && !r)
|
|
783
785
|
return;
|
|
784
786
|
let s;
|
|
785
|
-
return t && (e.sourceToken ? e.targetToken ?
|
|
786
|
-
},
|
|
787
|
-
const t =
|
|
787
|
+
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;
|
|
788
|
+
}, bt = (e) => {
|
|
789
|
+
const t = D(e, ["initial_wallet"]), r = D(e, ["input_valid_external"]);
|
|
788
790
|
if (!t && !r)
|
|
789
791
|
return;
|
|
790
792
|
const s = e.sourceTokenBalance;
|
|
791
793
|
let n;
|
|
792
|
-
return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? n = { code: "SOURCE_TOKEN_IS_INTENT" } :
|
|
794
|
+
return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ? n = { code: "SOURCE_TOKEN_IS_INTENT" } : ne(e.sourceTokenAmount) ? e.sendAddress ? e.targetToken.blockchain === "near" ? ht(e.sendAddress) ? Xe(e) : n = {
|
|
793
795
|
code: "SEND_ADDRESS_IS_INVALID",
|
|
794
796
|
meta: { address: e.sendAddress, chain: "near" }
|
|
795
|
-
} : e.isDepositFromExternalWallet || (!s || !
|
|
796
|
-
},
|
|
797
|
-
const t =
|
|
797
|
+
} : e.isDepositFromExternalWallet || (!s || !pt(s) ? n = { code: "INVALID_SOURCE_BALANCE" } : ve(e) || (n = { code: "SOURCE_BALANCE_INSUFFICIENT" })) : n = { code: "SEND_ADDRESS_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_AMOUNT_IS_EMPTY" } : n = { code: "TARGET_TOKEN_IS_EMPTY" } : n = { code: "SOURCE_TOKEN_IS_EMPTY" }), r && e.targetToken.blockchain === "near" && Xe(e), !r && n ? p("errorSet", n) : e.error && !De(e.error) && !xe(e.error) && p("errorSet", null), r;
|
|
798
|
+
}, Et = (e) => {
|
|
799
|
+
const t = D(e, ["initial_wallet"]), r = D(e, ["input_valid_internal"]);
|
|
798
800
|
if (!t && !r)
|
|
799
801
|
return;
|
|
800
802
|
const s = e.sourceTokenBalance;
|
|
801
803
|
let n;
|
|
802
|
-
return t && (e.sourceToken ? e.targetToken ? e.targetToken.isIntent ?
|
|
803
|
-
},
|
|
804
|
-
const t =
|
|
804
|
+
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;
|
|
805
|
+
}, Ct = (e) => {
|
|
806
|
+
const t = Re(e), r = !t && e.targetToken?.isIntent === !0, s = !t && e.targetToken?.isIntent === !1;
|
|
805
807
|
if (t) {
|
|
806
|
-
const n =
|
|
808
|
+
const n = yt(e);
|
|
807
809
|
return O(n ? "input_valid_dry" : "initial_dry");
|
|
808
810
|
}
|
|
809
|
-
s &&
|
|
810
|
-
},
|
|
811
|
+
s && bt(e) ? O("input_valid_external") : r && Et(e) ? O("input_valid_internal") : O("initial_wallet");
|
|
812
|
+
}, Js = ({
|
|
811
813
|
isEnabled: e,
|
|
812
814
|
message: t,
|
|
813
815
|
type: r = "exact_in",
|
|
814
816
|
refetchQuoteInterval: s
|
|
815
817
|
}) => {
|
|
816
|
-
const { ctx: n } =
|
|
818
|
+
const { ctx: n } = _(), {
|
|
817
819
|
isNativeNearDeposit: a,
|
|
818
820
|
isDirectNonNearWithdrawal: l,
|
|
819
|
-
isDirectTokenOnNearDeposit:
|
|
821
|
+
isDirectTokenOnNearDeposit: c,
|
|
820
822
|
isDirectNearTokenWithdrawal: d,
|
|
821
823
|
isDirectTokenOnNearTransfer: u,
|
|
822
|
-
isSameAssetDiffChainWithdrawal:
|
|
823
|
-
} =
|
|
824
|
+
isSameAssetDiffChainWithdrawal: i
|
|
825
|
+
} = j(), m = Re(n), h = e && !n.areInputsValidating && (i || (c || a) && n.isDepositFromExternalWallet || !d && !l && !c && !u), { make: g, cancel: f } = Zs(), { make: w, cancel: S } = Xs(), E = Y(null), B = () => {
|
|
824
826
|
f(), S();
|
|
825
827
|
};
|
|
826
|
-
|
|
827
|
-
const L =
|
|
828
|
-
(m && !L || !m && n.targetToken?.isIntent && !
|
|
828
|
+
C(() => {
|
|
829
|
+
const L = D(n, ["input_valid_dry"]), k = D(n, ["input_valid_external"]), x = D(n, ["input_valid_internal"]);
|
|
830
|
+
(m && !L || !m && n.targetToken?.isIntent && !x || !m && !n.targetToken?.isIntent && !k || n.areInputsValidating) && B();
|
|
829
831
|
}, [B, m, n]);
|
|
830
|
-
const F =
|
|
832
|
+
const F = he(
|
|
831
833
|
async (L) => {
|
|
832
834
|
try {
|
|
833
|
-
let
|
|
835
|
+
let k;
|
|
834
836
|
if (n.sourceToken?.assetId === n.targetToken?.assetId || a && n.isDepositFromExternalWallet) {
|
|
835
837
|
if (m)
|
|
836
838
|
return;
|
|
837
|
-
p("quoteSetStatus", "pending"),
|
|
839
|
+
p("quoteSetStatus", "pending"), k = await w();
|
|
838
840
|
} else
|
|
839
|
-
p("quoteSetStatus", "pending"),
|
|
840
|
-
if (!
|
|
841
|
+
p("quoteSetStatus", "pending"), k = await g({ message: t, quoteType: r, options: L });
|
|
842
|
+
if (!k)
|
|
841
843
|
return;
|
|
842
|
-
if (p("quoteSetStatus", "success"), p("quoteSet",
|
|
844
|
+
if (p("quoteSetStatus", "success"), p("quoteSet", k), !m && n.error?.code !== "SOURCE_BALANCE_INSUFFICIENT" && p("errorSet", null), p("tokenSetAmount", {
|
|
843
845
|
variant: "target",
|
|
844
|
-
amount:
|
|
846
|
+
amount: k.amountOut
|
|
845
847
|
}), n.state === "input_valid_dry") {
|
|
846
848
|
O("quote_success_dry");
|
|
847
849
|
return;
|
|
848
850
|
}
|
|
849
851
|
n.targetToken?.isIntent ? O("quote_success_internal") : O("quote_success_external");
|
|
850
|
-
} catch (
|
|
851
|
-
if (
|
|
852
|
-
if (
|
|
852
|
+
} catch (k) {
|
|
853
|
+
if (k instanceof q) {
|
|
854
|
+
if (k.data.code === "QUOTE_INVALID_INITIAL") {
|
|
853
855
|
p("quoteSetStatus", "idle"), p("quoteSet", void 0), p("errorSet", null);
|
|
854
856
|
return;
|
|
855
857
|
}
|
|
856
|
-
p("quoteSetStatus", "error"), p("quoteSet", void 0), p("errorSet",
|
|
858
|
+
p("quoteSetStatus", "error"), p("quoteSet", void 0), p("errorSet", k.data), Ct(n);
|
|
857
859
|
return;
|
|
858
860
|
}
|
|
859
|
-
b.error("Unhandled error in useMakeQuoteEffect:",
|
|
861
|
+
b.error("Unhandled error in useMakeQuoteEffect:", k), p("quoteSetStatus", "error"), p("quoteSet", void 0), p("errorSet", {
|
|
860
862
|
code: "QUOTE_FAILED",
|
|
861
863
|
meta: { message: "Unknown error" }
|
|
862
864
|
});
|
|
863
865
|
}
|
|
864
866
|
},
|
|
865
|
-
[n, m,
|
|
867
|
+
[n, m, w, g, t, r, h]
|
|
866
868
|
);
|
|
867
|
-
|
|
868
|
-
!
|
|
869
|
-
}, [
|
|
869
|
+
C(() => {
|
|
870
|
+
!h || !(m ? 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 }));
|
|
871
|
+
}, [h, F, B, n.sourceToken, n.targetToken]), C(() => {
|
|
870
872
|
const L = () => {
|
|
871
|
-
|
|
873
|
+
E.current && (clearInterval(E.current), E.current = null);
|
|
872
874
|
};
|
|
873
|
-
return n.state !== "quote_success_internal" && n.state !== "quote_success_external" || !s || (
|
|
875
|
+
return n.state !== "quote_success_internal" && n.state !== "quote_success_external" || !s || (E.current = setInterval(async () => {
|
|
874
876
|
await F({ isRefetch: !0 });
|
|
875
877
|
}, s)), L;
|
|
876
|
-
}, [
|
|
877
|
-
},
|
|
878
|
+
}, [h, F, B, n.state]);
|
|
879
|
+
}, me = {
|
|
878
880
|
sol: "sol",
|
|
879
881
|
evm: "eth",
|
|
880
882
|
near: "near"
|
|
881
|
-
},
|
|
883
|
+
}, er = ({
|
|
882
884
|
isEnabled: e,
|
|
883
885
|
skipIntents: t = !1,
|
|
884
886
|
target: r = "none"
|
|
885
887
|
}) => {
|
|
886
|
-
const { tokens: s } = P(), { ctx: n, state: a } =
|
|
888
|
+
const { tokens: s } = P(), { ctx: n, state: a } = _(), { intentBalances: l } = ce(), { walletSupportedChains: c, chainsFilter: d, intentsAccountType: u } = y(), i = gn({
|
|
887
889
|
tokens: s,
|
|
888
|
-
walletSupportedChains:
|
|
890
|
+
walletSupportedChains: c,
|
|
889
891
|
balances: l,
|
|
890
892
|
across: "intents"
|
|
891
|
-
}), [m,
|
|
892
|
-
{ token:
|
|
893
|
+
}), [m, h] = v(() => !n.walletAddress && !t ? [
|
|
894
|
+
{ token: Tn({ tokens: s }), status: "loaded" },
|
|
893
895
|
{ token: void 0, status: "loaded" }
|
|
894
|
-
] : d.source.intents !== "none" && !t ?
|
|
895
|
-
{ token:
|
|
896
|
+
] : d.source.intents !== "none" && !t ? i ? [
|
|
897
|
+
{ token: i, status: "loaded" },
|
|
896
898
|
{ token: void 0, status: "loaded" }
|
|
897
899
|
] : [
|
|
898
900
|
{ token: void 0, status: "loading" },
|
|
899
901
|
{ token: void 0, status: "loading" }
|
|
900
902
|
] : [
|
|
901
|
-
{ token:
|
|
903
|
+
{ token: hn({
|
|
902
904
|
tokens: s,
|
|
903
|
-
walletSupportedChains:
|
|
905
|
+
walletSupportedChains: c
|
|
904
906
|
}), status: "loaded" },
|
|
905
907
|
{ token: void 0, status: "loaded" }
|
|
906
908
|
], [
|
|
@@ -908,88 +910,88 @@ const xs = (e) => {
|
|
|
908
910
|
t,
|
|
909
911
|
d,
|
|
910
912
|
n.walletAddress,
|
|
911
|
-
o,
|
|
912
913
|
i,
|
|
914
|
+
c,
|
|
913
915
|
a
|
|
914
916
|
]);
|
|
915
|
-
|
|
917
|
+
C(() => {
|
|
916
918
|
if (!e)
|
|
917
919
|
return;
|
|
918
|
-
if (
|
|
920
|
+
if (D(n, ["initial_dry", "initial_wallet"]) && (m.status === "loaded" && !n.sourceToken && p("tokenSelect", {
|
|
919
921
|
variant: "source",
|
|
920
922
|
token: m.token
|
|
921
|
-
}),
|
|
922
|
-
let
|
|
923
|
+
}), h.status === "loaded" && m.status === "loaded" && !n.targetToken)) {
|
|
924
|
+
let w = h.token;
|
|
923
925
|
if (r === "same-asset")
|
|
924
926
|
if (m.token?.isIntent) {
|
|
925
927
|
if (!u)
|
|
926
928
|
throw new Error(
|
|
927
929
|
"Intents account type is required to select same-asset target token"
|
|
928
930
|
);
|
|
929
|
-
|
|
930
|
-
(S) => !S.isIntent && S.symbol === n.sourceToken?.symbol && S.blockchain ===
|
|
931
|
+
w = s.find(
|
|
932
|
+
(S) => !S.isIntent && S.symbol === n.sourceToken?.symbol && S.blockchain === me[u]
|
|
931
933
|
);
|
|
932
934
|
} else
|
|
933
|
-
|
|
935
|
+
w = s.find(
|
|
934
936
|
(S) => S.isIntent && S.symbol === n.sourceToken?.symbol
|
|
935
937
|
);
|
|
936
938
|
p("tokenSelect", {
|
|
937
939
|
variant: "target",
|
|
938
|
-
token:
|
|
940
|
+
token: w
|
|
939
941
|
});
|
|
940
942
|
}
|
|
941
|
-
}, [n, m,
|
|
942
|
-
const
|
|
943
|
+
}, [n, m, h, e]);
|
|
944
|
+
const g = (f, w) => {
|
|
943
945
|
const S = s.find(
|
|
944
|
-
(
|
|
945
|
-
) ??
|
|
946
|
+
(E) => !E.isIntent && E.blockchain === me[f] && E.symbol.toLowerCase() === Jt[me[f]]?.toLowerCase()
|
|
947
|
+
) ?? w;
|
|
946
948
|
p("tokenSelect", {
|
|
947
949
|
variant: "source",
|
|
948
950
|
token: S
|
|
949
951
|
});
|
|
950
952
|
};
|
|
951
|
-
return
|
|
952
|
-
const f =
|
|
953
|
+
return C(() => {
|
|
954
|
+
const f = D(n, ["initial_dry", "initial_wallet"]);
|
|
953
955
|
if (!e || !f)
|
|
954
956
|
return;
|
|
955
|
-
const
|
|
956
|
-
(
|
|
957
|
+
const w = s.find(
|
|
958
|
+
(E) => E.isIntent && E.symbol === "AURORA" && E.blockchain === "near"
|
|
957
959
|
), S = setTimeout(() => {
|
|
958
|
-
m.token || (!t &&
|
|
960
|
+
m.token || (!t && i ? p("tokenSelect", {
|
|
959
961
|
variant: "source",
|
|
960
|
-
token:
|
|
961
|
-
}) :
|
|
962
|
+
token: i
|
|
963
|
+
}) : c.length && u ? g(u, w) : n.walletAddress && Tt(n.walletAddress) ? g("sol", w) : n.walletAddress && gt(n.walletAddress) ? g("evm", w) : n.walletAddress && ht(n.walletAddress) ? g("near", w) : p("tokenSelect", {
|
|
962
964
|
variant: "source",
|
|
963
|
-
token:
|
|
965
|
+
token: w
|
|
964
966
|
}));
|
|
965
967
|
}, 3e3);
|
|
966
968
|
return () => clearTimeout(S);
|
|
967
969
|
}, [s, m, t]), { source: n.sourceToken, target: n.targetToken };
|
|
968
|
-
},
|
|
970
|
+
}, tr = ({
|
|
969
971
|
isEnabled: e,
|
|
970
972
|
alchemyApiKey: t
|
|
971
973
|
}) => {
|
|
972
|
-
const { connectedWallets: r } =
|
|
973
|
-
|
|
974
|
+
const { connectedWallets: r } = y();
|
|
975
|
+
_t({
|
|
974
976
|
isEnabled: e,
|
|
975
977
|
connectedWallets: r,
|
|
976
978
|
alchemyApiKey: t ?? ""
|
|
977
979
|
});
|
|
978
|
-
},
|
|
979
|
-
const { config: r } =
|
|
980
|
+
}, nr = (e, t) => {
|
|
981
|
+
const { config: r } = Ne(Ue);
|
|
980
982
|
return e.targetToken && !e.sendAddress && !!e.walletAddress && !e.targetToken.isIntent && !t.find((s) => s?.key === "sendAddress") && r.walletSupportedChains.includes(e.targetToken.blockchain);
|
|
981
|
-
},
|
|
982
|
-
|
|
983
|
+
}, sr = ({ debug: e }) => {
|
|
984
|
+
Z.onContextChange((t, r) => {
|
|
983
985
|
const s = r;
|
|
984
|
-
if (e && b.debug("[WIDGET] Context changed", s), e && t.error &&
|
|
986
|
+
if (e && b.debug("[WIDGET] Context changed", s), e && t.error && kn(s) && b.debug(`[WIDGET] Error set to ${t.error.code}`), An(s) || yn(t, s, e))
|
|
985
987
|
return;
|
|
986
|
-
if (
|
|
988
|
+
if (Nn(t, s)) {
|
|
987
989
|
p("reset", { clearWalletAddress: !0 }), O("initial_dry");
|
|
988
990
|
return;
|
|
989
991
|
}
|
|
990
|
-
const { isChanged: n, isDry: a } =
|
|
992
|
+
const { isChanged: n, isDry: a } = wn(t, s);
|
|
991
993
|
if (n) {
|
|
992
|
-
if (
|
|
994
|
+
if (Sn(t)) {
|
|
993
995
|
const l = a ? "initial_dry" : "initial_wallet";
|
|
994
996
|
O(l, {
|
|
995
997
|
onMoved: () => {
|
|
@@ -999,21 +1001,21 @@ const xs = (e) => {
|
|
|
999
1001
|
}
|
|
1000
1002
|
});
|
|
1001
1003
|
}
|
|
1002
|
-
|
|
1004
|
+
In(t) || (t.quote = void 0, t.quoteStatus = "idle", t.transferStatus = { status: "idle" }), _n(t) && (t.sendAddress = void 0), nr(t, s) && (t.sendAddress = t.walletAddress), Ct(t);
|
|
1003
1005
|
}
|
|
1004
1006
|
});
|
|
1005
|
-
},
|
|
1006
|
-
|
|
1007
|
+
}, rr = ({ debug: e }) => {
|
|
1008
|
+
Z.onTransition((t, r) => {
|
|
1007
1009
|
e && b.debug(`===> [WIDGET] State moved from ${t} to ${r}`);
|
|
1008
1010
|
});
|
|
1009
|
-
},
|
|
1010
|
-
const { variant: r, token: s } = t, { config: n } =
|
|
1011
|
+
}, ar = (e, t) => {
|
|
1012
|
+
const { variant: r, token: s } = t, { config: n } = Ne(Ue);
|
|
1011
1013
|
switch (r) {
|
|
1012
1014
|
case "source":
|
|
1013
1015
|
if (s && s.assetId === e.targetToken?.assetId && s.isIntent === e.targetToken.isIntent && n.enableAutoTokensSwitching) {
|
|
1014
1016
|
if (!e.sourceToken)
|
|
1015
1017
|
return;
|
|
1016
|
-
|
|
1018
|
+
we(e);
|
|
1017
1019
|
return;
|
|
1018
1020
|
}
|
|
1019
1021
|
if (s && !e.sourceToken && s.assetId === e.targetToken?.assetId && s.isIntent === e.targetToken.isIntent && n.enableAutoTokensSwitching)
|
|
@@ -1024,26 +1026,26 @@ const xs = (e) => {
|
|
|
1024
1026
|
if (s && s.assetId === e.sourceToken?.assetId && s.isIntent === e.sourceToken.isIntent && n.enableAutoTokensSwitching) {
|
|
1025
1027
|
if (!e.targetToken)
|
|
1026
1028
|
return;
|
|
1027
|
-
|
|
1029
|
+
we(e);
|
|
1028
1030
|
return;
|
|
1029
1031
|
}
|
|
1030
1032
|
e.targetToken = s;
|
|
1031
1033
|
break;
|
|
1032
1034
|
default:
|
|
1033
|
-
|
|
1035
|
+
Ce(r, { throwError: !1 });
|
|
1034
1036
|
}
|
|
1035
|
-
},
|
|
1037
|
+
}, R = (e, t) => Z.on(
|
|
1036
1038
|
e,
|
|
1037
|
-
(r, s) => t(r, s,
|
|
1038
|
-
),
|
|
1039
|
-
|
|
1040
|
-
},
|
|
1039
|
+
(r, s) => t(r, s, Z)
|
|
1040
|
+
), or = () => {
|
|
1041
|
+
R("quoteSetStatus", Dn), R("walletAddressSet", Ln), R("transferSetStatus", qn), R("tokenSelectRotate", we), R("tokenSetBalance", Bn), R("tokenSetAmount", vn), R("depositTypeSet", xn), R("setInputsValidating", Fn), R("externalDepositTxSet", On), R("tokenSelect", ar), R("addressSet", Rn), R("errorSet", En), R("quoteSet", Cn), R("reset", bn), R("validateDryInputs", yt), R("validateExternalInputs", bt), R("validateInternalInputs", Et);
|
|
1042
|
+
}, ir = an(({ debug: e }) => {
|
|
1041
1043
|
e && b.debug(
|
|
1042
|
-
"[WIDGET] Debug mode is enabled (package version: 3.14.0-redesign.
|
|
1043
|
-
),
|
|
1044
|
-
}),
|
|
1045
|
-
|
|
1046
|
-
|
|
1044
|
+
"[WIDGET] Debug mode is enabled (package version: 3.14.0-redesign.7)"
|
|
1045
|
+
), or(), rr({ debug: e }), sr({ debug: e });
|
|
1046
|
+
}), Bi = ({ listenTo: e, debug: t = !1 }) => {
|
|
1047
|
+
C(() => {
|
|
1048
|
+
ir({ debug: t });
|
|
1047
1049
|
}, [t]);
|
|
1048
1050
|
const r = e.find(
|
|
1049
1051
|
(a) => Array.isArray(a) && a[0] === "setBalancesUsingAlchemyExt"
|
|
@@ -1052,120 +1054,120 @@ const xs = (e) => {
|
|
|
1052
1054
|
), n = e.find(
|
|
1053
1055
|
(a) => Array.isArray(a) && a[0] === "makeQuote"
|
|
1054
1056
|
);
|
|
1055
|
-
|
|
1057
|
+
tr({
|
|
1056
1058
|
isEnabled: !!r,
|
|
1057
1059
|
alchemyApiKey: r?.[1].alchemyApiKey
|
|
1058
|
-
}),
|
|
1060
|
+
}), er({
|
|
1059
1061
|
isEnabled: !!s,
|
|
1060
1062
|
skipIntents: s?.[1].skipIntents,
|
|
1061
1063
|
target: s?.[1].target
|
|
1062
|
-
}),
|
|
1064
|
+
}), Js({
|
|
1063
1065
|
isEnabled: !!n,
|
|
1064
1066
|
message: n?.[1].message,
|
|
1065
1067
|
type: n?.[1].type,
|
|
1066
1068
|
refetchQuoteInterval: n?.[1].refetchQuoteInterval
|
|
1067
|
-
}),
|
|
1069
|
+
}), zs({
|
|
1068
1070
|
isEnabled: e.includes("checkWalletConnection")
|
|
1069
|
-
}),
|
|
1071
|
+
}), Gs({
|
|
1070
1072
|
isEnabled: e.includes("setSourceTokenBalance")
|
|
1071
|
-
}),
|
|
1073
|
+
}), js({
|
|
1072
1074
|
isEnabled: e.includes("setSourceTokenIntentsTarget")
|
|
1073
|
-
}),
|
|
1075
|
+
}), Hs({
|
|
1074
1076
|
isEnabled: e.includes("updateBalances"),
|
|
1075
1077
|
alchemyApiKey: r?.[1].alchemyApiKey
|
|
1076
1078
|
});
|
|
1077
|
-
},
|
|
1079
|
+
}, cr = Z.getStore();
|
|
1078
1080
|
class W extends Error {
|
|
1079
1081
|
context;
|
|
1080
1082
|
_is_widget_error = !0;
|
|
1081
1083
|
constructor(t, r) {
|
|
1082
|
-
super(t), this.name = "WidgetError", this.cause = r?.cause, this.context =
|
|
1084
|
+
super(t), this.name = "WidgetError", this.cause = r?.cause, this.context = Ne(cr).context;
|
|
1083
1085
|
}
|
|
1084
1086
|
}
|
|
1085
|
-
class
|
|
1087
|
+
class Rt extends W {
|
|
1086
1088
|
data;
|
|
1087
1089
|
constructor(t) {
|
|
1088
1090
|
super(t.code), this.data = t, this.name = "MachineError";
|
|
1089
1091
|
}
|
|
1090
1092
|
}
|
|
1091
|
-
class q extends
|
|
1093
|
+
class q extends Rt {
|
|
1092
1094
|
constructor(t) {
|
|
1093
1095
|
super(t), this.name = "QuoteError";
|
|
1094
1096
|
}
|
|
1095
1097
|
}
|
|
1096
|
-
class
|
|
1098
|
+
class I extends Rt {
|
|
1097
1099
|
constructor(t) {
|
|
1098
1100
|
super(t), this.name = "TransferError";
|
|
1099
1101
|
}
|
|
1100
1102
|
}
|
|
1101
|
-
const
|
|
1102
|
-
usdTradeDelta: (e) =>
|
|
1103
|
-
isDirectNearTokenWithdrawal: (e) =>
|
|
1104
|
-
isDirectNonNearWithdrawal: (e) =>
|
|
1105
|
-
isDirectTokenOnNearDeposit: (e) =>
|
|
1106
|
-
isNativeNearDeposit: (e) =>
|
|
1107
|
-
isSameAssetDiffChainWithdrawal: (e) =>
|
|
1108
|
-
isDirectTokenOnNearTransfer: (e) =>
|
|
1109
|
-
}),
|
|
1103
|
+
const qi = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e && !!e._is_widget_error, V = Z.getStore(), lr = nn({
|
|
1104
|
+
usdTradeDelta: (e) => Un(e(V.context)),
|
|
1105
|
+
isDirectNearTokenWithdrawal: (e) => Vn(e(V.context)),
|
|
1106
|
+
isDirectNonNearWithdrawal: (e) => Pn(e(V.context)),
|
|
1107
|
+
isDirectTokenOnNearDeposit: (e) => rn(e(V.context)),
|
|
1108
|
+
isNativeNearDeposit: (e) => sn(e(V.context)),
|
|
1109
|
+
isSameAssetDiffChainWithdrawal: (e) => Mn(e(V.context)),
|
|
1110
|
+
isDirectTokenOnNearTransfer: (e) => Wn(e(V.context))
|
|
1111
|
+
}), j = () => oe(lr), _ = () => {
|
|
1110
1112
|
const e = oe(V);
|
|
1111
1113
|
return {
|
|
1112
1114
|
state: e.state,
|
|
1113
1115
|
ctx: e.context
|
|
1114
1116
|
};
|
|
1115
|
-
},
|
|
1117
|
+
}, Ui = (e) => {
|
|
1116
1118
|
const t = oe(V);
|
|
1117
|
-
if (!
|
|
1119
|
+
if (!D(t.context, [e]))
|
|
1118
1120
|
throw new W(
|
|
1119
1121
|
`[WIDGET] Attempt to access snapshot for ${e} state while context does not match`
|
|
1120
1122
|
);
|
|
1121
1123
|
return t.context;
|
|
1122
|
-
},
|
|
1124
|
+
}, dr = async ({
|
|
1123
1125
|
contractId: e,
|
|
1124
1126
|
accountId: t
|
|
1125
1127
|
}) => {
|
|
1126
1128
|
try {
|
|
1127
|
-
const r = { account_id: t }, s =
|
|
1129
|
+
const r = { account_id: t }, s = Fe.from(JSON.stringify(r)).toString("base64"), n = await $n.query({
|
|
1128
1130
|
request_type: "call_function",
|
|
1129
1131
|
method_name: "storage_balance_of",
|
|
1130
1132
|
account_id: e,
|
|
1131
1133
|
args_base64: s,
|
|
1132
1134
|
finality: "optimistic"
|
|
1133
|
-
}), a =
|
|
1135
|
+
}), a = Qn(
|
|
1134
1136
|
n,
|
|
1135
|
-
|
|
1137
|
+
se.union([se.null(), se.object({ total: se.string() })])
|
|
1136
1138
|
);
|
|
1137
1139
|
return BigInt(a?.total ?? "0");
|
|
1138
1140
|
} catch (r) {
|
|
1139
1141
|
throw new W("Error fetching balance", { cause: r });
|
|
1140
1142
|
}
|
|
1141
1143
|
};
|
|
1142
|
-
function
|
|
1143
|
-
const { ctx: t } =
|
|
1144
|
+
function ur(e) {
|
|
1145
|
+
const { ctx: t } = _(), { isNativeNearDeposit: r } = j(), s = t.sourceToken?.contractAddress, n = t.quote?.amountIn ?? t.sourceTokenAmount;
|
|
1144
1146
|
return {
|
|
1145
|
-
make: async (l,
|
|
1147
|
+
make: async (l, c) => {
|
|
1146
1148
|
if (!e)
|
|
1147
|
-
throw new
|
|
1149
|
+
throw new I({
|
|
1148
1150
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1149
1151
|
meta: { message: "No connected wallet to sign a transfer." }
|
|
1150
1152
|
});
|
|
1151
|
-
if (!s && t.sourceToken?.assetId !==
|
|
1152
|
-
throw new
|
|
1153
|
+
if (!s && t.sourceToken?.assetId !== $)
|
|
1154
|
+
throw new I({
|
|
1153
1155
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1154
1156
|
meta: { message: "No token selected to transfer." }
|
|
1155
1157
|
});
|
|
1156
1158
|
if (!l)
|
|
1157
|
-
throw new
|
|
1159
|
+
throw new I({
|
|
1158
1160
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1159
1161
|
meta: { message: "No recipient address to transfer." }
|
|
1160
1162
|
});
|
|
1161
1163
|
if (!n)
|
|
1162
|
-
throw new
|
|
1164
|
+
throw new I({
|
|
1163
1165
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1164
1166
|
meta: { message: "No amount to transfer." }
|
|
1165
1167
|
});
|
|
1166
1168
|
const d = e();
|
|
1167
|
-
if (t.sourceToken.assetId ===
|
|
1168
|
-
const
|
|
1169
|
+
if (t.sourceToken.assetId === $ && t.targetToken?.assetId !== ge) {
|
|
1170
|
+
const i = await d.signAndSendTransactions({
|
|
1169
1171
|
transactions: [
|
|
1170
1172
|
{
|
|
1171
1173
|
signerId: t.walletAddress,
|
|
@@ -1182,9 +1184,9 @@ function Xs(e) {
|
|
|
1182
1184
|
}
|
|
1183
1185
|
]
|
|
1184
1186
|
});
|
|
1185
|
-
return
|
|
1186
|
-
hash:
|
|
1187
|
-
transactionLink: `https://nearblocks.io/txns/${
|
|
1187
|
+
return i && i.length > 0 ? {
|
|
1188
|
+
hash: i[0]?.transaction?.hash ?? "",
|
|
1189
|
+
transactionLink: `https://nearblocks.io/txns/${i[0]?.transaction?.hash}`,
|
|
1188
1190
|
intent: void 0
|
|
1189
1191
|
} : {
|
|
1190
1192
|
hash: "",
|
|
@@ -1199,7 +1201,7 @@ function Xs(e) {
|
|
|
1199
1201
|
type: "FunctionCall",
|
|
1200
1202
|
params: {
|
|
1201
1203
|
methodName: "near_deposit",
|
|
1202
|
-
gas:
|
|
1204
|
+
gas: We,
|
|
1203
1205
|
deposit: n,
|
|
1204
1206
|
args: {}
|
|
1205
1207
|
}
|
|
@@ -1209,15 +1211,15 @@ function Xs(e) {
|
|
|
1209
1211
|
methodName: "ft_transfer_call",
|
|
1210
1212
|
deposit: "1",
|
|
1211
1213
|
// 1 yocto required by NEP-141
|
|
1212
|
-
gas:
|
|
1214
|
+
gas: Ve,
|
|
1213
1215
|
args: {
|
|
1214
1216
|
amount: n,
|
|
1215
1217
|
receiver_id: l,
|
|
1216
|
-
msg:
|
|
1218
|
+
msg: c ?? ""
|
|
1217
1219
|
}
|
|
1218
1220
|
}
|
|
1219
1221
|
});
|
|
1220
|
-
const
|
|
1222
|
+
const i = await d.signAndSendTransactions({
|
|
1221
1223
|
transactions: [
|
|
1222
1224
|
{
|
|
1223
1225
|
receiverId: "wrap.near",
|
|
@@ -1225,42 +1227,42 @@ function Xs(e) {
|
|
|
1225
1227
|
}
|
|
1226
1228
|
]
|
|
1227
1229
|
});
|
|
1228
|
-
if (
|
|
1230
|
+
if (i?.[0]?.transaction?.hash)
|
|
1229
1231
|
return {
|
|
1230
|
-
hash:
|
|
1231
|
-
transactionLink: `https://nearblocks.io/txns/${
|
|
1232
|
+
hash: i[0].transaction?.hash ?? "",
|
|
1233
|
+
transactionLink: `https://nearblocks.io/txns/${i[0].transaction?.hash}`,
|
|
1232
1234
|
intent: void 0
|
|
1233
1235
|
};
|
|
1234
|
-
throw new
|
|
1236
|
+
throw new I({
|
|
1235
1237
|
code: "NO_DEPOSIT_RESULT"
|
|
1236
1238
|
});
|
|
1237
|
-
} catch (
|
|
1238
|
-
throw b.error("[TRANSFER ERROR]",
|
|
1239
|
+
} catch (i) {
|
|
1240
|
+
throw b.error("[TRANSFER ERROR]", i), new I({
|
|
1239
1241
|
code: "DIRECT_TRANSFER_ERROR"
|
|
1240
1242
|
});
|
|
1241
1243
|
}
|
|
1242
1244
|
if (!s)
|
|
1243
|
-
throw new
|
|
1245
|
+
throw new I({
|
|
1244
1246
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1245
1247
|
meta: { message: "No token selected to transfer." }
|
|
1246
1248
|
});
|
|
1247
1249
|
try {
|
|
1248
|
-
const [
|
|
1249
|
-
|
|
1250
|
+
const [i, m] = await Promise.all([
|
|
1251
|
+
Kn({
|
|
1250
1252
|
contractId: s
|
|
1251
1253
|
}),
|
|
1252
|
-
|
|
1254
|
+
dr({
|
|
1253
1255
|
contractId: s,
|
|
1254
1256
|
accountId: l
|
|
1255
1257
|
})
|
|
1256
|
-
]),
|
|
1257
|
-
|
|
1258
|
+
]), h = i - m;
|
|
1259
|
+
h > 0n && u.push({
|
|
1258
1260
|
type: "FunctionCall",
|
|
1259
1261
|
params: {
|
|
1260
1262
|
methodName: "storage_deposit",
|
|
1261
1263
|
args: { account_id: l },
|
|
1262
|
-
gas:
|
|
1263
|
-
deposit:
|
|
1264
|
+
gas: We,
|
|
1265
|
+
deposit: h.toString()
|
|
1264
1266
|
}
|
|
1265
1267
|
}), u.push({
|
|
1266
1268
|
type: "FunctionCall",
|
|
@@ -1269,13 +1271,13 @@ function Xs(e) {
|
|
|
1269
1271
|
args: {
|
|
1270
1272
|
receiver_id: l,
|
|
1271
1273
|
amount: n,
|
|
1272
|
-
msg:
|
|
1274
|
+
msg: c ?? ""
|
|
1273
1275
|
},
|
|
1274
|
-
gas:
|
|
1276
|
+
gas: Ve,
|
|
1275
1277
|
deposit: "1"
|
|
1276
1278
|
}
|
|
1277
1279
|
});
|
|
1278
|
-
const
|
|
1280
|
+
const g = await d.signAndSendTransactions({
|
|
1279
1281
|
transactions: [
|
|
1280
1282
|
{
|
|
1281
1283
|
receiverId: s,
|
|
@@ -1283,64 +1285,64 @@ function Xs(e) {
|
|
|
1283
1285
|
}
|
|
1284
1286
|
]
|
|
1285
1287
|
});
|
|
1286
|
-
if (
|
|
1288
|
+
if (g?.[0]?.transaction?.hash)
|
|
1287
1289
|
return {
|
|
1288
|
-
hash:
|
|
1289
|
-
transactionLink: `https://nearblocks.io/txns/${
|
|
1290
|
+
hash: g[0].transaction?.hash ?? "",
|
|
1291
|
+
transactionLink: `https://nearblocks.io/txns/${g[0].transaction?.hash}`,
|
|
1290
1292
|
intent: void 0
|
|
1291
1293
|
};
|
|
1292
|
-
throw new
|
|
1294
|
+
throw new I({
|
|
1293
1295
|
code: "NO_DEPOSIT_RESULT"
|
|
1294
1296
|
});
|
|
1295
|
-
} catch (
|
|
1296
|
-
throw b.error("[TRANSFER ERROR]",
|
|
1297
|
+
} catch (i) {
|
|
1298
|
+
throw b.error("[TRANSFER ERROR]", i), new I({
|
|
1297
1299
|
code: "DIRECT_TRANSFER_ERROR"
|
|
1298
1300
|
});
|
|
1299
1301
|
}
|
|
1300
1302
|
}
|
|
1301
1303
|
};
|
|
1302
1304
|
}
|
|
1303
|
-
const
|
|
1305
|
+
const mr = ({
|
|
1304
1306
|
makeTransfer: e,
|
|
1305
1307
|
providers: t
|
|
1306
1308
|
}) => {
|
|
1307
|
-
const { ctx: r } =
|
|
1309
|
+
const { ctx: r } = _(), { alchemyApiKey: s } = y(), { make: n } = Gn({
|
|
1308
1310
|
provider: t?.evm
|
|
1309
|
-
}), { make: a } =
|
|
1311
|
+
}), { make: a } = jn({
|
|
1310
1312
|
provider: t?.sol,
|
|
1311
1313
|
alchemyApiKey: s
|
|
1312
1314
|
}), l = (d) => {
|
|
1313
1315
|
if (e)
|
|
1314
1316
|
return e;
|
|
1315
|
-
if (
|
|
1317
|
+
if (gt(d))
|
|
1316
1318
|
return n;
|
|
1317
|
-
if (
|
|
1319
|
+
if (Tt(d))
|
|
1318
1320
|
return a;
|
|
1319
|
-
throw new
|
|
1321
|
+
throw new I({
|
|
1320
1322
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1321
1323
|
meta: { message: "No transfer function established." }
|
|
1322
1324
|
});
|
|
1323
1325
|
};
|
|
1324
1326
|
return { make: async () => {
|
|
1325
1327
|
if (!r.sourceToken) {
|
|
1326
|
-
const
|
|
1327
|
-
throw new
|
|
1328
|
+
const i = "No token selected to transfer.";
|
|
1329
|
+
throw new I({
|
|
1328
1330
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1329
|
-
meta: { message:
|
|
1331
|
+
meta: { message: i }
|
|
1330
1332
|
});
|
|
1331
1333
|
}
|
|
1332
1334
|
if (!r.quote) {
|
|
1333
|
-
const
|
|
1334
|
-
throw new
|
|
1335
|
+
const i = "Quote is required for a transfer.";
|
|
1336
|
+
throw new I({
|
|
1335
1337
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1336
|
-
meta: { message:
|
|
1338
|
+
meta: { message: i }
|
|
1337
1339
|
});
|
|
1338
1340
|
}
|
|
1339
1341
|
if (!r.quote.depositAddress) {
|
|
1340
|
-
const
|
|
1341
|
-
throw new
|
|
1342
|
+
const i = "Quote has no deposit address. Make sure not dry.";
|
|
1343
|
+
throw new I({
|
|
1342
1344
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1343
|
-
meta: { message:
|
|
1345
|
+
meta: { message: i }
|
|
1344
1346
|
});
|
|
1345
1347
|
}
|
|
1346
1348
|
const d = {
|
|
@@ -1348,48 +1350,48 @@ const er = ({
|
|
|
1348
1350
|
decimals: r.sourceToken.decimals,
|
|
1349
1351
|
address: r.quote.depositAddress,
|
|
1350
1352
|
chain: r.sourceToken.blockchain,
|
|
1351
|
-
evmChainId:
|
|
1352
|
-
isNativeEthTransfer: !!r.sourceToken &&
|
|
1353
|
-
tokenAddress: r.sourceToken.assetId ===
|
|
1353
|
+
evmChainId: Q(r.sourceToken.blockchain) ? Te[r.sourceToken.blockchain] : null,
|
|
1354
|
+
isNativeEthTransfer: !!r.sourceToken && Hn(r.sourceToken),
|
|
1355
|
+
tokenAddress: r.sourceToken.assetId === $ ? $ : r.sourceToken.contractAddress,
|
|
1354
1356
|
sourceAssetId: r.sourceToken.assetId,
|
|
1355
1357
|
targetAssetId: r.targetToken.assetId
|
|
1356
1358
|
}, u = l(d.address);
|
|
1357
1359
|
try {
|
|
1358
|
-
const
|
|
1359
|
-
if (!
|
|
1360
|
+
const i = await u(d);
|
|
1361
|
+
if (!i) {
|
|
1360
1362
|
if (e)
|
|
1361
1363
|
return;
|
|
1362
|
-
throw b.error("[TRANSFER ERROR]", "No deposit result"), new
|
|
1364
|
+
throw b.error("[TRANSFER ERROR]", "No deposit result"), new I({
|
|
1363
1365
|
code: "NO_DEPOSIT_RESULT"
|
|
1364
1366
|
});
|
|
1365
1367
|
}
|
|
1366
1368
|
return {
|
|
1367
|
-
hash:
|
|
1368
|
-
transactionLink:
|
|
1369
|
+
hash: i.hash,
|
|
1370
|
+
transactionLink: i.transactionLink,
|
|
1369
1371
|
intent: void 0
|
|
1370
1372
|
};
|
|
1371
|
-
} catch (
|
|
1372
|
-
b.error("[TRANSFER ERROR]",
|
|
1373
|
+
} catch (i) {
|
|
1374
|
+
b.error("[TRANSFER ERROR]", i, { error: i });
|
|
1373
1375
|
let m = "Failed to make a transfer. Please try again.";
|
|
1374
|
-
const
|
|
1375
|
-
if (
|
|
1376
|
+
const h = i instanceof Error && Ae(i.message);
|
|
1377
|
+
if (h)
|
|
1376
1378
|
return;
|
|
1377
|
-
throw
|
|
1379
|
+
throw mn.isAxiosError(i) ? (m = i.response?.data?.detail ?? i.message ?? "Failed to make deposit. Please try again.", new I({
|
|
1378
1380
|
code: "QUOTE_ERROR",
|
|
1379
1381
|
meta: { message: m }
|
|
1380
|
-
})) : m === "No quotes found" ? new
|
|
1382
|
+
})) : m === "No quotes found" ? new I({
|
|
1381
1383
|
code: "NO_QUOTE_FOUND"
|
|
1382
|
-
}) :
|
|
1384
|
+
}) : i instanceof Error && !h ? new I({
|
|
1383
1385
|
code: "QUOTE_ERROR",
|
|
1384
|
-
meta: { message:
|
|
1385
|
-
}) : new
|
|
1386
|
+
meta: { message: i.message }
|
|
1387
|
+
}) : new I({
|
|
1386
1388
|
code: "QUOTE_ERROR",
|
|
1387
1389
|
meta: { message: "Unknown quote transfer error" }
|
|
1388
1390
|
});
|
|
1389
1391
|
}
|
|
1390
1392
|
} };
|
|
1391
1393
|
};
|
|
1392
|
-
class
|
|
1394
|
+
class fr {
|
|
1393
1395
|
constructor(t, r) {
|
|
1394
1396
|
this.account = t, this.provider = r;
|
|
1395
1397
|
}
|
|
@@ -1399,7 +1401,7 @@ class tr {
|
|
|
1399
1401
|
deadline: t.deadline,
|
|
1400
1402
|
nonce: t.nonce,
|
|
1401
1403
|
intents: t.intents,
|
|
1402
|
-
signer_id: t.signer_id ??
|
|
1404
|
+
signer_id: t.signer_id ?? Qe.authHandleToIntentsUserId({
|
|
1403
1405
|
identifier: this.account.walletAddress,
|
|
1404
1406
|
method: "evm"
|
|
1405
1407
|
})
|
|
@@ -1414,14 +1416,14 @@ class tr {
|
|
|
1414
1416
|
return {
|
|
1415
1417
|
payload: r,
|
|
1416
1418
|
standard: "erc191",
|
|
1417
|
-
signature:
|
|
1419
|
+
signature: Qe.transformERC191Signature(a)
|
|
1418
1420
|
};
|
|
1419
1421
|
}
|
|
1420
1422
|
}
|
|
1421
|
-
const
|
|
1423
|
+
const pr = ({
|
|
1422
1424
|
walletAddress: e,
|
|
1423
1425
|
getProvider: t
|
|
1424
|
-
}) =>
|
|
1426
|
+
}) => zn({
|
|
1425
1427
|
accountId: e,
|
|
1426
1428
|
signMessage: async (r) => {
|
|
1427
1429
|
const s = t();
|
|
@@ -1431,7 +1433,7 @@ const nr = ({
|
|
|
1431
1433
|
try {
|
|
1432
1434
|
n = await s.signMessage({
|
|
1433
1435
|
...r,
|
|
1434
|
-
nonce:
|
|
1436
|
+
nonce: Fe.from(r.nonce)
|
|
1435
1437
|
});
|
|
1436
1438
|
} catch (a) {
|
|
1437
1439
|
throw new W("Near wallet failed to sign a message", {
|
|
@@ -1445,25 +1447,25 @@ const nr = ({
|
|
|
1445
1447
|
signature: n.signature
|
|
1446
1448
|
};
|
|
1447
1449
|
}
|
|
1448
|
-
}),
|
|
1450
|
+
}), hr = (e, t) => {
|
|
1449
1451
|
if (t) {
|
|
1450
1452
|
if (e.sendAddress)
|
|
1451
1453
|
return e.sendAddress;
|
|
1452
|
-
throw new
|
|
1454
|
+
throw new I({
|
|
1453
1455
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1454
1456
|
meta: { message: "Send to address is required for a direct transfer" }
|
|
1455
1457
|
});
|
|
1456
1458
|
}
|
|
1457
1459
|
if (!e.quote || e.quote.dry)
|
|
1458
|
-
throw new
|
|
1460
|
+
throw new I({
|
|
1459
1461
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1460
1462
|
meta: { message: "Quote is required for intents non-direct transfer" }
|
|
1461
1463
|
});
|
|
1462
1464
|
return e.quote.depositAddress;
|
|
1463
|
-
},
|
|
1464
|
-
let r =
|
|
1465
|
+
}, Tr = async (e, t) => {
|
|
1466
|
+
let r = Me.getItem("nearWalletsPk")[t];
|
|
1465
1467
|
if (!e.signMessage)
|
|
1466
|
-
throw new
|
|
1468
|
+
throw new I({
|
|
1467
1469
|
code: "DIRECT_TRANSFER_ERROR",
|
|
1468
1470
|
meta: { message: "Your wallet doesn't support signing messages" }
|
|
1469
1471
|
});
|
|
@@ -1472,28 +1474,28 @@ const nr = ({
|
|
|
1472
1474
|
const a = await e.signMessage({
|
|
1473
1475
|
message: "Authenticate",
|
|
1474
1476
|
recipient: "intents.near",
|
|
1475
|
-
nonce:
|
|
1477
|
+
nonce: Fe.from(Jn(32))
|
|
1476
1478
|
});
|
|
1477
1479
|
if (!a)
|
|
1478
|
-
throw new
|
|
1480
|
+
throw new I({
|
|
1479
1481
|
code: "DIRECT_TRANSFER_ERROR",
|
|
1480
1482
|
meta: { message: "Signing message failed" }
|
|
1481
1483
|
});
|
|
1482
|
-
r = a.publicKey,
|
|
1484
|
+
r = a.publicKey, Me.setItem("nearWalletsPk", {
|
|
1483
1485
|
[t]: a.publicKey
|
|
1484
1486
|
});
|
|
1485
1487
|
} catch {
|
|
1486
|
-
throw new
|
|
1488
|
+
throw new I({
|
|
1487
1489
|
code: "DIRECT_TRANSFER_ERROR",
|
|
1488
1490
|
meta: { message: "Your wallet doesn't support signing messages" }
|
|
1489
1491
|
});
|
|
1490
1492
|
}
|
|
1491
|
-
const s =
|
|
1493
|
+
const s = te({
|
|
1492
1494
|
walletAddress: t,
|
|
1493
1495
|
addressType: "near"
|
|
1494
1496
|
});
|
|
1495
|
-
if (!await
|
|
1496
|
-
contractId:
|
|
1497
|
+
if (!await ts({
|
|
1498
|
+
contractId: ke,
|
|
1497
1499
|
methodName: "has_public_key",
|
|
1498
1500
|
args: {
|
|
1499
1501
|
account_id: s,
|
|
@@ -1504,7 +1506,7 @@ const nr = ({
|
|
|
1504
1506
|
await e.signAndSendTransactions({
|
|
1505
1507
|
transactions: [
|
|
1506
1508
|
{
|
|
1507
|
-
receiverId:
|
|
1509
|
+
receiverId: ke,
|
|
1508
1510
|
signerId: t,
|
|
1509
1511
|
actions: [
|
|
1510
1512
|
{
|
|
@@ -1521,136 +1523,136 @@ const nr = ({
|
|
|
1521
1523
|
]
|
|
1522
1524
|
});
|
|
1523
1525
|
} catch {
|
|
1524
|
-
throw new
|
|
1526
|
+
throw new I({
|
|
1525
1527
|
code: "DIRECT_TRANSFER_ERROR",
|
|
1526
1528
|
meta: { message: "Unable to add public key to intents account" }
|
|
1527
1529
|
});
|
|
1528
1530
|
}
|
|
1529
|
-
},
|
|
1530
|
-
const { ctx: t } =
|
|
1531
|
+
}, gr = ({ providers: e }) => {
|
|
1532
|
+
const { ctx: t } = _(), { appName: r, intentsAccountType: s } = y(), {
|
|
1531
1533
|
isNativeNearDeposit: n,
|
|
1532
1534
|
isDirectNearTokenWithdrawal: a,
|
|
1533
1535
|
isDirectNonNearWithdrawal: l
|
|
1534
|
-
} =
|
|
1536
|
+
} = j();
|
|
1535
1537
|
return { make: async ({
|
|
1536
1538
|
message: d,
|
|
1537
1539
|
onPending: u
|
|
1538
1540
|
}) => {
|
|
1539
1541
|
if (!t.walletAddress)
|
|
1540
|
-
throw new
|
|
1542
|
+
throw new I({
|
|
1541
1543
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1542
1544
|
meta: { message: "No connected wallet to sign a transfer." }
|
|
1543
1545
|
});
|
|
1544
1546
|
if (!t.sourceToken || !t.targetToken)
|
|
1545
|
-
throw new
|
|
1547
|
+
throw new I({
|
|
1546
1548
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1547
1549
|
meta: { message: "No token selected to transfer." }
|
|
1548
1550
|
});
|
|
1549
1551
|
if (!t.sourceToken.isIntent)
|
|
1550
|
-
throw new
|
|
1552
|
+
throw new I({
|
|
1551
1553
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1552
1554
|
meta: {
|
|
1553
1555
|
message: "For not intents source token use useMakeQuoteTransfer instead"
|
|
1554
1556
|
}
|
|
1555
1557
|
});
|
|
1556
|
-
let
|
|
1558
|
+
let i;
|
|
1557
1559
|
if (!s)
|
|
1558
|
-
throw new
|
|
1560
|
+
throw new I({
|
|
1559
1561
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1560
1562
|
meta: { message: "Intents account type is not defined" }
|
|
1561
1563
|
});
|
|
1562
1564
|
switch (s) {
|
|
1563
1565
|
case "evm":
|
|
1564
1566
|
if (!e?.evm)
|
|
1565
|
-
throw new
|
|
1567
|
+
throw new I({
|
|
1566
1568
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1567
1569
|
meta: { message: "No EVM provider configured" }
|
|
1568
1570
|
});
|
|
1569
|
-
|
|
1571
|
+
i = new fr(
|
|
1570
1572
|
{ walletAddress: t.walletAddress },
|
|
1571
1573
|
e.evm
|
|
1572
1574
|
);
|
|
1573
1575
|
break;
|
|
1574
1576
|
case "sol":
|
|
1575
1577
|
if (!e?.sol)
|
|
1576
|
-
throw new
|
|
1578
|
+
throw new I({
|
|
1577
1579
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1578
1580
|
meta: { message: "No SOL provider configured" }
|
|
1579
1581
|
});
|
|
1580
|
-
|
|
1582
|
+
i = new es(
|
|
1581
1583
|
{ walletAddress: t.walletAddress },
|
|
1582
1584
|
e.sol
|
|
1583
1585
|
);
|
|
1584
1586
|
break;
|
|
1585
1587
|
case "near": {
|
|
1586
1588
|
if (!e?.near)
|
|
1587
|
-
throw new
|
|
1589
|
+
throw new I({
|
|
1588
1590
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1589
1591
|
meta: { message: "No NEAR provider configured" }
|
|
1590
1592
|
});
|
|
1591
|
-
await
|
|
1593
|
+
await Tr(e.near(), t.walletAddress), i = pr({
|
|
1592
1594
|
walletAddress: t.walletAddress,
|
|
1593
1595
|
getProvider: e.near
|
|
1594
1596
|
});
|
|
1595
1597
|
break;
|
|
1596
1598
|
}
|
|
1597
1599
|
default:
|
|
1598
|
-
|
|
1600
|
+
Ce(s);
|
|
1599
1601
|
}
|
|
1600
|
-
const m = new
|
|
1601
|
-
m.setIntentSigner(
|
|
1602
|
-
let
|
|
1603
|
-
n ?
|
|
1604
|
-
const
|
|
1602
|
+
const m = new Yn({ referral: dt(r) });
|
|
1603
|
+
m.setIntentSigner(i);
|
|
1604
|
+
let h;
|
|
1605
|
+
n ? h = void 0 : a ? h = Zn(d ?? void 0) : l ? h = void 0 : h = Xn();
|
|
1606
|
+
const g = m.createWithdrawal({
|
|
1605
1607
|
withdrawalParams: {
|
|
1606
1608
|
assetId: t.sourceToken.assetId,
|
|
1607
1609
|
amount: BigInt(t.sourceTokenAmount),
|
|
1608
|
-
destinationAddress:
|
|
1610
|
+
destinationAddress: hr(
|
|
1609
1611
|
t,
|
|
1610
1612
|
a || l
|
|
1611
1613
|
),
|
|
1612
1614
|
destinationMemo: void 0,
|
|
1613
1615
|
feeInclusive: !1,
|
|
1614
|
-
routeConfig:
|
|
1616
|
+
routeConfig: h
|
|
1615
1617
|
}
|
|
1616
1618
|
});
|
|
1617
1619
|
try {
|
|
1618
|
-
await
|
|
1619
|
-
const f = await
|
|
1620
|
+
await g.estimateFee(), u("WAITING_CONFIRMATION");
|
|
1621
|
+
const f = await g.signAndSendIntent();
|
|
1620
1622
|
u("PROCESSING");
|
|
1621
|
-
const
|
|
1622
|
-
return await
|
|
1623
|
-
hash:
|
|
1624
|
-
transactionLink:
|
|
1623
|
+
const w = await g.waitForIntentSettlement();
|
|
1624
|
+
return await g.waitForWithdrawalCompletion(), {
|
|
1625
|
+
hash: w.hash,
|
|
1626
|
+
transactionLink: ns(en.near, w.hash),
|
|
1625
1627
|
intent: f
|
|
1626
1628
|
};
|
|
1627
1629
|
} catch (f) {
|
|
1628
1630
|
if (b.error("[TRANSFER ERROR]", f), f instanceof Error) {
|
|
1629
1631
|
if (f.message.includes("Fee is not estimated"))
|
|
1630
|
-
throw new
|
|
1632
|
+
throw new I({
|
|
1631
1633
|
code: "FEES_NOT_ESTIMATED"
|
|
1632
1634
|
});
|
|
1633
|
-
if (
|
|
1635
|
+
if (Ae(f.message) || Ae(`${f.cause}`))
|
|
1634
1636
|
return;
|
|
1635
1637
|
}
|
|
1636
|
-
throw new
|
|
1638
|
+
throw new I({
|
|
1637
1639
|
code: "DIRECT_TRANSFER_ERROR"
|
|
1638
1640
|
});
|
|
1639
1641
|
}
|
|
1640
1642
|
} };
|
|
1641
|
-
},
|
|
1643
|
+
}, Ir = ({
|
|
1642
1644
|
message: e,
|
|
1643
1645
|
providers: t,
|
|
1644
1646
|
makeTransfer: r
|
|
1645
1647
|
}) => {
|
|
1646
|
-
const { ctx: s } =
|
|
1648
|
+
const { ctx: s } = _(), {
|
|
1647
1649
|
isDirectTokenOnNearDeposit: n,
|
|
1648
1650
|
isDirectTokenOnNearTransfer: a,
|
|
1649
1651
|
isNativeNearDeposit: l
|
|
1650
|
-
} =
|
|
1652
|
+
} = j(), { make: c } = gr({ providers: t }), { make: d } = mr({
|
|
1651
1653
|
makeTransfer: r,
|
|
1652
1654
|
providers: t
|
|
1653
|
-
}), { make: u } =
|
|
1655
|
+
}), { make: u } = ur(
|
|
1654
1656
|
t?.near
|
|
1655
1657
|
);
|
|
1656
1658
|
return { make: async () => {
|
|
@@ -1662,23 +1664,23 @@ const nr = ({
|
|
|
1662
1664
|
status: "pending",
|
|
1663
1665
|
reason: "WAITING_CONFIRMATION"
|
|
1664
1666
|
}), s.sourceToken?.isIntent)
|
|
1665
|
-
m = await
|
|
1667
|
+
m = await c({
|
|
1666
1668
|
message: e,
|
|
1667
|
-
onPending: (
|
|
1669
|
+
onPending: (h) => {
|
|
1668
1670
|
p("transferSetStatus", {
|
|
1669
1671
|
status: "pending",
|
|
1670
|
-
reason:
|
|
1672
|
+
reason: h
|
|
1671
1673
|
});
|
|
1672
1674
|
}
|
|
1673
1675
|
});
|
|
1674
1676
|
else if ((l || n) && !s.isDepositFromExternalWallet)
|
|
1675
1677
|
m = await u(
|
|
1676
|
-
s.sendAddress ??
|
|
1678
|
+
s.sendAddress ?? ke,
|
|
1677
1679
|
e
|
|
1678
1680
|
);
|
|
1679
1681
|
else if (a) {
|
|
1680
1682
|
if (!s.sendAddress)
|
|
1681
|
-
throw new
|
|
1683
|
+
throw new I({
|
|
1682
1684
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1683
1685
|
meta: { message: "No recipient address to transfer" }
|
|
1684
1686
|
});
|
|
@@ -1688,8 +1690,8 @@ const nr = ({
|
|
|
1688
1690
|
);
|
|
1689
1691
|
} else
|
|
1690
1692
|
m = await d();
|
|
1691
|
-
} catch (
|
|
1692
|
-
|
|
1693
|
+
} catch (h) {
|
|
1694
|
+
h instanceof I && (b.error(h.data), p("transferSetStatus", { status: "error" }), p("errorSet", h.data));
|
|
1693
1695
|
}
|
|
1694
1696
|
if (!m) {
|
|
1695
1697
|
p("transferSetStatus", { status: "idle" });
|
|
@@ -1697,73 +1699,73 @@ const nr = ({
|
|
|
1697
1699
|
}
|
|
1698
1700
|
return p("transferSetStatus", { status: "success" }), O("transfer_success"), m;
|
|
1699
1701
|
} };
|
|
1700
|
-
},
|
|
1702
|
+
}, wr = async (e) => {
|
|
1701
1703
|
if (!e)
|
|
1702
1704
|
return;
|
|
1703
1705
|
const t = await e.request({
|
|
1704
1706
|
method: "eth_chainId"
|
|
1705
1707
|
});
|
|
1706
1708
|
return parseInt(t, 16);
|
|
1707
|
-
},
|
|
1708
|
-
const { ctx: t } =
|
|
1709
|
+
}, kr = ({ providers: e }) => {
|
|
1710
|
+
const { ctx: t } = _(), [r, s] = re(!1), [n, a] = re(!1), l = he(async () => {
|
|
1709
1711
|
const d = typeof e?.evm == "function" ? await e.evm() : e?.evm;
|
|
1710
1712
|
if (!t.sourceToken || !d)
|
|
1711
1713
|
return !1;
|
|
1712
|
-
const u = await
|
|
1713
|
-
if (!
|
|
1714
|
+
const u = await wr(d);
|
|
1715
|
+
if (!Q(t.sourceToken.blockchain))
|
|
1714
1716
|
return !1;
|
|
1715
|
-
const
|
|
1716
|
-
return !
|
|
1717
|
-
}, [t.sourceToken, e]),
|
|
1717
|
+
const i = Te[t.sourceToken.blockchain];
|
|
1718
|
+
return !i || !u ? !1 : u !== i;
|
|
1719
|
+
}, [t.sourceToken, e]), c = he(async () => {
|
|
1718
1720
|
const d = typeof e?.evm == "function" ? await e.evm() : e?.evm;
|
|
1719
|
-
if (!t.sourceToken || !d || !
|
|
1721
|
+
if (!t.sourceToken || !d || !Q(t.sourceToken.blockchain))
|
|
1720
1722
|
return !1;
|
|
1721
|
-
const u =
|
|
1723
|
+
const u = Te[t.sourceToken.blockchain];
|
|
1722
1724
|
if (!u)
|
|
1723
1725
|
return !1;
|
|
1724
1726
|
try {
|
|
1725
|
-
return s(!0), await
|
|
1726
|
-
} catch (
|
|
1727
|
-
return b.error("Failed to switch chain:",
|
|
1727
|
+
return s(!0), await ss(u, d), !0;
|
|
1728
|
+
} catch (i) {
|
|
1729
|
+
return b.error("Failed to switch chain:", i), !1;
|
|
1728
1730
|
} finally {
|
|
1729
1731
|
s(!1);
|
|
1730
1732
|
}
|
|
1731
1733
|
}, [t.sourceToken, e]);
|
|
1732
|
-
return
|
|
1734
|
+
return C(() => {
|
|
1733
1735
|
l().then(a);
|
|
1734
1736
|
}, [l]), {
|
|
1735
1737
|
isSwitchingChainRequired: n,
|
|
1736
|
-
switchChain:
|
|
1738
|
+
switchChain: c,
|
|
1737
1739
|
isSwitchingChain: r
|
|
1738
1740
|
};
|
|
1739
1741
|
}, N = {
|
|
1740
1742
|
size: "lg",
|
|
1741
1743
|
variant: "primary"
|
|
1742
|
-
},
|
|
1743
|
-
const { t } =
|
|
1744
|
+
}, Le = (e) => {
|
|
1745
|
+
const { t } = M();
|
|
1744
1746
|
if (e.error?.code === "TOKEN_IS_NOT_SUPPORTED")
|
|
1745
|
-
return /* @__PURE__ */
|
|
1747
|
+
return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.invalidAddress", "Invalid address") });
|
|
1746
1748
|
if (e.state === "initial_wallet" && e.error?.code === "SEND_ADDRESS_IS_EMPTY")
|
|
1747
|
-
return /* @__PURE__ */
|
|
1749
|
+
return /* @__PURE__ */ o(A, { state: "disabled", ...N, children: t("submit.disabled.enterRecipientAddress", "Enter recipient address") });
|
|
1748
1750
|
if (e.state === "initial_wallet" && e.error?.code === "SEND_ADDRESS_IS_NOT_FOUND")
|
|
1749
|
-
return /* @__PURE__ */
|
|
1751
|
+
return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.sendAddressNotFound", {
|
|
1750
1752
|
defaultValue: "Address not found on {{chain}}",
|
|
1751
1753
|
chain: e.error.meta.chain.toUpperCase()
|
|
1752
1754
|
}) });
|
|
1753
1755
|
if (e.state === "initial_wallet" && e.error?.code === "SEND_ADDRESS_IS_INVALID")
|
|
1754
|
-
return /* @__PURE__ */
|
|
1756
|
+
return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.sendAddressInvalid", {
|
|
1755
1757
|
defaultValue: "Invalid {{chain}} address",
|
|
1756
1758
|
chain: e.error.meta.chain.toUpperCase()
|
|
1757
1759
|
}) });
|
|
1758
1760
|
if (e.error?.code === "QUOTE_AMOUNT_IS_TOO_LOW")
|
|
1759
|
-
return /* @__PURE__ */
|
|
1760
|
-
/* @__PURE__ */
|
|
1761
|
-
/* @__PURE__ */
|
|
1761
|
+
return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
|
|
1762
|
+
/* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.amountTooLow.label", "Amount is too low") }),
|
|
1763
|
+
/* @__PURE__ */ o(K, { children: /* @__PURE__ */ T(Ht, { i18nKey: "submit.error.amountTooLow.message", children: [
|
|
1762
1764
|
"Amount you entered is very low. Please try increasing it",
|
|
1763
1765
|
" ",
|
|
1764
|
-
/* @__PURE__ */
|
|
1766
|
+
/* @__PURE__ */ T("span", { className: "text-nowrap", children: [
|
|
1765
1767
|
"above ",
|
|
1766
|
-
/* @__PURE__ */
|
|
1768
|
+
/* @__PURE__ */ o(Oe, { value: e.error.meta.minAmount ?? "0" }),
|
|
1767
1769
|
" ",
|
|
1768
1770
|
e.sourceToken?.symbol ?? "",
|
|
1769
1771
|
"."
|
|
@@ -1771,64 +1773,82 @@ const nr = ({
|
|
|
1771
1773
|
] }) })
|
|
1772
1774
|
] });
|
|
1773
1775
|
if (e.quoteStatus === "error")
|
|
1774
|
-
return /* @__PURE__ */
|
|
1775
|
-
/* @__PURE__ */
|
|
1776
|
-
/* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
|
|
1777
|
+
/* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.quoteFailed.label", "Quote failed") }),
|
|
1778
|
+
/* @__PURE__ */ o(K, { children: t(
|
|
1777
1779
|
"submit.error.quoteFailed.message",
|
|
1778
1780
|
"We couldn’t finalize your quote. Please try again or adjust your values."
|
|
1779
1781
|
) })
|
|
1780
1782
|
] });
|
|
1781
1783
|
if (e.error?.code === "TRANSFER_INVALID_INITIAL")
|
|
1782
|
-
return /* @__PURE__ */
|
|
1783
|
-
/* @__PURE__ */
|
|
1784
|
-
e.error.meta?.message ? /* @__PURE__ */
|
|
1784
|
+
return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
|
|
1785
|
+
/* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.invalidTransferData.label", "Invalid transfer data") }),
|
|
1786
|
+
e.error.meta?.message ? /* @__PURE__ */ o(K, { children: e.error.meta.message }) : null
|
|
1787
|
+
] });
|
|
1788
|
+
if (e.error?.code === "EXTERNAL_TRANSFER_FAILED")
|
|
1789
|
+
return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.externalTransferFailed.label", "Transfer failed") });
|
|
1790
|
+
if (e.error?.code === "EXTERNAL_TRANSFER_INCOMPLETE")
|
|
1791
|
+
return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
|
|
1792
|
+
/* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.externalTransferFailed.label", "Transfer failed") }),
|
|
1793
|
+
/* @__PURE__ */ o(K, { children: t(
|
|
1794
|
+
"submit.error.externalTransferFailed.incompleteMessage",
|
|
1795
|
+
"Incomplete transfer. Deposited amount will be refunded."
|
|
1796
|
+
) })
|
|
1797
|
+
] });
|
|
1798
|
+
if (e.error?.code === "EXTERNAL_TRANSFER_REFUNDED")
|
|
1799
|
+
return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
|
|
1800
|
+
/* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.externalTransferFailed.label", "Transfer failed") }),
|
|
1801
|
+
/* @__PURE__ */ o(K, { children: t(
|
|
1802
|
+
"submit.error.externalTransferFailed.refundedMessage",
|
|
1803
|
+
"Deposited amount will be refunded."
|
|
1804
|
+
) })
|
|
1785
1805
|
] });
|
|
1786
1806
|
if (e.error?.code === "DIRECT_TRANSFER_ERROR")
|
|
1787
|
-
return /* @__PURE__ */
|
|
1788
|
-
/* @__PURE__ */
|
|
1789
|
-
e.error.meta?.message ? /* @__PURE__ */
|
|
1807
|
+
return /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
|
|
1808
|
+
/* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.transferFailed.label", "Transfer failed") }),
|
|
1809
|
+
e.error.meta?.message ? /* @__PURE__ */ o(K, { children: e.error.meta.message }) : null
|
|
1790
1810
|
] });
|
|
1791
1811
|
if (e.error?.code === "SOURCE_BALANCE_INSUFFICIENT")
|
|
1792
|
-
return /* @__PURE__ */
|
|
1793
|
-
},
|
|
1794
|
-
const { t } =
|
|
1795
|
-
return /* @__PURE__ */
|
|
1796
|
-
},
|
|
1797
|
-
const { ctx: e } =
|
|
1798
|
-
return
|
|
1799
|
-
},
|
|
1800
|
-
const { providers: t, makeTransfer: r, onSuccess: s } = e, { ctx: n } =
|
|
1812
|
+
return /* @__PURE__ */ o(A, { state: "error", ...N, children: t("submit.error.insufficientBalance", "Insufficient balance") });
|
|
1813
|
+
}, Ar = ({ onClick: e }) => {
|
|
1814
|
+
const { t } = M();
|
|
1815
|
+
return /* @__PURE__ */ o(A, { state: "disabled", ...N, onClick: e, children: t("submit.error.connectWallet", "Connect wallet") });
|
|
1816
|
+
}, Sr = () => {
|
|
1817
|
+
const { ctx: e } = _();
|
|
1818
|
+
return Le(e) ?? null;
|
|
1819
|
+
}, Nr = (e) => {
|
|
1820
|
+
const { providers: t, makeTransfer: r, onSuccess: s } = e, { ctx: n } = _(), { t: a } = M(), {
|
|
1801
1821
|
isNativeNearDeposit: l,
|
|
1802
|
-
isDirectNonNearWithdrawal:
|
|
1822
|
+
isDirectNonNearWithdrawal: c,
|
|
1803
1823
|
isDirectTokenOnNearDeposit: d,
|
|
1804
1824
|
isDirectNearTokenWithdrawal: u
|
|
1805
|
-
} =
|
|
1806
|
-
if (m && !await
|
|
1825
|
+
} = j(), { make: i } = Ir({ providers: t, makeTransfer: r }), { isSwitchingChainRequired: m, switchChain: h, isSwitchingChain: g } = kr({ providers: t }), f = Le(n), w = async () => {
|
|
1826
|
+
if (m && !await h())
|
|
1807
1827
|
return;
|
|
1808
|
-
const S = await
|
|
1828
|
+
const S = await i();
|
|
1809
1829
|
S && s(S);
|
|
1810
1830
|
};
|
|
1811
1831
|
if (!n.targetToken)
|
|
1812
|
-
return /* @__PURE__ */
|
|
1813
|
-
if (!
|
|
1814
|
-
return /* @__PURE__ */
|
|
1832
|
+
return /* @__PURE__ */ o(A, { ...N, state: "disabled", children: a("submit.disabled.selectTokenToReceive", "Select token to receive") });
|
|
1833
|
+
if (!ne(n.sourceTokenAmount))
|
|
1834
|
+
return /* @__PURE__ */ o(A, { ...N, state: "disabled", children: a("submit.disabled.enterAmount", "Enter amount") });
|
|
1815
1835
|
if (n.areInputsValidating)
|
|
1816
|
-
return /* @__PURE__ */
|
|
1817
|
-
if (
|
|
1818
|
-
return /* @__PURE__ */
|
|
1836
|
+
return /* @__PURE__ */ o(A, { state: "loading", ...N, children: a("submit.pending.validating", "Validating...") });
|
|
1837
|
+
if (g)
|
|
1838
|
+
return /* @__PURE__ */ o(A, { state: "loading", ...N, children: a("submit.pending.switchingChain", "Switching network...") });
|
|
1819
1839
|
if (!m && f)
|
|
1820
1840
|
return f;
|
|
1821
1841
|
if (n.transferStatus.status === "pending")
|
|
1822
1842
|
switch (n.transferStatus.reason) {
|
|
1823
1843
|
case "WAITING_CONFIRMATION":
|
|
1824
|
-
return /* @__PURE__ */
|
|
1844
|
+
return /* @__PURE__ */ o(A, { state: "loading", ...N, children: a("submit.pending.transfer.confirmInWallet", "Confirm in wallet") });
|
|
1825
1845
|
case "PROCESSING":
|
|
1826
1846
|
default:
|
|
1827
|
-
return /* @__PURE__ */
|
|
1847
|
+
return /* @__PURE__ */ o(A, { state: "loading", ...N, children: a("submit.pending.transfer.finalizing", "Finalizing transfer") });
|
|
1828
1848
|
}
|
|
1829
|
-
return n.transferStatus.status === "error" ? /* @__PURE__ */
|
|
1830
|
-
/* @__PURE__ */
|
|
1831
|
-
/* @__PURE__ */
|
|
1849
|
+
return n.transferStatus.status === "error" ? /* @__PURE__ */ T("div", { className: "gap-sw-md flex flex-col", children: [
|
|
1850
|
+
/* @__PURE__ */ o(A, { ...N, children: e.label }),
|
|
1851
|
+
/* @__PURE__ */ o(K, { children: (() => {
|
|
1832
1852
|
switch (n.error?.code) {
|
|
1833
1853
|
case "FEES_NOT_ESTIMATED":
|
|
1834
1854
|
return a(
|
|
@@ -1842,48 +1862,48 @@ const nr = ({
|
|
|
1842
1862
|
);
|
|
1843
1863
|
}
|
|
1844
1864
|
})() })
|
|
1845
|
-
] }) : n.quoteStatus === "pending" ? /* @__PURE__ */
|
|
1846
|
-
},
|
|
1847
|
-
const { t } =
|
|
1848
|
-
return r.isDepositFromExternalWallet ?
|
|
1849
|
-
},
|
|
1850
|
-
const { ctx: t } =
|
|
1851
|
-
return t.walletAddress ? /* @__PURE__ */
|
|
1865
|
+
] }) : n.quoteStatus === "pending" ? /* @__PURE__ */ o(A, { state: "loading", ...N, children: n.quote ? a("submit.pending.quote.refreshing", "Refreshing quote") : a("submit.pending.quote.finalizing", "Finalizing quote") }) : n.error ? /* @__PURE__ */ o(A, { state: "disabled", ...N, children: e.label }) : !n.quote && !c && !d && !u && !l ? /* @__PURE__ */ o(A, { state: "disabled", ...N, children: e.label }) : /* @__PURE__ */ o(A, { ...N, onClick: w, children: e.label });
|
|
1866
|
+
}, _r = (e) => {
|
|
1867
|
+
const { t } = M(), { ctx: r } = _(), s = Le(r);
|
|
1868
|
+
return r.isDepositFromExternalWallet ? ne(r.sourceTokenAmount) ? r.externalDepositTxReceived ? /* @__PURE__ */ o(A, { state: "loading", ...N, children: t("submit.pending.externalDeposit.processing", "Processing") }) : /* @__PURE__ */ o(A, { state: "loading", ...N, children: t("submit.pending.externalDeposit.waiting", "Waiting for transaction") }) : /* @__PURE__ */ o(A, { ...N, state: "disabled", children: t("submit.disabled.enterAmount", "Enter amount") }) : s || /* @__PURE__ */ o(Nr, { ...e });
|
|
1869
|
+
}, yr = (e) => {
|
|
1870
|
+
const { ctx: t } = _(), r = y();
|
|
1871
|
+
return t.walletAddress ? /* @__PURE__ */ o(_r, { ...e }) : /* @__PURE__ */ o(Ar, { onClick: r.onWalletSignin });
|
|
1852
1872
|
};
|
|
1853
|
-
|
|
1854
|
-
const
|
|
1855
|
-
const { t } =
|
|
1856
|
-
return s.sourceToken ? /* @__PURE__ */
|
|
1857
|
-
|
|
1873
|
+
yr.Error = Sr;
|
|
1874
|
+
const br = ({ className: e }) => {
|
|
1875
|
+
const { t } = M(), { slippageTolerance: r } = y(), { ctx: s } = _(), n = s.sourceToken && s.targetToken && s.sourceToken.price / s.targetToken.price;
|
|
1876
|
+
return s.sourceToken ? /* @__PURE__ */ o(
|
|
1877
|
+
rs,
|
|
1858
1878
|
{
|
|
1859
1879
|
expandedByDefault: !1,
|
|
1860
1880
|
expandedHeightPx: s.walletAddress ? 80 : 50,
|
|
1861
1881
|
isBadgeLoading: s.quoteStatus === "pending",
|
|
1862
1882
|
badge: s.quote ? `~ ${s.quote.timeEstimate} sec` : void 0,
|
|
1863
1883
|
className: e,
|
|
1864
|
-
title: s.sourceToken && s.targetToken ? /* @__PURE__ */
|
|
1884
|
+
title: s.sourceToken && s.targetToken ? /* @__PURE__ */ T("span", { style: { borderBottomWidth: "2px", borderStyle: "dotted" }, children: [
|
|
1865
1885
|
`1 ${s.sourceToken.symbol} ≈ `,
|
|
1866
1886
|
" ",
|
|
1867
|
-
|
|
1887
|
+
as(n ?? 0),
|
|
1868
1888
|
" ",
|
|
1869
1889
|
`${s.targetToken.symbol}`,
|
|
1870
|
-
/* @__PURE__ */
|
|
1871
|
-
] }) : /* @__PURE__ */
|
|
1890
|
+
/* @__PURE__ */ o("span", { className: "text-sw-gray-50", children: ` (${$e(s.sourceToken.price)})` })
|
|
1891
|
+
] }) : /* @__PURE__ */ T("span", { style: { borderBottomWidth: "2px", borderStyle: "dotted" }, children: [
|
|
1872
1892
|
`1 ${s.sourceToken.symbol} ≈ `,
|
|
1873
1893
|
" ",
|
|
1874
|
-
|
|
1894
|
+
$e(s.sourceToken.price),
|
|
1875
1895
|
" USD"
|
|
1876
1896
|
] }),
|
|
1877
|
-
children: /* @__PURE__ */
|
|
1878
|
-
/* @__PURE__ */
|
|
1879
|
-
|
|
1897
|
+
children: /* @__PURE__ */ T(de, { children: [
|
|
1898
|
+
/* @__PURE__ */ o(
|
|
1899
|
+
de.Item,
|
|
1880
1900
|
{
|
|
1881
1901
|
label: t("quote.result.maxSlippage.label", "Max slippage"),
|
|
1882
1902
|
value: `${(r / 100).toFixed(2)}%`
|
|
1883
1903
|
}
|
|
1884
1904
|
),
|
|
1885
|
-
!!s.walletAddress && /* @__PURE__ */
|
|
1886
|
-
|
|
1905
|
+
!!s.walletAddress && /* @__PURE__ */ o(
|
|
1906
|
+
de.Item,
|
|
1887
1907
|
{
|
|
1888
1908
|
isLoading: s.quoteStatus === "pending",
|
|
1889
1909
|
label: t("quote.result.processingTime.label", "Processing time"),
|
|
@@ -1892,28 +1912,28 @@ const pr = ({ className: e }) => {
|
|
|
1892
1912
|
)
|
|
1893
1913
|
] })
|
|
1894
1914
|
}
|
|
1895
|
-
) : /* @__PURE__ */
|
|
1896
|
-
},
|
|
1897
|
-
Skeleton:
|
|
1898
|
-
}),
|
|
1915
|
+
) : /* @__PURE__ */ o(It, {});
|
|
1916
|
+
}, Pi = Object.assign(br, {
|
|
1917
|
+
Skeleton: It
|
|
1918
|
+
}), Er = ({
|
|
1899
1919
|
token: e,
|
|
1900
1920
|
balance: t,
|
|
1901
1921
|
isNotSufficient: r = !1,
|
|
1902
1922
|
onClick: s
|
|
1903
1923
|
}) => {
|
|
1904
|
-
const n =
|
|
1905
|
-
return !e.isIntent && !n.walletSupportedChains.includes(e.blockchain) ? /* @__PURE__ */
|
|
1924
|
+
const n = y();
|
|
1925
|
+
return !e.isIntent && !n.walletSupportedChains.includes(e.blockchain) ? /* @__PURE__ */ o("span", {}) : t === void 0 ? /* @__PURE__ */ o(is, { width: 100 }) : /* @__PURE__ */ o(
|
|
1906
1926
|
"span",
|
|
1907
1927
|
{
|
|
1908
1928
|
onClick: t ? s : void 0,
|
|
1909
1929
|
style: t ? { borderBottomWidth: "2px", borderStyle: "dotted" } : void 0,
|
|
1910
|
-
className:
|
|
1930
|
+
className: os("text-sw-label-sm", {
|
|
1911
1931
|
"text-sw-status-error": r,
|
|
1912
1932
|
"text-sw-gray-100": !r,
|
|
1913
1933
|
"cursor-pointer": !!t && !!s
|
|
1914
1934
|
}),
|
|
1915
|
-
children: /* @__PURE__ */
|
|
1916
|
-
|
|
1935
|
+
children: /* @__PURE__ */ o(
|
|
1936
|
+
Oe,
|
|
1917
1937
|
{
|
|
1918
1938
|
decimals: e.decimals,
|
|
1919
1939
|
value: t === void 0 ? "0" : `${t}`
|
|
@@ -1921,7 +1941,7 @@ const pr = ({ className: e }) => {
|
|
|
1921
1941
|
)
|
|
1922
1942
|
}
|
|
1923
1943
|
);
|
|
1924
|
-
},
|
|
1944
|
+
}, Be = ({
|
|
1925
1945
|
token: e,
|
|
1926
1946
|
balance: t,
|
|
1927
1947
|
value: r = "",
|
|
@@ -1929,32 +1949,32 @@ const pr = ({ className: e }) => {
|
|
|
1929
1949
|
quoteUsdValue: n,
|
|
1930
1950
|
state: a = "default",
|
|
1931
1951
|
showBalance: l = !0,
|
|
1932
|
-
showQuickBalanceActions:
|
|
1952
|
+
showQuickBalanceActions: c = !0,
|
|
1933
1953
|
heading: d,
|
|
1934
1954
|
onMsg: u
|
|
1935
1955
|
}) => {
|
|
1936
|
-
const
|
|
1956
|
+
const i = Pt(), { ctx: m } = _(), { t: h } = M(), { hideTokenInputHeadings: g } = y(), f = ls(e, r, n), w = (S) => {
|
|
1937
1957
|
u({
|
|
1938
1958
|
type: "on_change_amount",
|
|
1939
|
-
amount:
|
|
1959
|
+
amount: cs(t, e.decimals, S)
|
|
1940
1960
|
});
|
|
1941
1961
|
};
|
|
1942
|
-
return /* @__PURE__ */
|
|
1943
|
-
!
|
|
1944
|
-
/* @__PURE__ */
|
|
1962
|
+
return /* @__PURE__ */ T(ie, { className: "flex flex-col", "aria-label": d, children: [
|
|
1963
|
+
!g && /* @__PURE__ */ o(wt, { children: d }),
|
|
1964
|
+
/* @__PURE__ */ T(
|
|
1945
1965
|
"div",
|
|
1946
1966
|
{
|
|
1947
|
-
className:
|
|
1967
|
+
className: H(
|
|
1948
1968
|
"flex items-center justify-between",
|
|
1949
|
-
!
|
|
1969
|
+
!g && "mt-sw-2xl"
|
|
1950
1970
|
),
|
|
1951
1971
|
children: [
|
|
1952
|
-
/* @__PURE__ */
|
|
1953
|
-
|
|
1972
|
+
/* @__PURE__ */ o(
|
|
1973
|
+
us,
|
|
1954
1974
|
{
|
|
1955
1975
|
value: r,
|
|
1956
|
-
name:
|
|
1957
|
-
setValue:
|
|
1976
|
+
name: i,
|
|
1977
|
+
setValue: ds,
|
|
1958
1978
|
placeholder: "0",
|
|
1959
1979
|
state: a === "default" || a === "disabled" ? a : "error",
|
|
1960
1980
|
onChange: (S) => {
|
|
@@ -1962,12 +1982,12 @@ const pr = ({ className: e }) => {
|
|
|
1962
1982
|
}
|
|
1963
1983
|
}
|
|
1964
1984
|
),
|
|
1965
|
-
/* @__PURE__ */
|
|
1985
|
+
/* @__PURE__ */ T(
|
|
1966
1986
|
"button",
|
|
1967
1987
|
{
|
|
1968
1988
|
type: "button",
|
|
1969
1989
|
onClick: a === "disabled" ? void 0 : () => u({ type: "on_click_select_token" }),
|
|
1970
|
-
className:
|
|
1990
|
+
className: H(
|
|
1971
1991
|
"gap-sw-md pl-sw-sm pr-sw-md flex h-[36px] min-w-[80px] shrink-0 items-center rounded-sw-md transition-colors bg-sw-gray-800 hover:bg-sw-gray-700 group",
|
|
1972
1992
|
{
|
|
1973
1993
|
"cursor-pointer": a !== "disabled",
|
|
@@ -1975,28 +1995,28 @@ const pr = ({ className: e }) => {
|
|
|
1975
1995
|
}
|
|
1976
1996
|
),
|
|
1977
1997
|
children: [
|
|
1978
|
-
/* @__PURE__ */
|
|
1979
|
-
|
|
1998
|
+
/* @__PURE__ */ o(
|
|
1999
|
+
kt,
|
|
1980
2000
|
{
|
|
1981
2001
|
chainShowIcon: !e.isIntent,
|
|
1982
2002
|
className: "border-sw-gray-800 group-hover:border-sw-gray-700 transition-colors top-[14px]",
|
|
1983
2003
|
...e
|
|
1984
2004
|
}
|
|
1985
2005
|
),
|
|
1986
|
-
/* @__PURE__ */
|
|
2006
|
+
/* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-50", children: e.symbol })
|
|
1987
2007
|
]
|
|
1988
2008
|
}
|
|
1989
2009
|
)
|
|
1990
2010
|
]
|
|
1991
2011
|
}
|
|
1992
2012
|
),
|
|
1993
|
-
/* @__PURE__ */
|
|
1994
|
-
/* @__PURE__ */
|
|
1995
|
-
/* @__PURE__ */
|
|
1996
|
-
s ? /* @__PURE__ */
|
|
2013
|
+
/* @__PURE__ */ T("div", { className: "gap-sw-sm min-h-sw-2xl flex items-center justify-between mt-sw-lg", children: [
|
|
2014
|
+
/* @__PURE__ */ T("div", { className: "gap-sw-md flex items-center", children: [
|
|
2015
|
+
/* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-100", children: f }),
|
|
2016
|
+
s ? /* @__PURE__ */ o(
|
|
1997
2017
|
"span",
|
|
1998
2018
|
{
|
|
1999
|
-
className:
|
|
2019
|
+
className: H("text-sw-label-sm text-nowrap", {
|
|
2000
2020
|
"text-sw-gray-400": s >= -2 && s <= 2,
|
|
2001
2021
|
"text-sw-status-success": s > 2,
|
|
2002
2022
|
"text-sw-status-error": s <= -5,
|
|
@@ -2006,57 +2026,57 @@ const pr = ({ className: e }) => {
|
|
|
2006
2026
|
}
|
|
2007
2027
|
) : null
|
|
2008
2028
|
] }),
|
|
2009
|
-
/* @__PURE__ */
|
|
2010
|
-
e && !!m.walletAddress && l && /* @__PURE__ */
|
|
2011
|
-
|
|
2029
|
+
/* @__PURE__ */ T("div", { className: "gap-sw-sm flex items-center", children: [
|
|
2030
|
+
e && !!m.walletAddress && l && /* @__PURE__ */ o(
|
|
2031
|
+
Er,
|
|
2012
2032
|
{
|
|
2013
2033
|
token: e,
|
|
2014
2034
|
balance: t,
|
|
2015
2035
|
isNotSufficient: a === "error-balance",
|
|
2016
|
-
onClick: () =>
|
|
2036
|
+
onClick: () => w(1)
|
|
2017
2037
|
}
|
|
2018
2038
|
),
|
|
2019
|
-
!!t && l &&
|
|
2020
|
-
/* @__PURE__ */
|
|
2021
|
-
|
|
2039
|
+
!!t && l && c && /* @__PURE__ */ T(Ft, { children: [
|
|
2040
|
+
/* @__PURE__ */ o(
|
|
2041
|
+
Ke,
|
|
2022
2042
|
{
|
|
2023
2043
|
isClickable: a !== "disabled",
|
|
2024
|
-
onClick: () =>
|
|
2025
|
-
children:
|
|
2044
|
+
onClick: () => w(2),
|
|
2045
|
+
children: h("tokens.input.half.label", "50%")
|
|
2026
2046
|
}
|
|
2027
2047
|
),
|
|
2028
|
-
/* @__PURE__ */
|
|
2029
|
-
|
|
2048
|
+
/* @__PURE__ */ o(
|
|
2049
|
+
Ke,
|
|
2030
2050
|
{
|
|
2031
2051
|
isClickable: a !== "disabled",
|
|
2032
|
-
onClick: () =>
|
|
2033
|
-
children:
|
|
2052
|
+
onClick: () => w(1),
|
|
2053
|
+
children: h("tokens.input.max.label", "Max")
|
|
2034
2054
|
}
|
|
2035
2055
|
)
|
|
2036
2056
|
] }),
|
|
2037
|
-
!l && /* @__PURE__ */
|
|
2057
|
+
!l && /* @__PURE__ */ o("div", { className: "rounded-full bg-sw-gray-700 py-sw-xs px-sw-sm flex items-center justify-center", children: /* @__PURE__ */ o("span", { className: "text-sw-gray-100 text-sw-label-sm", children: h("tokens.input.externalBalance.label", "External balance") }) })
|
|
2038
2058
|
] })
|
|
2039
2059
|
] })
|
|
2040
2060
|
] });
|
|
2041
|
-
},
|
|
2042
|
-
const { hideTokenInputHeadings: r } =
|
|
2043
|
-
return /* @__PURE__ */
|
|
2044
|
-
|
|
2061
|
+
}, qe = ({ onMsg: e, heading: t }) => {
|
|
2062
|
+
const { hideTokenInputHeadings: r } = y();
|
|
2063
|
+
return /* @__PURE__ */ T(
|
|
2064
|
+
ie,
|
|
2045
2065
|
{
|
|
2046
2066
|
isClickable: !0,
|
|
2047
2067
|
className: "flex flex-col",
|
|
2048
2068
|
onClick: () => e({ type: "on_click_select_token" }),
|
|
2049
2069
|
children: [
|
|
2050
|
-
!r && /* @__PURE__ */
|
|
2051
|
-
/* @__PURE__ */
|
|
2070
|
+
!r && /* @__PURE__ */ o(wt, { children: t }),
|
|
2071
|
+
/* @__PURE__ */ T(
|
|
2052
2072
|
"div",
|
|
2053
2073
|
{
|
|
2054
|
-
className:
|
|
2074
|
+
className: H(
|
|
2055
2075
|
"flex items-center justify-between",
|
|
2056
2076
|
!r && "mt-sw-2xl"
|
|
2057
2077
|
),
|
|
2058
2078
|
children: [
|
|
2059
|
-
/* @__PURE__ */
|
|
2079
|
+
/* @__PURE__ */ o(
|
|
2060
2080
|
"span",
|
|
2061
2081
|
{
|
|
2062
2082
|
className: "h-[36px] font-medium text-sw-gray-200",
|
|
@@ -2064,35 +2084,35 @@ const pr = ({ className: e }) => {
|
|
|
2064
2084
|
children: "0"
|
|
2065
2085
|
}
|
|
2066
2086
|
),
|
|
2067
|
-
/* @__PURE__ */
|
|
2087
|
+
/* @__PURE__ */ o(
|
|
2068
2088
|
"button",
|
|
2069
2089
|
{
|
|
2070
2090
|
type: "button",
|
|
2071
2091
|
onClick: () => e({ type: "on_click_select_token" }),
|
|
2072
2092
|
className: "gap-sw-md px-sw-md flex h-[36px] min-w-[100px] shrink-0 cursor-pointer items-center rounded-sw-md bg-sw-gray-800",
|
|
2073
|
-
children: /* @__PURE__ */
|
|
2093
|
+
children: /* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-50", children: "Select token" })
|
|
2074
2094
|
}
|
|
2075
2095
|
)
|
|
2076
2096
|
]
|
|
2077
2097
|
}
|
|
2078
2098
|
),
|
|
2079
|
-
/* @__PURE__ */
|
|
2099
|
+
/* @__PURE__ */ o("div", { className: "h-sw-2xl w-full mt-sw-lg" })
|
|
2080
2100
|
]
|
|
2081
2101
|
}
|
|
2082
2102
|
);
|
|
2083
|
-
},
|
|
2084
|
-
const { mergedBalance: t } =
|
|
2085
|
-
e ? t[
|
|
2103
|
+
}, vt = (e) => {
|
|
2104
|
+
const { mergedBalance: t } = le(), [r, s] = re(
|
|
2105
|
+
e ? t[G(e)] : void 0
|
|
2086
2106
|
);
|
|
2087
|
-
return
|
|
2107
|
+
return C(() => {
|
|
2088
2108
|
let n;
|
|
2089
2109
|
if (e) {
|
|
2090
|
-
const a = t[
|
|
2110
|
+
const a = t[G(e)];
|
|
2091
2111
|
a ? n = setTimeout(() => {
|
|
2092
2112
|
s(a);
|
|
2093
2113
|
}, 0) : n = setTimeout(() => {
|
|
2094
2114
|
s(
|
|
2095
|
-
e ? t[
|
|
2115
|
+
e ? t[G(e)] ?? 0 : 0
|
|
2096
2116
|
);
|
|
2097
2117
|
}, 2e3);
|
|
2098
2118
|
}
|
|
@@ -2100,23 +2120,23 @@ const pr = ({ className: e }) => {
|
|
|
2100
2120
|
n && clearTimeout(n);
|
|
2101
2121
|
};
|
|
2102
2122
|
}, [e, t]), r;
|
|
2103
|
-
},
|
|
2123
|
+
}, Dt = (e, t) => {
|
|
2104
2124
|
const { tokens: r } = P(e), s = Array.from(
|
|
2105
2125
|
new Set(r.map((n) => n.assetId))
|
|
2106
2126
|
);
|
|
2107
|
-
|
|
2127
|
+
C(() => {
|
|
2108
2128
|
const n = s.length === 1 ? r[0] : null;
|
|
2109
2129
|
n && t({ type: "on_select_token", token: n });
|
|
2110
2130
|
}, [r]);
|
|
2111
|
-
},
|
|
2131
|
+
}, Cr = ({
|
|
2112
2132
|
onMsg: e,
|
|
2113
2133
|
isChanging: t = !0,
|
|
2114
2134
|
showBalance: r = !0,
|
|
2115
2135
|
heading: s
|
|
2116
2136
|
}) => {
|
|
2117
|
-
const { ctx: n } =
|
|
2118
|
-
|
|
2119
|
-
const l =
|
|
2137
|
+
const { ctx: n } = _(), a = vt(n.sourceToken);
|
|
2138
|
+
Dt("source", e);
|
|
2139
|
+
const l = v(() => {
|
|
2120
2140
|
if (!t && n.quoteStatus === "pending")
|
|
2121
2141
|
return "disabled";
|
|
2122
2142
|
if (!n.error)
|
|
@@ -2126,8 +2146,8 @@ const pr = ({ className: e }) => {
|
|
|
2126
2146
|
if (n.error.code === "SOURCE_BALANCE_INSUFFICIENT")
|
|
2127
2147
|
return "error-balance";
|
|
2128
2148
|
}, [t, n.error, n.quoteStatus]);
|
|
2129
|
-
return n.sourceToken ? /* @__PURE__ */
|
|
2130
|
-
|
|
2149
|
+
return n.sourceToken ? /* @__PURE__ */ o(
|
|
2150
|
+
Be,
|
|
2131
2151
|
{
|
|
2132
2152
|
heading: s,
|
|
2133
2153
|
token: n.sourceToken,
|
|
@@ -2135,38 +2155,38 @@ const pr = ({ className: e }) => {
|
|
|
2135
2155
|
balance: a,
|
|
2136
2156
|
showBalance: r,
|
|
2137
2157
|
showQuickBalanceActions: !0,
|
|
2138
|
-
value:
|
|
2158
|
+
value: z(n.sourceTokenAmount, n.sourceToken?.decimals),
|
|
2139
2159
|
onMsg: e
|
|
2140
2160
|
}
|
|
2141
|
-
) : /* @__PURE__ */
|
|
2142
|
-
},
|
|
2161
|
+
) : /* @__PURE__ */ o(qe, { heading: s, onMsg: e });
|
|
2162
|
+
}, Rr = ({
|
|
2143
2163
|
isChanging: e = !1,
|
|
2144
2164
|
onMsg: t,
|
|
2145
2165
|
heading: r
|
|
2146
2166
|
}) => {
|
|
2147
|
-
const { ctx: s } =
|
|
2148
|
-
|
|
2149
|
-
const l =
|
|
2150
|
-
return s.targetToken ? /* @__PURE__ */
|
|
2151
|
-
|
|
2167
|
+
const { ctx: s } = _(), { usdTradeDelta: n } = j(), a = vt(s.targetToken);
|
|
2168
|
+
Dt("target", t);
|
|
2169
|
+
const l = v(() => !e && s.quoteStatus === "pending" ? "disabled" : "default", [e, s.quoteStatus]);
|
|
2170
|
+
return s.targetToken ? /* @__PURE__ */ o(
|
|
2171
|
+
Be,
|
|
2152
2172
|
{
|
|
2153
2173
|
heading: r,
|
|
2154
2174
|
token: s.targetToken,
|
|
2155
2175
|
balance: a,
|
|
2156
2176
|
quoteUsdDelta: n?.percentage,
|
|
2157
2177
|
quoteUsdValue: s.quote && parseFloat(s.quote.amountOutUsd),
|
|
2158
|
-
value:
|
|
2178
|
+
value: z(s.targetTokenAmount, s.targetToken?.decimals),
|
|
2159
2179
|
state: l,
|
|
2160
2180
|
showQuickBalanceActions: !1,
|
|
2161
2181
|
showBalance: !0,
|
|
2162
2182
|
onMsg: t
|
|
2163
2183
|
}
|
|
2164
|
-
) : /* @__PURE__ */
|
|
2165
|
-
},
|
|
2166
|
-
Skeleton:
|
|
2167
|
-
Source:
|
|
2168
|
-
Target:
|
|
2169
|
-
}),
|
|
2184
|
+
) : /* @__PURE__ */ o(qe, { heading: r, onMsg: t });
|
|
2185
|
+
}, vr = ({ token: e, heading: t, ...r }) => e ? /* @__PURE__ */ o(Be, { ...r, token: e, heading: t }) : /* @__PURE__ */ o(qe, { onMsg: r.onMsg, heading: t }), Wi = Object.assign(vr, {
|
|
2186
|
+
Skeleton: ms,
|
|
2187
|
+
Source: Cr,
|
|
2188
|
+
Target: Rr
|
|
2189
|
+
}), Je = 58, xt = ({
|
|
2170
2190
|
token: e,
|
|
2171
2191
|
balance: t,
|
|
2172
2192
|
showBalance: r = !0,
|
|
@@ -2174,11 +2194,11 @@ const pr = ({ className: e }) => {
|
|
|
2174
2194
|
className: n,
|
|
2175
2195
|
onMsg: a
|
|
2176
2196
|
}) => {
|
|
2177
|
-
const { ctx: l } =
|
|
2178
|
-
return /* @__PURE__ */
|
|
2197
|
+
const { ctx: l } = _(), { walletSupportedChains: c, appName: d } = y(), u = fs(t, e), i = c.includes(e.blockchain) || e.isIntent, m = t !== "0" && t !== 0 && t !== void 0;
|
|
2198
|
+
return /* @__PURE__ */ o("li", { className: "list-none group", children: /* @__PURE__ */ T(
|
|
2179
2199
|
"div",
|
|
2180
2200
|
{
|
|
2181
|
-
className:
|
|
2201
|
+
className: H(
|
|
2182
2202
|
"gap-sw-lg p-sw-lg flex justify-between rounded-sw-md transition-colors",
|
|
2183
2203
|
{
|
|
2184
2204
|
"cursor-not-allowed": s,
|
|
@@ -2188,40 +2208,40 @@ const pr = ({ className: e }) => {
|
|
|
2188
2208
|
),
|
|
2189
2209
|
onClick: () => !s && a({ type: "on_select_token", token: e }),
|
|
2190
2210
|
children: [
|
|
2191
|
-
/* @__PURE__ */
|
|
2192
|
-
|
|
2211
|
+
/* @__PURE__ */ o(
|
|
2212
|
+
kt,
|
|
2193
2213
|
{
|
|
2194
2214
|
chainShowIcon: !e.isIntent,
|
|
2195
2215
|
className: "border-sw-gray-900 group-hover:border-sw-gray-800 transition-colors",
|
|
2196
2216
|
...e
|
|
2197
2217
|
}
|
|
2198
2218
|
),
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
/* @__PURE__ */
|
|
2201
|
-
e.isIntent ? /* @__PURE__ */
|
|
2202
|
-
/* @__PURE__ */
|
|
2219
|
+
/* @__PURE__ */ T("div", { className: "gap-sw-xs mr-auto flex flex-col", children: [
|
|
2220
|
+
/* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-50", children: e.name }),
|
|
2221
|
+
e.isIntent ? /* @__PURE__ */ T("div", { className: "flex items-center gap-sw-xs", children: [
|
|
2222
|
+
/* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-300", children: e.symbol }),
|
|
2203
2223
|
" ",
|
|
2204
|
-
/* @__PURE__ */
|
|
2205
|
-
] }) : /* @__PURE__ */
|
|
2206
|
-
/* @__PURE__ */
|
|
2224
|
+
/* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-300", children: `on ${d} ${e.chainName.toLowerCase() !== "near" && m ? `(${e.chainName})` : ""}` })
|
|
2225
|
+
] }) : /* @__PURE__ */ T("div", { className: "flex items-center gap-sw-xs", children: [
|
|
2226
|
+
/* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-300", children: e.symbol }),
|
|
2207
2227
|
" ",
|
|
2208
|
-
/* @__PURE__ */
|
|
2228
|
+
/* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-300", children: `on ${e.chainName}` })
|
|
2209
2229
|
] })
|
|
2210
2230
|
] }),
|
|
2211
|
-
|
|
2212
|
-
t === void 0 && !e.isIntent ? /* @__PURE__ */
|
|
2213
|
-
|
|
2231
|
+
i && !!l.walletAddress && r && /* @__PURE__ */ T("div", { className: "gap-sw-xs flex flex-col items-end", children: [
|
|
2232
|
+
t === void 0 && !e.isIntent ? /* @__PURE__ */ o("span", { className: "h-[16px] w-[60px] animate-pulse rounded-full bg-sw-gray-700" }) : /* @__PURE__ */ o("span", { className: "h-[16px] text-sw-label-md text-sw-gray-50", children: m && /* @__PURE__ */ o(
|
|
2233
|
+
Oe,
|
|
2214
2234
|
{
|
|
2215
2235
|
decimals: e.decimals,
|
|
2216
2236
|
value: t === void 0 ? "0" : `${t}`
|
|
2217
2237
|
}
|
|
2218
2238
|
) }),
|
|
2219
|
-
m && /* @__PURE__ */
|
|
2239
|
+
m && /* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-300", children: u })
|
|
2220
2240
|
] })
|
|
2221
2241
|
]
|
|
2222
2242
|
}
|
|
2223
2243
|
) });
|
|
2224
|
-
},
|
|
2244
|
+
}, et = [
|
|
2225
2245
|
"nep141:eth-0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf.omft.near",
|
|
2226
2246
|
// cbBTC (eth)
|
|
2227
2247
|
"nep141:base-0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf.omft.near",
|
|
@@ -2234,43 +2254,43 @@ const pr = ({ className: e }) => {
|
|
|
2234
2254
|
// NEAR (bsc)
|
|
2235
2255
|
"nep141:eth-0xe0f63a424a4439cbe457d80e4f4b51ad25b2c56c.omft.near"
|
|
2236
2256
|
// SPX (eth)
|
|
2237
|
-
],
|
|
2257
|
+
], Dr = () => {
|
|
2238
2258
|
const { tokens: e } = P();
|
|
2239
2259
|
return {
|
|
2240
|
-
uniqueIntentsTokens:
|
|
2260
|
+
uniqueIntentsTokens: v(() => {
|
|
2241
2261
|
const t = e.filter(
|
|
2242
|
-
(n) => n.isIntent && n.blockchain === "near" && !
|
|
2243
|
-
), r = t.map((n) => n.isIntent && n.symbol), s = e.filter((n) => n.isIntent && n.blockchain !== "near" && !r.includes(n.symbol) && !
|
|
2262
|
+
(n) => n.isIntent && n.blockchain === "near" && !et.includes(n.assetId)
|
|
2263
|
+
), r = t.map((n) => n.isIntent && n.symbol), s = e.filter((n) => n.isIntent && n.blockchain !== "near" && !r.includes(n.symbol) && !et.includes(n.assetId));
|
|
2244
2264
|
return [...t, ...s];
|
|
2245
2265
|
}, [e])
|
|
2246
2266
|
};
|
|
2247
|
-
},
|
|
2267
|
+
}, xr = ({
|
|
2248
2268
|
variant: e,
|
|
2249
2269
|
search: t,
|
|
2250
2270
|
selectedChain: r,
|
|
2251
2271
|
chainsFilter: s,
|
|
2252
2272
|
walletSupportedChains: n
|
|
2253
2273
|
}) => {
|
|
2254
|
-
|
|
2255
|
-
const { tokens: a } = P(e), { mergedBalance: l } =
|
|
2274
|
+
Ks(e);
|
|
2275
|
+
const { tokens: a } = P(e), { mergedBalance: l } = le(), { intentBalances: c } = ce(), { uniqueIntentsTokens: d } = Dr(), u = Ts(
|
|
2256
2276
|
l,
|
|
2257
2277
|
n,
|
|
2258
2278
|
t
|
|
2259
|
-
),
|
|
2260
|
-
|
|
2279
|
+
), i = a.filter(gs({ search: t })).filter(
|
|
2280
|
+
Is({
|
|
2261
2281
|
selectedChain: r,
|
|
2262
2282
|
chainsFilter: s,
|
|
2263
2283
|
walletSupportedChains: n,
|
|
2264
|
-
intentBalances:
|
|
2284
|
+
intentBalances: c,
|
|
2265
2285
|
uniqueIntentTokenIds: d.map((m) => m.assetId)
|
|
2266
2286
|
})
|
|
2267
2287
|
);
|
|
2268
2288
|
return {
|
|
2269
|
-
all:
|
|
2270
|
-
intents:
|
|
2271
|
-
wallet:
|
|
2289
|
+
all: i.sort(u),
|
|
2290
|
+
intents: i.filter(He({ isIntent: !0 })).sort(u),
|
|
2291
|
+
wallet: i.filter(He({ isIntent: !1 })).sort(u)
|
|
2272
2292
|
};
|
|
2273
|
-
},
|
|
2293
|
+
}, Or = (e, t) => e.length === 0 && t ? "EMPTY_SEARCH" : e.length === 0 && !t ? "NO_TOKENS" : "HAS_TOKENS", Fr = ({
|
|
2274
2294
|
variant: e,
|
|
2275
2295
|
search: t,
|
|
2276
2296
|
className: r,
|
|
@@ -2278,35 +2298,35 @@ const pr = ({ className: e }) => {
|
|
|
2278
2298
|
showBalances: n,
|
|
2279
2299
|
chainsFilter: a,
|
|
2280
2300
|
selectedChain: l,
|
|
2281
|
-
chainIsNotSupported:
|
|
2301
|
+
chainIsNotSupported: c,
|
|
2282
2302
|
onMsg: d
|
|
2283
2303
|
}) => {
|
|
2284
|
-
const { t: u } =
|
|
2304
|
+
const { t: u } = M(), { ctx: i } = _(), { walletSupportedChains: m, appName: h } = y(), { mergedBalance: g } = le(), f = xr({
|
|
2285
2305
|
variant: e,
|
|
2286
2306
|
search: t,
|
|
2287
2307
|
chainsFilter: a,
|
|
2288
2308
|
selectedChain: l,
|
|
2289
2309
|
walletSupportedChains: m
|
|
2290
|
-
}),
|
|
2310
|
+
}), w = i.walletAddress ? s : !1, S = Or(f.all, t), E = v(
|
|
2291
2311
|
() => [{ label: null, tokens: f.all }],
|
|
2292
2312
|
[f.all]
|
|
2293
|
-
), B =
|
|
2313
|
+
), B = v(
|
|
2294
2314
|
() => [
|
|
2295
|
-
{ label: `${
|
|
2315
|
+
{ label: `${h} account`, tokens: f.intents },
|
|
2296
2316
|
{
|
|
2297
|
-
label:
|
|
2317
|
+
label: c ? null : "Connected wallet",
|
|
2298
2318
|
tokens: f.wallet
|
|
2299
2319
|
}
|
|
2300
2320
|
],
|
|
2301
|
-
[f.wallet, f.intents,
|
|
2302
|
-
), F =
|
|
2303
|
-
(
|
|
2321
|
+
[f.wallet, f.intents, c]
|
|
2322
|
+
), F = v(() => (w ? B : E).reduce(
|
|
2323
|
+
(k, x) => k + x.tokens.length,
|
|
2304
2324
|
0
|
|
2305
|
-
), [B,
|
|
2325
|
+
), [B, E, w]), L = "450px";
|
|
2306
2326
|
switch (S) {
|
|
2307
2327
|
case "EMPTY_SEARCH":
|
|
2308
|
-
return /* @__PURE__ */
|
|
2309
|
-
|
|
2328
|
+
return /* @__PURE__ */ o(
|
|
2329
|
+
Se,
|
|
2310
2330
|
{
|
|
2311
2331
|
hasAction: !0,
|
|
2312
2332
|
actionType: "outlined",
|
|
@@ -2321,44 +2341,44 @@ const pr = ({ className: e }) => {
|
|
|
2321
2341
|
}
|
|
2322
2342
|
);
|
|
2323
2343
|
case "HAS_TOKENS":
|
|
2324
|
-
return /* @__PURE__ */
|
|
2325
|
-
|
|
2344
|
+
return /* @__PURE__ */ o("div", { className: H("gap-sw-lg flex flex-col", r), children: /* @__PURE__ */ o(
|
|
2345
|
+
ps,
|
|
2326
2346
|
{
|
|
2327
2347
|
className: "hide-scrollbar",
|
|
2328
2348
|
style: {
|
|
2329
2349
|
maxHeight: L,
|
|
2330
2350
|
minHeight: 200,
|
|
2331
|
-
height: F ? F *
|
|
2351
|
+
height: F ? F * Je + (w ? B.length * 62 : 0) : Je * 2
|
|
2332
2352
|
},
|
|
2333
|
-
children: (
|
|
2334
|
-
({ label:
|
|
2335
|
-
|
|
2336
|
-
/* @__PURE__ */
|
|
2337
|
-
/* @__PURE__ */
|
|
2353
|
+
children: (w ? B : E).map(
|
|
2354
|
+
({ label: k, tokens: x }) => /* @__PURE__ */ T(Wt, { children: [
|
|
2355
|
+
x.length && k ? /* @__PURE__ */ T("header", { className: "pb-sw-lg flex flex-col", children: [
|
|
2356
|
+
/* @__PURE__ */ o(hs, {}),
|
|
2357
|
+
/* @__PURE__ */ o("span", { className: "text-sw-label-sm pt-sw-xl text-sw-gray-100", children: `${k} — ${x.length}` })
|
|
2338
2358
|
] }) : null,
|
|
2339
|
-
|
|
2340
|
-
const J =
|
|
2341
|
-
return /* @__PURE__ */
|
|
2342
|
-
|
|
2359
|
+
x.map((X) => {
|
|
2360
|
+
const J = G(X);
|
|
2361
|
+
return /* @__PURE__ */ o(
|
|
2362
|
+
xt,
|
|
2343
2363
|
{
|
|
2344
|
-
token:
|
|
2364
|
+
token: X,
|
|
2345
2365
|
showBalance: n,
|
|
2346
|
-
balance:
|
|
2347
|
-
isNotSelectable:
|
|
2366
|
+
balance: g[J],
|
|
2367
|
+
isNotSelectable: c && !!i.walletAddress,
|
|
2348
2368
|
onMsg: d
|
|
2349
2369
|
},
|
|
2350
2370
|
J
|
|
2351
2371
|
);
|
|
2352
2372
|
}),
|
|
2353
|
-
|
|
2354
|
-
] },
|
|
2373
|
+
x.length ? /* @__PURE__ */ o("div", { className: "h-sw-2xl" }) : null
|
|
2374
|
+
] }, k ?? "ungrouped-tokens")
|
|
2355
2375
|
)
|
|
2356
2376
|
}
|
|
2357
2377
|
) });
|
|
2358
2378
|
case "NO_TOKENS":
|
|
2359
2379
|
default:
|
|
2360
|
-
return /* @__PURE__ */
|
|
2361
|
-
|
|
2380
|
+
return /* @__PURE__ */ o(
|
|
2381
|
+
Se,
|
|
2362
2382
|
{
|
|
2363
2383
|
className: "pt-sw-5xl pb-sw-5xl",
|
|
2364
2384
|
subHeading: u(
|
|
@@ -2367,86 +2387,288 @@ const pr = ({ className: e }) => {
|
|
|
2367
2387
|
),
|
|
2368
2388
|
heading: u("tokens.list.noBalanceOnApp.label", {
|
|
2369
2389
|
defaultValue: "You have no balances on {{appName}}",
|
|
2370
|
-
appName:
|
|
2390
|
+
appName: h
|
|
2371
2391
|
})
|
|
2372
2392
|
}
|
|
2373
2393
|
);
|
|
2374
2394
|
}
|
|
2375
|
-
},
|
|
2376
|
-
Placeholder:
|
|
2377
|
-
Item:
|
|
2378
|
-
}),
|
|
2395
|
+
}, Vi = Object.assign(Fr, {
|
|
2396
|
+
Placeholder: Se,
|
|
2397
|
+
Item: xt
|
|
2398
|
+
}), Lr = (e, t) => {
|
|
2379
2399
|
const r = t.assetId.substring(t.assetId.indexOf(":") + 1), s = (a) => {
|
|
2380
|
-
const l = (u) => u.replace(/(\.\d*?[1-9])0+$/, "$1").replace(/\.0+$/, ""),
|
|
2400
|
+
const l = (u) => u.replace(/(\.\d*?[1-9])0+$/, "$1").replace(/\.0+$/, ""), c = l(t.amount), d = l(
|
|
2381
2401
|
a.amount.toLocaleString("en-US", {
|
|
2382
2402
|
useGrouping: !1,
|
|
2383
2403
|
maximumFractionDigits: 20
|
|
2384
2404
|
})
|
|
2385
2405
|
);
|
|
2386
|
-
return
|
|
2406
|
+
return c.startsWith(d) || d.startsWith(c);
|
|
2387
2407
|
}, n = (a) => new Date(a.created_at) >= new Date(t.initiatedAtDate);
|
|
2388
2408
|
return (e.result.deposits || []).find(
|
|
2389
2409
|
(a) => a.chain === t.chainId && a.account_id === t.intentsAccountId && a.address === t.depositAddress && a.near_token_id === r && n(a) && s(a)
|
|
2390
2410
|
);
|
|
2391
|
-
},
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2411
|
+
}, Br = {
|
|
2412
|
+
CREDITED: ee.status.PROCESSING,
|
|
2413
|
+
PENDING: ee.status.PROCESSING,
|
|
2414
|
+
COMPLETED: ee.status.SUCCESS,
|
|
2415
|
+
FAILED: ee.status.FAILED
|
|
2416
|
+
}, Mi = ({ depositAddress: e }) => {
|
|
2417
|
+
const { ctx: t } = _(), { intentsAccountType: r } = y(), [s, n] = re(null), a = te({
|
|
2397
2418
|
addressType: r,
|
|
2398
2419
|
walletAddress: t.walletAddress
|
|
2399
2420
|
});
|
|
2400
2421
|
return { pollDepositStatus: async ({
|
|
2401
|
-
blockchain:
|
|
2422
|
+
blockchain: c,
|
|
2402
2423
|
amount: d,
|
|
2403
2424
|
assetId: u
|
|
2404
2425
|
}) => {
|
|
2405
2426
|
if (!a)
|
|
2406
2427
|
throw new W("Unknown intents account for POA deposit check");
|
|
2407
|
-
let
|
|
2408
|
-
if (!
|
|
2409
|
-
if (
|
|
2410
|
-
|
|
2428
|
+
let i = ct[c];
|
|
2429
|
+
if (!i)
|
|
2430
|
+
if (Q(c))
|
|
2431
|
+
i = lt;
|
|
2411
2432
|
else
|
|
2412
2433
|
throw new W(
|
|
2413
|
-
`Unknown chain for POA deposit check ${
|
|
2434
|
+
`Unknown chain for POA deposit check ${c}`
|
|
2414
2435
|
);
|
|
2415
2436
|
const m = s ?? (/* @__PURE__ */ new Date()).toUTCString();
|
|
2416
2437
|
s || n(m);
|
|
2417
|
-
const
|
|
2438
|
+
const h = await ft.post("", {
|
|
2418
2439
|
id: 1,
|
|
2419
2440
|
jsonrpc: "2.0",
|
|
2420
2441
|
method: "recent_deposits",
|
|
2421
2442
|
params: [
|
|
2422
2443
|
{
|
|
2423
2444
|
account_id: a,
|
|
2424
|
-
chain:
|
|
2445
|
+
chain: i
|
|
2425
2446
|
}
|
|
2426
2447
|
]
|
|
2427
|
-
}),
|
|
2448
|
+
}), g = Lr(h.data, {
|
|
2428
2449
|
intentsAccountId: a,
|
|
2429
2450
|
initiatedAtDate: m,
|
|
2430
2451
|
depositAddress: e,
|
|
2431
|
-
chainId:
|
|
2452
|
+
chainId: i,
|
|
2432
2453
|
assetId: u,
|
|
2433
2454
|
amount: d
|
|
2434
2455
|
});
|
|
2435
|
-
return
|
|
2436
|
-
status:
|
|
2456
|
+
return g ? {
|
|
2457
|
+
status: Br[g.status],
|
|
2437
2458
|
swapDetails: {
|
|
2438
2459
|
intentHashes: [""],
|
|
2439
|
-
destinationChainTxHashes: [{ hash:
|
|
2460
|
+
destinationChainTxHashes: [{ hash: g.tx_hash ?? "" }]
|
|
2440
2461
|
}
|
|
2441
2462
|
} : {
|
|
2442
|
-
status:
|
|
2463
|
+
status: ee.status.PENDING_DEPOSIT,
|
|
2443
2464
|
swapDetails: {
|
|
2444
2465
|
destinationChainTxHashes: [{ hash: "" }],
|
|
2445
2466
|
intentHashes: [""]
|
|
2446
2467
|
}
|
|
2447
2468
|
};
|
|
2448
2469
|
} };
|
|
2449
|
-
},
|
|
2470
|
+
}, qr = (e, t, r) => {
|
|
2471
|
+
if (At) {
|
|
2472
|
+
let s = document.body;
|
|
2473
|
+
r instanceof HTMLElement && (s = r), Object.entries(e).forEach(([n, a]) => {
|
|
2474
|
+
s.style.setProperty(`--c-sw-${t}-${n}`, a);
|
|
2475
|
+
});
|
|
2476
|
+
}
|
|
2477
|
+
}, tt = (e, t, r, s) => {
|
|
2478
|
+
const n = r ? ws(r, s ?? "dark") : null;
|
|
2479
|
+
n && qr(n, e, t);
|
|
2480
|
+
}, Ur = (e, t) => {
|
|
2481
|
+
const { primaryColor: r, surfaceColor: s, colorScheme: n } = t;
|
|
2482
|
+
tt("accent", e, r, n), tt("gray", e, s, n);
|
|
2483
|
+
}, Pr = at(void 0), Wr = ({ children: e, theme: t }) => {
|
|
2484
|
+
const { themeParentElementSelector: r } = y(), s = v(() => t, [t]);
|
|
2485
|
+
return C(() => {
|
|
2486
|
+
if (t && At) {
|
|
2487
|
+
const n = r ? document.querySelector(r) : null;
|
|
2488
|
+
Ur(n, t);
|
|
2489
|
+
}
|
|
2490
|
+
}, [t]), /* @__PURE__ */ o(Pr.Provider, { value: s, children: e });
|
|
2491
|
+
}, fe = ({
|
|
2492
|
+
text: e,
|
|
2493
|
+
icon: t
|
|
2494
|
+
}) => /* @__PURE__ */ T("li", { className: "flex items-center gap-sw-md", children: [
|
|
2495
|
+
t && /* @__PURE__ */ o(t, { size: 20, className: "text-sw-gray-300" }),
|
|
2496
|
+
/* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-50", children: e })
|
|
2497
|
+
] }), nt = ({
|
|
2498
|
+
label: e,
|
|
2499
|
+
icon: t,
|
|
2500
|
+
className: r
|
|
2501
|
+
}) => /* @__PURE__ */ T(
|
|
2502
|
+
"div",
|
|
2503
|
+
{
|
|
2504
|
+
className: H(
|
|
2505
|
+
"rounded-sw-lg flex align-center justify-center gap-sw-md w-full py-sw-2xl",
|
|
2506
|
+
r
|
|
2507
|
+
),
|
|
2508
|
+
children: [
|
|
2509
|
+
t && /* @__PURE__ */ o(t, { size: 16 }),
|
|
2510
|
+
/* @__PURE__ */ o("span", { className: "text-sw-label-md", children: e })
|
|
2511
|
+
]
|
|
2512
|
+
}
|
|
2513
|
+
), Vr = ({ isSigned: e, isSigning: t, onMsg: r }) => {
|
|
2514
|
+
const { t: s } = M(), n = bs({
|
|
2515
|
+
endTime: 0,
|
|
2516
|
+
autostart: !1,
|
|
2517
|
+
timerType: "DECREMENTAL",
|
|
2518
|
+
initialTime: 7,
|
|
2519
|
+
onTimeOver: () => {
|
|
2520
|
+
r({ type: "on_close" });
|
|
2521
|
+
}
|
|
2522
|
+
});
|
|
2523
|
+
return C(() => {
|
|
2524
|
+
e ? n.start() : n.reset();
|
|
2525
|
+
}, [e]), /* @__PURE__ */ T(ie, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
|
|
2526
|
+
/* @__PURE__ */ o(
|
|
2527
|
+
St,
|
|
2528
|
+
{
|
|
2529
|
+
onClick: () => r({ type: "on_close" }),
|
|
2530
|
+
className: "absolute top-sw-2xl right-sw-2xl"
|
|
2531
|
+
}
|
|
2532
|
+
),
|
|
2533
|
+
/* @__PURE__ */ o(ks, { size: 48, className: "text-sw-status-warning" }),
|
|
2534
|
+
/* @__PURE__ */ T("header", { className: "flex flex-col gap-sw-lg", children: [
|
|
2535
|
+
/* @__PURE__ */ o("h1", { className: "text-sw-label-lg text-sw-gray-50", children: s(
|
|
2536
|
+
"walletCompatibility.modal.title.initial",
|
|
2537
|
+
"Verify your wallet to continue"
|
|
2538
|
+
) }),
|
|
2539
|
+
/* @__PURE__ */ o("p", { className: "text-sw-body-md text-sw-gray-200", children: s(
|
|
2540
|
+
"walletCompatibility.modal.description.initial",
|
|
2541
|
+
"Please sign a message to verify your wallet. This confirms your wallet is compatible and lets us securely read your public key."
|
|
2542
|
+
) })
|
|
2543
|
+
] }),
|
|
2544
|
+
/* @__PURE__ */ T("ul", { className: "flex flex-col gap-sw-xl", children: [
|
|
2545
|
+
/* @__PURE__ */ o(
|
|
2546
|
+
fe,
|
|
2547
|
+
{
|
|
2548
|
+
text: s(
|
|
2549
|
+
"walletCompatibility.modal.feature.secureTransactions",
|
|
2550
|
+
"Read-only signature – no gas required."
|
|
2551
|
+
),
|
|
2552
|
+
icon: As
|
|
2553
|
+
}
|
|
2554
|
+
),
|
|
2555
|
+
/* @__PURE__ */ o(
|
|
2556
|
+
fe,
|
|
2557
|
+
{
|
|
2558
|
+
text: s(
|
|
2559
|
+
"walletCompatibility.modal.feature.fullAccess",
|
|
2560
|
+
"No access to your funds, no hidden permissions."
|
|
2561
|
+
),
|
|
2562
|
+
icon: Ss
|
|
2563
|
+
}
|
|
2564
|
+
),
|
|
2565
|
+
/* @__PURE__ */ o(
|
|
2566
|
+
fe,
|
|
2567
|
+
{
|
|
2568
|
+
text: s(
|
|
2569
|
+
"walletCompatibility.modal.feature.fundProtection",
|
|
2570
|
+
"Only checks whether your wallet is supported."
|
|
2571
|
+
),
|
|
2572
|
+
icon: Ns
|
|
2573
|
+
}
|
|
2574
|
+
)
|
|
2575
|
+
] }),
|
|
2576
|
+
e ? /* @__PURE__ */ T("div", { className: "flex flex-col gap-sw-xl mt-sw-lg w-full", children: [
|
|
2577
|
+
/* @__PURE__ */ o(
|
|
2578
|
+
nt,
|
|
2579
|
+
{
|
|
2580
|
+
label: s(
|
|
2581
|
+
"walletCompatibility.modal.button.verified",
|
|
2582
|
+
"Wallet verified"
|
|
2583
|
+
),
|
|
2584
|
+
className: "bg-sw-status-success text-sw-gray-950",
|
|
2585
|
+
icon: _s
|
|
2586
|
+
}
|
|
2587
|
+
),
|
|
2588
|
+
n.status === "RUNNING" && /* @__PURE__ */ o(
|
|
2589
|
+
nt,
|
|
2590
|
+
{
|
|
2591
|
+
className: "text-sw-gray-400",
|
|
2592
|
+
label: s("walletCompatibility.modal.button.closeTimer", {
|
|
2593
|
+
defaultValue: "Popup will close in {{count}} sec...",
|
|
2594
|
+
count: n.time
|
|
2595
|
+
})
|
|
2596
|
+
}
|
|
2597
|
+
)
|
|
2598
|
+
] }) : /* @__PURE__ */ T("div", { className: "flex flex-col gap-sw-xl mt-sw-lg", children: [
|
|
2599
|
+
/* @__PURE__ */ o(
|
|
2600
|
+
A,
|
|
2601
|
+
{
|
|
2602
|
+
size: "lg",
|
|
2603
|
+
variant: "primary",
|
|
2604
|
+
onClick: () => r({ type: "on_check_compatibility" }),
|
|
2605
|
+
children: s("walletCompatibility.modal.button.verify", "Verify wallet")
|
|
2606
|
+
}
|
|
2607
|
+
),
|
|
2608
|
+
/* @__PURE__ */ o(
|
|
2609
|
+
A,
|
|
2610
|
+
{
|
|
2611
|
+
size: "lg",
|
|
2612
|
+
variant: "outlined",
|
|
2613
|
+
state: t ? "loading" : "default",
|
|
2614
|
+
onClick: () => r({ type: "on_sign_out" }),
|
|
2615
|
+
children: t ? s(
|
|
2616
|
+
"walletCompatibility.modal.button.signing",
|
|
2617
|
+
"Sign with your wallet"
|
|
2618
|
+
) : s("walletCompatibility.modal.button.signOut", "Sign out")
|
|
2619
|
+
}
|
|
2620
|
+
)
|
|
2621
|
+
] })
|
|
2622
|
+
] });
|
|
2623
|
+
}, Mr = ({ onMsg: e }) => {
|
|
2624
|
+
const { t } = M();
|
|
2625
|
+
return /* @__PURE__ */ T(ie, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
|
|
2626
|
+
/* @__PURE__ */ o(
|
|
2627
|
+
St,
|
|
2628
|
+
{
|
|
2629
|
+
onClick: () => e({ type: "on_close" }),
|
|
2630
|
+
className: "absolute top-sw-2xl right-sw-2xl"
|
|
2631
|
+
}
|
|
2632
|
+
),
|
|
2633
|
+
/* @__PURE__ */ o(ys, { size: 48, className: "text-sw-status-error" }),
|
|
2634
|
+
/* @__PURE__ */ T("header", { className: "flex flex-col gap-sw-lg", children: [
|
|
2635
|
+
/* @__PURE__ */ o("h1", { className: "text-sw-label-lg text-sw-gray-50", children: t(
|
|
2636
|
+
"walletCompatibility.modal.title.error",
|
|
2637
|
+
"Unable to verify wallet"
|
|
2638
|
+
) }),
|
|
2639
|
+
/* @__PURE__ */ o("p", { className: "text-sw-body-md text-sw-gray-200", children: t(
|
|
2640
|
+
"walletCompatibility.modal.description.error",
|
|
2641
|
+
"We couldn’t complete the verification. It may have been interrupted or your wallet may not be compatible."
|
|
2642
|
+
) }),
|
|
2643
|
+
/* @__PURE__ */ o("p", { className: "text-sw-body-md text-sw-gray-200", children: t(
|
|
2644
|
+
"walletCompatibility.modal.button.tryAgainDesc",
|
|
2645
|
+
"If the issue continues, please try another wallet."
|
|
2646
|
+
) })
|
|
2647
|
+
] }),
|
|
2648
|
+
/* @__PURE__ */ T("div", { className: "flex flex-col gap-sw-xl mt-sw-lg", children: [
|
|
2649
|
+
/* @__PURE__ */ o(
|
|
2650
|
+
A,
|
|
2651
|
+
{
|
|
2652
|
+
size: "lg",
|
|
2653
|
+
variant: "primary",
|
|
2654
|
+
onClick: () => e({ type: "on_try_again" }),
|
|
2655
|
+
children: t("walletCompatibility.modal.button.tryAgain", "Try again")
|
|
2656
|
+
}
|
|
2657
|
+
),
|
|
2658
|
+
/* @__PURE__ */ o(
|
|
2659
|
+
A,
|
|
2660
|
+
{
|
|
2661
|
+
size: "lg",
|
|
2662
|
+
variant: "outlined",
|
|
2663
|
+
onClick: () => e({ type: "on_sign_out" }),
|
|
2664
|
+
children: t("walletCompatibility.modal.button.signOut", "Sign out")
|
|
2665
|
+
}
|
|
2666
|
+
)
|
|
2667
|
+
] })
|
|
2668
|
+
] });
|
|
2669
|
+
}, Qi = Object.assign(Vr, {
|
|
2670
|
+
Error: Mr
|
|
2671
|
+
}), Qr = (e) => null, $r = (e) => (t) => {
|
|
2450
2672
|
if (t instanceof W)
|
|
2451
2673
|
throw t;
|
|
2452
2674
|
const r = new W(
|
|
@@ -2454,49 +2676,49 @@ const pr = ({ className: e }) => {
|
|
|
2454
2676
|
{ cause: t }
|
|
2455
2677
|
);
|
|
2456
2678
|
throw r.context = e, r;
|
|
2457
|
-
},
|
|
2458
|
-
const { ctx: t } =
|
|
2459
|
-
return /* @__PURE__ */
|
|
2460
|
-
|
|
2679
|
+
}, Kr = ({ children: e }) => {
|
|
2680
|
+
const { ctx: t } = _();
|
|
2681
|
+
return /* @__PURE__ */ o(
|
|
2682
|
+
Rs,
|
|
2461
2683
|
{
|
|
2462
|
-
FallbackComponent:
|
|
2463
|
-
onError:
|
|
2684
|
+
FallbackComponent: Qr,
|
|
2685
|
+
onError: $r(t),
|
|
2464
2686
|
children: e
|
|
2465
2687
|
}
|
|
2466
2688
|
);
|
|
2467
|
-
},
|
|
2689
|
+
}, Hr = new $t({
|
|
2468
2690
|
defaultOptions: {
|
|
2469
2691
|
queries: {
|
|
2470
2692
|
staleTime: 2e3 * 60,
|
|
2471
|
-
retry:
|
|
2693
|
+
retry: st.env.NODE_ENV === "test" ? !1 : 3
|
|
2472
2694
|
}
|
|
2473
2695
|
}
|
|
2474
|
-
}),
|
|
2696
|
+
}), Gr = ["fms", "abg", "stjack", "noear", "testnebula"], ae = {
|
|
2475
2697
|
appName: "Unknown",
|
|
2476
2698
|
appIcon: "https://wtmcxrwapthiogjpxwfr.supabase.co/storage/v1/object/public/swap-widget/unknown.svg",
|
|
2477
2699
|
slippageTolerance: 100,
|
|
2478
2700
|
// 1%
|
|
2479
2701
|
intentsAccountType: "evm",
|
|
2480
|
-
walletSupportedChains:
|
|
2702
|
+
walletSupportedChains: tn,
|
|
2481
2703
|
connectedWallets: {},
|
|
2482
2704
|
enableAutoTokensSwitching: !0,
|
|
2483
2705
|
showIntentTokens: !0,
|
|
2484
|
-
chainsOrder:
|
|
2485
|
-
filterTokens: (e) => !
|
|
2706
|
+
chainsOrder: it,
|
|
2707
|
+
filterTokens: (e) => !Gr.includes(e.symbol.toLocaleLowerCase()),
|
|
2486
2708
|
chainsFilter: {
|
|
2487
2709
|
source: { external: "wallet-supported", intents: "none" },
|
|
2488
2710
|
target: { external: "all", intents: "none" }
|
|
2489
2711
|
}
|
|
2490
|
-
},
|
|
2712
|
+
}, Ot = at({
|
|
2491
2713
|
config: ae
|
|
2492
|
-
}),
|
|
2714
|
+
}), Ue = rt({
|
|
2493
2715
|
config: ae
|
|
2494
|
-
}),
|
|
2495
|
-
const e =
|
|
2716
|
+
}), y = () => {
|
|
2717
|
+
const e = Vt(Ot);
|
|
2496
2718
|
return oe(e).config;
|
|
2497
|
-
},
|
|
2498
|
-
|
|
2499
|
-
},
|
|
2719
|
+
}, jr = (e) => {
|
|
2720
|
+
Ue.config = pe(e);
|
|
2721
|
+
}, $i = ({
|
|
2500
2722
|
children: e,
|
|
2501
2723
|
config: t,
|
|
2502
2724
|
balanceViaRpc: r = !0,
|
|
@@ -2506,104 +2728,109 @@ const pr = ({ className: e }) => {
|
|
|
2506
2728
|
theme: a
|
|
2507
2729
|
}) => {
|
|
2508
2730
|
const l = Y(
|
|
2509
|
-
|
|
2510
|
-
config:
|
|
2731
|
+
rt({
|
|
2732
|
+
config: pe({
|
|
2511
2733
|
...ae,
|
|
2512
2734
|
...t
|
|
2513
2735
|
})
|
|
2514
2736
|
})
|
|
2515
2737
|
);
|
|
2516
|
-
return
|
|
2517
|
-
const
|
|
2738
|
+
return C(() => {
|
|
2739
|
+
const c = pe({
|
|
2518
2740
|
...ae,
|
|
2519
2741
|
...t
|
|
2520
2742
|
});
|
|
2521
|
-
Object.assign(l.current.config,
|
|
2522
|
-
}, [t]),
|
|
2523
|
-
/* @__PURE__ */
|
|
2524
|
-
/* @__PURE__ */
|
|
2525
|
-
/* @__PURE__ */
|
|
2526
|
-
/* @__PURE__ */
|
|
2743
|
+
Object.assign(l.current.config, c), jr(c);
|
|
2744
|
+
}, [t]), jt(s ?? {}), Cs("headlessui-portal-root", "sw"), /* @__PURE__ */ o(Kt, { client: Hr, children: /* @__PURE__ */ o(Gt, { i18n: Lt, children: /* @__PURE__ */ T(Ot.Provider, { value: l.current, children: [
|
|
2745
|
+
/* @__PURE__ */ T(Bt, { children: [
|
|
2746
|
+
/* @__PURE__ */ T(qt, { children: [
|
|
2747
|
+
/* @__PURE__ */ o("link", { rel: "preconnect", href: "https://rsms.me/" }),
|
|
2748
|
+
/* @__PURE__ */ o("link", { rel: "stylesheet", href: "https://rsms.me/inter/inter.css" })
|
|
2527
2749
|
] }),
|
|
2528
|
-
/* @__PURE__ */
|
|
2750
|
+
/* @__PURE__ */ o(Wr, { theme: a, children: st.env.NODE_ENV === "test" ? e : /* @__PURE__ */ o(Kr, { children: e }) })
|
|
2529
2751
|
] }),
|
|
2530
|
-
r && /* @__PURE__ */
|
|
2531
|
-
|
|
2752
|
+
r && /* @__PURE__ */ o(
|
|
2753
|
+
Qs,
|
|
2532
2754
|
{
|
|
2533
|
-
rpcs: n ??
|
|
2755
|
+
rpcs: n ?? Es,
|
|
2534
2756
|
connectedWallets: t.connectedWallets ?? {}
|
|
2535
2757
|
}
|
|
2536
2758
|
)
|
|
2537
2759
|
] }) }) });
|
|
2538
2760
|
};
|
|
2539
2761
|
export {
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2762
|
+
dr as $,
|
|
2763
|
+
Mi as A,
|
|
2764
|
+
Qs as B,
|
|
2765
|
+
Pr as C,
|
|
2766
|
+
Bs as D,
|
|
2767
|
+
Ge as E,
|
|
2768
|
+
Hs as F,
|
|
2769
|
+
Gs as G,
|
|
2770
|
+
js as H,
|
|
2771
|
+
zs as I,
|
|
2772
|
+
Xs as J,
|
|
2773
|
+
yt as K,
|
|
2774
|
+
bt as L,
|
|
2775
|
+
Rt as M,
|
|
2776
|
+
Et as N,
|
|
2777
|
+
Ct as O,
|
|
2778
|
+
Js as P,
|
|
2557
2779
|
q as Q,
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
ce as
|
|
2593
|
-
|
|
2594
|
-
|
|
2780
|
+
er as R,
|
|
2781
|
+
yr as S,
|
|
2782
|
+
vr as T,
|
|
2783
|
+
tr as U,
|
|
2784
|
+
nr as V,
|
|
2785
|
+
$i as W,
|
|
2786
|
+
sr as X,
|
|
2787
|
+
rr as Y,
|
|
2788
|
+
ar as Z,
|
|
2789
|
+
or as _,
|
|
2790
|
+
Ui as a,
|
|
2791
|
+
ur as a0,
|
|
2792
|
+
fr as a1,
|
|
2793
|
+
pr as a2,
|
|
2794
|
+
br as a3,
|
|
2795
|
+
Er as a4,
|
|
2796
|
+
Be as a5,
|
|
2797
|
+
qe as a6,
|
|
2798
|
+
Dt as a7,
|
|
2799
|
+
Cr as a8,
|
|
2800
|
+
Rr as a9,
|
|
2801
|
+
Je as aa,
|
|
2802
|
+
xt as ab,
|
|
2803
|
+
Dr as ac,
|
|
2804
|
+
Fr as ad,
|
|
2805
|
+
Wr as ae,
|
|
2806
|
+
Vr as af,
|
|
2807
|
+
Mr as ag,
|
|
2808
|
+
Kr as ah,
|
|
2809
|
+
Ue as ai,
|
|
2810
|
+
_ as b,
|
|
2811
|
+
Bi as c,
|
|
2812
|
+
Ks as d,
|
|
2813
|
+
Vs as e,
|
|
2814
|
+
ce as f,
|
|
2815
|
+
gr as g,
|
|
2816
|
+
Zs as h,
|
|
2817
|
+
Ir as i,
|
|
2818
|
+
mr as j,
|
|
2819
|
+
le as k,
|
|
2820
|
+
kr as l,
|
|
2821
|
+
xr as m,
|
|
2595
2822
|
P as n,
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2823
|
+
Pi as o,
|
|
2824
|
+
Wi as p,
|
|
2825
|
+
Vi as q,
|
|
2826
|
+
ir as r,
|
|
2827
|
+
vt as s,
|
|
2828
|
+
_t as t,
|
|
2829
|
+
j as u,
|
|
2603
2830
|
W as v,
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2831
|
+
I as w,
|
|
2832
|
+
qi as x,
|
|
2833
|
+
y,
|
|
2834
|
+
Qi as z
|
|
2608
2835
|
};
|
|
2609
|
-
//# sourceMappingURL=config-
|
|
2836
|
+
//# sourceMappingURL=config-Behl5hcc.js.map
|