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