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