@aurora-is-near/intents-swap-widget 2.16.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{config-DexsgtAV.js → config-DuYu3wzi.js} +909 -899
- package/dist/config-DuYu3wzi.js.map +1 -0
- package/dist/config.js +5 -4
- package/dist/config.js.map +1 -1
- package/dist/errors.js +1 -1
- package/dist/ext/alchemy/index.js +1 -1
- package/dist/ext/index.js +1 -1
- package/dist/features/BalanceRpcLoader/TokenBalanceLoader.js +1 -1
- package/dist/features/BalanceRpcLoader/index.js +1 -1
- package/dist/features/BalanceRpcLoader/useTokenBalanceRpc.js +1 -1
- package/dist/features/ChainsDropdown/index.js +1 -1
- package/dist/features/DepositMethodSwitcher.js +1 -1
- package/dist/features/ErrorBoundary.js +1 -1
- package/dist/features/ExternalDeposit.js +9 -8
- 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/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 +4 -3
- package/dist/features/TokensModal.js.map +1 -1
- 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/useChains.js +1 -1
- package/dist/hooks/useCompatibilityCheck.js +1 -1
- package/dist/hooks/useDefaultToken.js +1 -1
- package/dist/hooks/useExternalDepositStatus.js +1 -1
- package/dist/hooks/useIntentsBalance.js +1 -1
- package/dist/hooks/useMakeDepositAddress.js +1 -1
- package/dist/hooks/useMakeEvmTransfer.d.ts +13 -0
- package/dist/hooks/useMakeEvmTransfer.js +71 -0
- package/dist/hooks/useMakeEvmTransfer.js.map +1 -0
- package/dist/hooks/useMakeIntentsTransfer.js +1 -1
- package/dist/hooks/useMakeNEARFtTransferCall.js +1 -1
- package/dist/hooks/useMakeQuote.d.ts +18 -2
- package/dist/hooks/useMakeQuote.js +1 -1
- package/dist/hooks/useMakeQuoteTransfer.d.ts +1 -1
- package/dist/hooks/useMakeQuoteTransfer.js +5 -2
- package/dist/hooks/useMakeQuoteTransfer.js.map +1 -1
- package/dist/hooks/useMakeTransfer.js +1 -1
- package/dist/hooks/useMergedBalance.js +1 -1
- package/dist/hooks/useTokenInputPair.js +1 -1
- package/dist/hooks/useTokens.js +1 -1
- package/dist/hooks/useTokensFiltered.js +1 -1
- package/dist/hooks/useTokensIntentsUnique.js +1 -1
- package/dist/index.js +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/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/types/transfer.d.ts +1 -0
- package/dist/utils/evm/isEvmAddress.d.ts +1 -0
- package/dist/utils/evm/isEvmAddress.js +5 -0
- package/dist/utils/evm/isEvmAddress.js.map +1 -0
- package/dist/utils/intents/signers/near.js +1 -1
- package/dist/utils/intents/signers/privy.js +1 -1
- package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +8 -7
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js.map +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js +4 -3
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js.map +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +18 -17
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js.map +1 -1
- package/package.json +5 -3
- package/src/hooks/useMakeEvmTransfer.ts +115 -0
- package/src/hooks/useMakeQuote.ts +24 -17
- package/src/hooks/useMakeQuoteTransfer.ts +38 -15
- package/src/types/transfer.ts +1 -0
- package/src/utils/evm/isEvmAddress.ts +3 -0
- package/dist/config-DexsgtAV.js.map +0 -1
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { jsx as I, jsxs as C, Fragment as Oe } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import ur from "i18next";
|
|
3
3
|
import { deepClone as qe } from "valtio/utils";
|
|
4
|
-
import { useSnapshot as Se, snapshot as Qe, proxy as
|
|
5
|
-
import { useMemo as W, useEffect as $, useRef as me, memo as
|
|
6
|
-
import { useQuery as We, useInfiniteQuery as
|
|
7
|
-
import { Trans as
|
|
8
|
-
import { CHAINS_LIST as
|
|
9
|
-
import { ErrorBoundary as
|
|
10
|
-
import { derive as
|
|
4
|
+
import { useSnapshot as Se, snapshot as Qe, proxy as xt } from "valtio";
|
|
5
|
+
import { useMemo as W, useEffect as $, useRef as me, memo as lr, useId as dr, useState as fr, Fragment as pr, useContext as mr, createContext as hr } from "react";
|
|
6
|
+
import { useQuery as We, useInfiniteQuery as gr, useQueryClient as wr, QueryClient as Ir, QueryClientProvider as Tr } from "@tanstack/react-query";
|
|
7
|
+
import { Trans as yr, I18nextProvider as Ar } from "react-i18next";
|
|
8
|
+
import { CHAINS_LIST as Nt, DEFAULT_CHAIN_ICON as Er, DRY_QUOTE_ADDRESSES as ct, CHAIN_POA_MAP as kr, CHAIN_BASE_TOKENS as Sr, EVM_CHAIN_IDS_MAP as xr, CHAIN_IDS_MAP as Nr, EVM_CHAINS as _r } from "./constants/chains.js";
|
|
9
|
+
import { ErrorBoundary as br } from "react-error-boundary";
|
|
10
|
+
import { derive as Br } from "derive-valtio";
|
|
11
11
|
import { machine as he, moveTo as Y } from "./machine/machine.js";
|
|
12
12
|
import { guardStates as Z } from "./machine/guards/index.js";
|
|
13
|
-
import { getUsdTradeDelta as
|
|
14
|
-
import { getIsDirectTransfer as
|
|
15
|
-
import { getIsDirectNonNearWithdrawal as
|
|
16
|
-
import { getIsNearToIntentsSameAssetTransfer as
|
|
17
|
-
import { getIsDirectNearDeposit as
|
|
13
|
+
import { getUsdTradeDelta as Rr } from "./machine/computed/getUsdTradeDelta.js";
|
|
14
|
+
import { getIsDirectTransfer as Fr } from "./machine/computed/getIsDirectTransfer.js";
|
|
15
|
+
import { getIsDirectNonNearWithdrawal as Cr } from "./machine/computed/getIsDirectNonNearWithdrawal.js";
|
|
16
|
+
import { getIsNearToIntentsSameAssetTransfer as Ur } from "./machine/computed/getIsNearToIntentsSameAssetTransfer.js";
|
|
17
|
+
import { getIsDirectNearDeposit as Dr } from "./machine/computed/getIsDirectNearDeposit.js";
|
|
18
18
|
import "ethers";
|
|
19
|
-
import
|
|
19
|
+
import Lr from "lodash.once";
|
|
20
20
|
import { logger as P } from "./logger.js";
|
|
21
|
-
import { fireEvent as
|
|
22
|
-
import { validateDryInputs as
|
|
23
|
-
import { isQuoteIdle as
|
|
24
|
-
import { isInputChanged as
|
|
25
|
-
import { isErrorChanged as
|
|
26
|
-
import { isOnlyErrorChanged as
|
|
27
|
-
import { isValidInitialState as
|
|
28
|
-
import { isWalletDisconnected as
|
|
29
|
-
import { isSendAddressForbidden as
|
|
30
|
-
import { useAddClassToPortal as
|
|
31
|
-
import { useTypedTranslation as ge, initLocalisation as
|
|
32
|
-
import { OneClickService as
|
|
21
|
+
import { fireEvent as _ } from "./machine/events/utils/fireEvent.js";
|
|
22
|
+
import { validateDryInputs as _t, validateExternalInputs as bt, validateInternalInputs as Bt } from "./machine/events/validateInputs.js";
|
|
23
|
+
import { isQuoteIdle as Or } from "./machine/subscriptions/checkers/isQuoteIdle.js";
|
|
24
|
+
import { isInputChanged as qr } from "./machine/subscriptions/checkers/isInputChanged.js";
|
|
25
|
+
import { isErrorChanged as vr } from "./machine/subscriptions/checkers/isErrorChanged.js";
|
|
26
|
+
import { isOnlyErrorChanged as Pr } from "./machine/subscriptions/checkers/isOnlyErrorChanged.js";
|
|
27
|
+
import { isValidInitialState as Mr } from "./machine/subscriptions/checkers/isValidInitialState.js";
|
|
28
|
+
import { isWalletDisconnected as $r } from "./machine/subscriptions/checkers/isWalletDisconnected.js";
|
|
29
|
+
import { isSendAddressForbidden as Qr } from "./machine/subscriptions/checkers/isSendAddressForbidden.js";
|
|
30
|
+
import { useAddClassToPortal as Wr } from "./hooks/useAddClassToPortal.js";
|
|
31
|
+
import { useTypedTranslation as ge, initLocalisation as Vr } from "./localisation.js";
|
|
32
|
+
import { OneClickService as Gr, QuoteRequest as J } from "@defuse-protocol/one-click-sdk-typescript";
|
|
33
33
|
import { TOKENS_DATA as Ve, NATIVE_NEAR_DUMB_ASSET_ID as j, WNEAR_ASSET_ID as oe } from "./constants/tokens.js";
|
|
34
|
-
import { isValidChain as
|
|
34
|
+
import { isValidChain as Kr } from "./utils/checkers/isValidChain.js";
|
|
35
35
|
import { useWalletBalance as Ge } from "./hooks/useWalletBalance.js";
|
|
36
36
|
import { getTokenBalanceKey as ie } from "./utils/intents/getTokenBalanceKey.js";
|
|
37
|
-
import { isEth as
|
|
37
|
+
import { isEth as Rt } from "./utils/evm/isEth.js";
|
|
38
38
|
import { isEvmChain as Ee } from "./utils/evm/isEvmChain.js";
|
|
39
|
-
import { isEvmToken as
|
|
40
|
-
import { isEvmBaseToken as
|
|
41
|
-
import { getEvmMainTokenBalance as
|
|
42
|
-
import { getNativeNearBalance as
|
|
43
|
-
import { getNearTokenBalance as
|
|
44
|
-
import { getEvmTokenBalance as
|
|
39
|
+
import { isEvmToken as Hr } from "./utils/evm/isEvmToken.js";
|
|
40
|
+
import { isEvmBaseToken as jr } from "./utils/evm/isEvmBaseToken.js";
|
|
41
|
+
import { getEvmMainTokenBalance as zr } from "./utils/evm/getEvmMainTokenBalance.js";
|
|
42
|
+
import { getNativeNearBalance as Yr } from "./utils/near/getNativeNearBalance.js";
|
|
43
|
+
import { getNearTokenBalance as Jr } from "./utils/near/getNearTokenBalance.js";
|
|
44
|
+
import { getEvmTokenBalance as Zr } from "./utils/evm/getEvmTokenBalance.js";
|
|
45
45
|
import "@headlessui/react";
|
|
46
46
|
import "framer-motion";
|
|
47
47
|
import "lucide-react";
|
|
@@ -51,116 +51,119 @@ import { Button as G } from "./components/Button.js";
|
|
|
51
51
|
import { TinyNumber as He } from "./components/TinyNumber.js";
|
|
52
52
|
import { ErrorMessage as pe } from "./components/ErrorMessage.js";
|
|
53
53
|
import { INTENTS_CONTRACT as ve } from "./constants/intents.js";
|
|
54
|
-
import
|
|
54
|
+
import Xr, { CanceledError as Ft, AxiosError as Ct } from "axios";
|
|
55
55
|
import { isUserDeniedSigning as Pe } from "./utils/checkers/isUserDeniedSigning.js";
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
56
|
+
import { useMakeEvmTransfer as en } from "./hooks/useMakeEvmTransfer.js";
|
|
57
|
+
import { isEvmAddress as tn } from "./utils/evm/isEvmAddress.js";
|
|
58
|
+
import { createIntentSignerNEP413 as rn, BridgeSDK as nn, createNearWithdrawalRoute as on, createInternalTransferRoute as sn } from "@defuse-protocol/bridge-sdk";
|
|
59
|
+
import { snakeCase as Ut } from "change-case";
|
|
58
60
|
import { notReachable as je } from "./utils/notReachable.js";
|
|
59
61
|
import { localStorageTyped as ut } from "./utils/localstorage.js";
|
|
60
|
-
import { queryContract as
|
|
62
|
+
import { queryContract as an } from "./utils/near/queryContract.js";
|
|
61
63
|
import { utils as lt } from "@defuse-protocol/internal-utils";
|
|
62
64
|
import { getIntentsAccountId as xe } from "./utils/intents/getIntentsAccountId.js";
|
|
63
|
-
import { getTransactionLink as
|
|
64
|
-
import { generateRandomBytes as
|
|
65
|
-
import { IntentSignerSolana as
|
|
65
|
+
import { getTransactionLink as cn } from "./utils/formatters/getTransactionLink.js";
|
|
66
|
+
import { generateRandomBytes as un } from "./utils/near/getRandomBytes.js";
|
|
67
|
+
import { IntentSignerSolana as ln } from "./utils/intents/signers/solana.js";
|
|
66
68
|
import { FT_DEPOSIT_GAS as dt, FT_TRANSFER_GAS as ft } from "./utils/near/config.js";
|
|
67
69
|
import { z as ye } from "zod";
|
|
68
|
-
import { decodeQueryResult as
|
|
69
|
-
import { nearRpcClient as
|
|
70
|
-
import { getNearNep141MinStorageBalance as
|
|
71
|
-
import { isNotEmptyAmount as
|
|
70
|
+
import { decodeQueryResult as dn } from "./utils/near/decodeQueryResult.js";
|
|
71
|
+
import { nearRpcClient as fn } from "./utils/near/rpc.js";
|
|
72
|
+
import { getNearNep141MinStorageBalance as pn } from "./utils/near/getNearNep141MinStorageBalance.js";
|
|
73
|
+
import { isNotEmptyAmount as mn } from "./utils/checkers/isNotEmptyAmount.js";
|
|
72
74
|
import "copy-text-to-clipboard";
|
|
73
75
|
import { Notes as Fe } from "./components/Notes.js";
|
|
74
|
-
import { Accordion as
|
|
76
|
+
import { Accordion as hn } from "./components/Accordion.js";
|
|
75
77
|
import { formatUsdAmount as pt } from "./utils/formatters/formatUsdAmount.js";
|
|
76
|
-
import { formatTinyNumber as
|
|
77
|
-
import { SwapQuoteSkeleton as
|
|
78
|
-
import { noop as
|
|
79
|
-
import { Card as
|
|
78
|
+
import { formatTinyNumber as gn } from "./utils/formatters/formatTinyNumber.js";
|
|
79
|
+
import { SwapQuoteSkeleton as Dt } from "./features/SwapQuote/SwapQuoteSkeleton.js";
|
|
80
|
+
import { noop as wn } from "./utils/noop.js";
|
|
81
|
+
import { Card as In } from "./components/Card.js";
|
|
80
82
|
import { Badge as Ce } from "./components/Badge.js";
|
|
81
|
-
import { TokenIcon as
|
|
82
|
-
import { InputAmount as
|
|
83
|
-
import
|
|
84
|
-
import { Skeleton as
|
|
85
|
-
import { getBalancePortion as
|
|
86
|
-
import { getUsdDisplayAmount as
|
|
87
|
-
import { getPercentageDeltaColor as
|
|
83
|
+
import { TokenIcon as Lt } from "./components/TokenIcon.js";
|
|
84
|
+
import { InputAmount as Tn } from "./components/InputAmount.js";
|
|
85
|
+
import yn from "clsx";
|
|
86
|
+
import { Skeleton as An } from "./components/Skeleton.js";
|
|
87
|
+
import { getBalancePortion as En } from "./features/TokenInput/utils/getBalancePortion.js";
|
|
88
|
+
import { getUsdDisplayAmount as kn } from "./features/TokenInput/utils/getUsdDisplayAmount.js";
|
|
89
|
+
import { getPercentageDeltaColor as Sn } from "./features/TokenInput/utils/getPercentageDeltaColor.js";
|
|
88
90
|
import { TokenInputEmpty as ze } from "./features/TokenInput/TokenInputEmpty.js";
|
|
89
|
-
import { TokenInputSkeleton as
|
|
91
|
+
import { TokenInputSkeleton as xn } from "./features/TokenInput/TokenInputSkeleton.js";
|
|
90
92
|
import { formatBigToHuman as ue } from "./utils/formatters/formatBigToHuman.js";
|
|
91
|
-
import { getIntentsBalances as
|
|
92
|
-
import { getUsdDisplayBalance as
|
|
93
|
-
import { VList as
|
|
94
|
-
import { Hr as
|
|
95
|
-
import { Banner as
|
|
96
|
-
import { createTokenSorter as
|
|
93
|
+
import { getIntentsBalances as Nn } from "./utils/intents/getIntentsBalance.js";
|
|
94
|
+
import { getUsdDisplayBalance as _n } from "./utils/formatters/getUsdDisplayBalance.js";
|
|
95
|
+
import { VList as bn } from "virtua";
|
|
96
|
+
import { Hr as Bn } from "./components/Hr.js";
|
|
97
|
+
import { Banner as Rn } from "./components/Banner.js";
|
|
98
|
+
import { createTokenSorter as Fn } from "./utils/tokens/sort.js";
|
|
97
99
|
import { createFilterByIntents as mt } from "./utils/tokens/filterByIntents.js";
|
|
98
|
-
import { createFilterBySearch as
|
|
99
|
-
import { createFilterBySelectedChain as
|
|
100
|
-
import { TokensListPlaceholder as
|
|
100
|
+
import { createFilterBySearch as Cn } from "./utils/tokens/filterBySearchString.js";
|
|
101
|
+
import { createFilterBySelectedChain as Un } from "./utils/tokens/filterBySelectedChain.js";
|
|
102
|
+
import { TokensListPlaceholder as Ot } from "./features/TokensList/TokensListPlaceholder.js";
|
|
101
103
|
import "bs58";
|
|
102
|
-
import { oneClickApi as Me, bridgeApi as
|
|
104
|
+
import { oneClickApi as Me, bridgeApi as Dn } from "./network.js";
|
|
105
|
+
import "viem/chains";
|
|
103
106
|
import "qrcode.react";
|
|
104
|
-
import { DEFAULT_RPCS as
|
|
105
|
-
import { isAmountChangedFromQuote as
|
|
106
|
-
import { reset as
|
|
107
|
+
import { DEFAULT_RPCS as Ln } from "./rpcs.js";
|
|
108
|
+
import { isAmountChangedFromQuote as On } from "./machine/subscriptions/checkers/isAmountChangedFromQuote.js";
|
|
109
|
+
import { reset as qn } from "./machine/events/reset.js";
|
|
107
110
|
import { tokenSelectRotate as $e } from "./machine/events/tokenSelectRotate.js";
|
|
108
|
-
import { errorSet as
|
|
109
|
-
import { quoteSet as
|
|
110
|
-
import { addressSet as
|
|
111
|
-
import { tokenSetAmount as
|
|
112
|
-
import { quoteSetStatus as
|
|
113
|
-
import { depositTypeSet as
|
|
114
|
-
import { walletAddressSet as
|
|
115
|
-
import { tokenSetBalance as
|
|
116
|
-
import { transferSetStatus as
|
|
117
|
-
import { parse as
|
|
118
|
-
import { createLoader as
|
|
119
|
-
import { isAlchemySupportedChain as
|
|
120
|
-
import { getMainTokenByChain as
|
|
121
|
-
import { getDefaultIntentsToken as
|
|
122
|
-
import { getTokenWithHighBalance as
|
|
123
|
-
const se = he.getStore(),
|
|
124
|
-
usdTradeDelta: (n) =>
|
|
125
|
-
isDirectTransfer: (n) =>
|
|
126
|
-
isNearToIntentsSameAssetTransfer: (n) =>
|
|
127
|
-
isDirectNearDeposit: (n) =>
|
|
128
|
-
isDirectNonNearWithdrawal: (n) =>
|
|
129
|
-
}), we = () => Se(
|
|
111
|
+
import { errorSet as vn } from "./machine/events/errorSet.js";
|
|
112
|
+
import { quoteSet as Pn } from "./machine/events/quoteSet.js";
|
|
113
|
+
import { addressSet as Mn } from "./machine/events/addressSet.js";
|
|
114
|
+
import { tokenSetAmount as $n } from "./machine/events/tokenSetAmount.js";
|
|
115
|
+
import { quoteSetStatus as Qn } from "./machine/events/quoteSetStatus.js";
|
|
116
|
+
import { depositTypeSet as Wn } from "./machine/events/depositTypeSet.js";
|
|
117
|
+
import { walletAddressSet as Vn } from "./machine/events/walletAddressSet.js";
|
|
118
|
+
import { tokenSetBalance as Gn } from "./machine/events/tokenSetBalance.js";
|
|
119
|
+
import { transferSetStatus as Kn } from "./machine/events/transferSetStatus.js";
|
|
120
|
+
import { parse as Hn } from "./ext/alchemy/parse.js";
|
|
121
|
+
import { createLoader as jn } from "./ext/alchemy/load.js";
|
|
122
|
+
import { isAlchemySupportedChain as zn } from "./ext/alchemy/types.js";
|
|
123
|
+
import { getMainTokenByChain as Yn } from "./utils/tokens/getMainTokenByChain.js";
|
|
124
|
+
import { getDefaultIntentsToken as Jn } from "./utils/tokens/getDefaultIntentsToken.js";
|
|
125
|
+
import { getTokenWithHighBalance as Zn } from "./utils/tokens/getTokenWithHighBalance.js";
|
|
126
|
+
const se = he.getStore(), Xn = Br({
|
|
127
|
+
usdTradeDelta: (n) => Rr(n(se.context)),
|
|
128
|
+
isDirectTransfer: (n) => Fr(n(se.context)),
|
|
129
|
+
isNearToIntentsSameAssetTransfer: (n) => Ur(n(se.context)),
|
|
130
|
+
isDirectNearDeposit: (n) => Dr(n(se.context)),
|
|
131
|
+
isDirectNonNearWithdrawal: (n) => Cr(n(se.context))
|
|
132
|
+
}), we = () => Se(Xn), O = () => {
|
|
130
133
|
const n = Se(se);
|
|
131
134
|
return {
|
|
132
135
|
state: n.state,
|
|
133
136
|
ctx: n.context
|
|
134
137
|
};
|
|
135
|
-
},
|
|
138
|
+
}, Ia = (n) => {
|
|
136
139
|
const o = Se(se);
|
|
137
140
|
if (!Z(o.context, [n]))
|
|
138
141
|
throw new te(
|
|
139
142
|
`[WIDGET] Attempt to access snapshot for ${n} state while context does not match`
|
|
140
143
|
);
|
|
141
144
|
return o.context;
|
|
142
|
-
},
|
|
143
|
-
const o = !n.walletAddress, u = !o && n.targetToken?.isIntent === !0,
|
|
145
|
+
}, qt = (n) => {
|
|
146
|
+
const o = !n.walletAddress, u = !o && n.targetToken?.isIntent === !0, a = !o && n.targetToken?.isIntent === !1;
|
|
144
147
|
if (o) {
|
|
145
|
-
const l =
|
|
148
|
+
const l = _t(n);
|
|
146
149
|
return Y(l ? "input_valid_dry" : "initial_dry");
|
|
147
150
|
}
|
|
148
|
-
|
|
149
|
-
},
|
|
151
|
+
a && bt(n) ? Y("input_valid_external") : u && Bt(n) ? Y("input_valid_internal") : Y("initial_wallet");
|
|
152
|
+
}, eo = (n, o) => {
|
|
150
153
|
const { config: u } = Qe(Je);
|
|
151
|
-
return n.targetToken && !n.sendAddress && !!n.walletAddress && !n.targetToken.isIntent && !o.find((
|
|
152
|
-
},
|
|
154
|
+
return n.targetToken && !n.sendAddress && !!n.walletAddress && !n.targetToken.isIntent && !o.find((a) => a?.key === "sendAddress") && u.walletSupportedChains.includes(n.targetToken.blockchain);
|
|
155
|
+
}, to = ({ debug: n }) => {
|
|
153
156
|
he.onContextChange((o, u) => {
|
|
154
|
-
const
|
|
155
|
-
if (n && P.debug("[WIDGET] Context changed",
|
|
157
|
+
const a = u;
|
|
158
|
+
if (n && P.debug("[WIDGET] Context changed", a), n && o.error && vr(a) && P.debug(`[WIDGET] Error set to ${o.error.code}`), Pr(a) || On(o, a, n))
|
|
156
159
|
return;
|
|
157
|
-
if (
|
|
158
|
-
|
|
160
|
+
if ($r(o, a)) {
|
|
161
|
+
_("reset", null), Y("initial_dry");
|
|
159
162
|
return;
|
|
160
163
|
}
|
|
161
|
-
const { isChanged: l, isDry: f } =
|
|
164
|
+
const { isChanged: l, isDry: f } = qr(o, a);
|
|
162
165
|
if (l) {
|
|
163
|
-
if (
|
|
166
|
+
if (Mr(o)) {
|
|
164
167
|
const m = f ? "initial_dry" : "initial_wallet";
|
|
165
168
|
Y(m, {
|
|
166
169
|
onMoved: () => {
|
|
@@ -170,80 +173,80 @@ const se = he.getStore(), Yn = _r({
|
|
|
170
173
|
}
|
|
171
174
|
});
|
|
172
175
|
}
|
|
173
|
-
|
|
176
|
+
Or(o) || (o.quote = void 0, o.quoteStatus = "idle", o.transferStatus = { status: "idle" }), Qr(o) && (o.sendAddress = void 0), eo(o, a) && (o.sendAddress = o.walletAddress), qt(o);
|
|
174
177
|
}
|
|
175
178
|
});
|
|
176
|
-
},
|
|
179
|
+
}, ro = ({ debug: n }) => {
|
|
177
180
|
he.onTransition((o, u) => {
|
|
178
181
|
n && P.debug(`===> [WIDGET] State moved from ${o} to ${u}`);
|
|
179
182
|
});
|
|
180
|
-
},
|
|
181
|
-
const { variant: u, token:
|
|
183
|
+
}, no = (n, o) => {
|
|
184
|
+
const { variant: u, token: a } = o, { config: l } = Qe(Je);
|
|
182
185
|
switch (u) {
|
|
183
186
|
case "source":
|
|
184
|
-
if (
|
|
187
|
+
if (a && a.assetId === n.targetToken?.assetId && a.isIntent === n.targetToken.isIntent && l.enableAutoTokensSwitching) {
|
|
185
188
|
if (!n.sourceToken)
|
|
186
189
|
return;
|
|
187
190
|
$e(n);
|
|
188
191
|
return;
|
|
189
192
|
}
|
|
190
|
-
if (
|
|
193
|
+
if (a && !n.sourceToken && a.assetId === n.targetToken?.assetId && a.isIntent === n.targetToken.isIntent && l.enableAutoTokensSwitching)
|
|
191
194
|
return;
|
|
192
|
-
n.sourceToken =
|
|
195
|
+
n.sourceToken = a;
|
|
193
196
|
break;
|
|
194
197
|
case "target":
|
|
195
|
-
if (
|
|
198
|
+
if (a && a.assetId === n.sourceToken?.assetId && a.isIntent === n.sourceToken.isIntent && l.enableAutoTokensSwitching) {
|
|
196
199
|
if (!n.targetToken)
|
|
197
200
|
return;
|
|
198
201
|
$e(n);
|
|
199
202
|
return;
|
|
200
203
|
}
|
|
201
|
-
n.targetToken =
|
|
204
|
+
n.targetToken = a;
|
|
202
205
|
break;
|
|
203
206
|
default:
|
|
204
207
|
je(u, { throwError: !1 });
|
|
205
208
|
}
|
|
206
209
|
}, Q = (n, o) => {
|
|
207
|
-
he.on(n, (u,
|
|
208
|
-
},
|
|
209
|
-
Q("quoteSetStatus",
|
|
210
|
-
},
|
|
210
|
+
he.on(n, (u, a) => o(u, a));
|
|
211
|
+
}, oo = () => {
|
|
212
|
+
Q("quoteSetStatus", Qn), Q("walletAddressSet", Vn), Q("transferSetStatus", Kn), Q("tokenSelectRotate", $e), Q("tokenSetBalance", Gn), Q("tokenSetAmount", $n), Q("depositTypeSet", Wn), Q("tokenSelect", no), Q("addressSet", Mn), Q("errorSet", vn), Q("quoteSet", Pn), Q("reset", qn), Q("validateDryInputs", _t), Q("validateExternalInputs", bt), Q("validateInternalInputs", Bt);
|
|
213
|
+
}, so = (n) => {
|
|
211
214
|
const o = n.toLowerCase();
|
|
212
215
|
return Ve[o]?.icon ?? "";
|
|
213
|
-
}, ht = (n) =>
|
|
216
|
+
}, ht = (n) => Nt[n].icon ?? Er, io = (n) => `${n?.charAt(0).toUpperCase()}${n?.slice(1)}`, ao = (n) => Ve[n]?.name ?? n, re = (n) => {
|
|
214
217
|
const {
|
|
215
218
|
showIntentTokens: o,
|
|
216
219
|
allowedTokensList: u,
|
|
217
|
-
allowedSourceTokensList:
|
|
220
|
+
allowedSourceTokensList: a,
|
|
218
221
|
allowedTargetTokensList: l,
|
|
219
222
|
filterTokens: f,
|
|
220
223
|
fetchSourceTokens: m,
|
|
221
|
-
fetchTargetTokens:
|
|
224
|
+
fetchTargetTokens: i
|
|
222
225
|
} = M(), g = We({
|
|
223
226
|
queryKey: ["tokens", n].filter(Boolean),
|
|
224
|
-
queryFn: async () => n === "source" && m ? m() : n === "target" &&
|
|
225
|
-
}),
|
|
227
|
+
queryFn: async () => n === "source" && m ? m() : n === "target" && i ? i() : Gr.getTokens()
|
|
228
|
+
}), T = W(() => {
|
|
226
229
|
if (!g.data)
|
|
227
230
|
return [];
|
|
228
231
|
const w = g.data.map((h) => {
|
|
229
232
|
const A = h.blockchain.toLowerCase();
|
|
230
|
-
return !
|
|
233
|
+
return !Kr(A) || u && !u.includes(h.assetId) || n === "source" && a && !a.includes(h.assetId) || n === "target" && l && !l.includes(h.assetId) ? null : {
|
|
231
234
|
assetId: h.assetId,
|
|
232
235
|
symbol: h.symbol,
|
|
233
236
|
decimals: h.decimals,
|
|
234
237
|
price: h.price,
|
|
235
238
|
blockchain: A,
|
|
236
239
|
isIntent: !1,
|
|
237
|
-
icon:
|
|
238
|
-
name:
|
|
240
|
+
icon: so(h.symbol),
|
|
241
|
+
name: ao(h.symbol),
|
|
239
242
|
chainIcon: ht(A),
|
|
240
|
-
chainName:
|
|
243
|
+
chainName: io(h.blockchain),
|
|
241
244
|
contractAddress: h.contractAddress
|
|
242
245
|
};
|
|
243
|
-
}).filter((h) => !!h).filter(f ?? (() => !0)),
|
|
246
|
+
}).filter((h) => !!h).filter(f ?? (() => !0)), y = w.filter(
|
|
244
247
|
(h) => h.symbol.toLowerCase() !== "wnear"
|
|
245
248
|
), k = w.find((h) => h.symbol.toLowerCase() === "wnear");
|
|
246
|
-
return k &&
|
|
249
|
+
return k && y.push({
|
|
247
250
|
name: "NEAR",
|
|
248
251
|
symbol: "NEAR",
|
|
249
252
|
chainName: "Near",
|
|
@@ -256,73 +259,73 @@ const se = he.getStore(), Yn = _r({
|
|
|
256
259
|
isIntent: !1,
|
|
257
260
|
decimals: 24
|
|
258
261
|
}), o ? [
|
|
259
|
-
...
|
|
262
|
+
...y,
|
|
260
263
|
// add intents tokens to the full list
|
|
261
264
|
...w.map(
|
|
262
265
|
(h) => h.symbol.toLowerCase() === "wnear" ? { ...h, symbol: "NEAR", name: "NEAR", isIntent: !0 } : { ...h, isIntent: !0 }
|
|
263
266
|
)
|
|
264
|
-
] :
|
|
267
|
+
] : y;
|
|
265
268
|
}, [g.data, o, f]);
|
|
266
269
|
return {
|
|
267
270
|
...g,
|
|
268
|
-
tokens:
|
|
271
|
+
tokens: T
|
|
269
272
|
};
|
|
270
|
-
}, gt = 3,
|
|
273
|
+
}, gt = 3, vt = ({
|
|
271
274
|
walletAddress: n,
|
|
272
275
|
alchemyApiKey: o,
|
|
273
276
|
...u
|
|
274
277
|
}) => {
|
|
275
|
-
const { ctx:
|
|
278
|
+
const { ctx: a } = O(), { tokens: l } = re(), { walletSupportedChains: f } = M(), { setWalletBalance: m } = Ge(a.walletAddress), i = u.isEnabled && !!n && f.length > 0, g = gr({
|
|
276
279
|
initialPageParam: null,
|
|
277
|
-
enabled:
|
|
280
|
+
enabled: i && !!n && !!o,
|
|
278
281
|
queryKey: ["walletTokensBalance", n],
|
|
279
|
-
queryFn: async ({ pageParam: w }) =>
|
|
282
|
+
queryFn: async ({ pageParam: w }) => jn({ alchemyApiKey: o })({
|
|
280
283
|
pageParam: w ? `${w}` : null,
|
|
281
284
|
walletAddress: n,
|
|
282
285
|
walletSupportedChains: f
|
|
283
286
|
}),
|
|
284
|
-
getNextPageParam: (w,
|
|
285
|
-
if (w.pageKey && !(
|
|
287
|
+
getNextPageParam: (w, y) => {
|
|
288
|
+
if (w.pageKey && !(y.length >= gt))
|
|
286
289
|
return w.pageKey;
|
|
287
290
|
}
|
|
288
291
|
});
|
|
289
292
|
$(() => {
|
|
290
|
-
|
|
291
|
-
}, [
|
|
292
|
-
const
|
|
293
|
+
i && g.data && g.hasNextPage && g.data.pages.length < gt && !g.isFetchingNextPage && g.fetchNextPage();
|
|
294
|
+
}, [i, g]);
|
|
295
|
+
const T = W(() => {
|
|
293
296
|
if (!g.data?.pages)
|
|
294
297
|
return {};
|
|
295
|
-
const w =
|
|
298
|
+
const w = Hn(
|
|
296
299
|
l,
|
|
297
|
-
g.data.pages.flatMap((
|
|
300
|
+
g.data.pages.flatMap((y) => y.data)
|
|
298
301
|
);
|
|
299
|
-
return l.forEach((
|
|
300
|
-
|
|
302
|
+
return l.forEach((y) => {
|
|
303
|
+
zn(y.blockchain) && !(y.assetId in w) && (w[y.assetId] = "0");
|
|
301
304
|
}), w;
|
|
302
305
|
}, [g.data, l]);
|
|
303
306
|
return $(() => {
|
|
304
|
-
Z(
|
|
305
|
-
}, [
|
|
307
|
+
Z(a, ["initial_wallet"]) && (m(a.walletAddress, T), a.sourceToken && Object.keys(T).includes(a.sourceToken.assetId) && _("tokenSetBalance", T[a.sourceToken.assetId]));
|
|
308
|
+
}, [T]), {
|
|
306
309
|
status: g.status,
|
|
307
310
|
refetch: g.refetch,
|
|
308
|
-
balances:
|
|
311
|
+
balances: T
|
|
309
312
|
};
|
|
310
313
|
}, Ne = () => {
|
|
311
|
-
const { walletAddress: n, intentsAccountType: o } = M(), { tokens: u } = re(),
|
|
314
|
+
const { walletAddress: n, intentsAccountType: o } = M(), { tokens: u } = re(), a = u.filter((i) => i.isIntent).map((i) => i.assetId), l = xe({
|
|
312
315
|
walletAddress: n ?? "",
|
|
313
316
|
addressType: o
|
|
314
317
|
}), f = We({
|
|
315
318
|
enabled: !!n && !!l && u.length > 0,
|
|
316
319
|
queryKey: ["intentsBalances", l],
|
|
317
|
-
queryFn: async () => l ? await
|
|
320
|
+
queryFn: async () => l ? await Nn(l, a) : {}
|
|
318
321
|
}), m = W(() => {
|
|
319
322
|
switch (f.status) {
|
|
320
323
|
case "error":
|
|
321
324
|
return P.error("Unable to load intents balances:", f.error), {};
|
|
322
325
|
case "success":
|
|
323
326
|
return Object.fromEntries(
|
|
324
|
-
Object.entries(f.data).map(([
|
|
325
|
-
`intent-${
|
|
327
|
+
Object.entries(f.data).map(([i, g]) => [
|
|
328
|
+
`intent-${i}`,
|
|
326
329
|
g
|
|
327
330
|
])
|
|
328
331
|
);
|
|
@@ -336,20 +339,20 @@ const se = he.getStore(), Yn = _r({
|
|
|
336
339
|
...f,
|
|
337
340
|
intentBalances: m
|
|
338
341
|
};
|
|
339
|
-
},
|
|
342
|
+
}, co = ({
|
|
340
343
|
isEnabled: n,
|
|
341
344
|
alchemyApiKey: o
|
|
342
345
|
}) => {
|
|
343
|
-
const { ctx: u } =
|
|
346
|
+
const { ctx: u } = O(), a = wr(), { refetch: l } = Ne(), { refetch: f } = vt({
|
|
344
347
|
isEnabled: n,
|
|
345
348
|
walletAddress: u.walletAddress,
|
|
346
349
|
alchemyApiKey: o ?? ""
|
|
347
350
|
});
|
|
348
351
|
$(() => {
|
|
349
352
|
const m = Z(u, ["transfer_success"]);
|
|
350
|
-
!n || !m || (async () => (await l(), o && (await new Promise((
|
|
351
|
-
setTimeout(
|
|
352
|
-
}), await f()), await
|
|
353
|
+
!n || !m || (async () => (await l(), o && (await new Promise((i) => {
|
|
354
|
+
setTimeout(i, 1e4);
|
|
355
|
+
}), await f()), await a.invalidateQueries({ queryKey: ["tokenBalance"] })))();
|
|
353
356
|
}, [u.state, n, o]);
|
|
354
357
|
}, _e = () => {
|
|
355
358
|
const { walletAddress: n } = M(), { intentBalances: o } = Ne(), { walletBalance: u } = Ge(n);
|
|
@@ -357,17 +360,17 @@ const se = he.getStore(), Yn = _r({
|
|
|
357
360
|
() => ({ ...u, ...o }),
|
|
358
361
|
[u, o]
|
|
359
362
|
) };
|
|
360
|
-
},
|
|
361
|
-
const { ctx: o } =
|
|
363
|
+
}, uo = ({ isEnabled: n }) => {
|
|
364
|
+
const { ctx: o } = O(), { mergedBalance: u } = _e();
|
|
362
365
|
$(() => {
|
|
363
366
|
if (!n)
|
|
364
367
|
return;
|
|
365
368
|
if (!o.sourceToken || !o.walletAddress) {
|
|
366
|
-
|
|
369
|
+
_("tokenSetBalance", void 0);
|
|
367
370
|
return;
|
|
368
371
|
}
|
|
369
|
-
const
|
|
370
|
-
|
|
372
|
+
const a = ie(o.sourceToken);
|
|
373
|
+
_("tokenSetBalance", u[a]);
|
|
371
374
|
}, [u, o.sourceToken]);
|
|
372
375
|
}, wt = {
|
|
373
376
|
// cbBTC (eth)
|
|
@@ -384,57 +387,63 @@ const se = he.getStore(), Yn = _r({
|
|
|
384
387
|
"nep245:v2_1.omni.hot.tg:56_SZzgw3HSudhZcTwPWUTi2RJB19t": "nep141:wrap.near",
|
|
385
388
|
// BTC (near)
|
|
386
389
|
"nep141:btc.omft.near": "nep141:nbtc.bridge.near"
|
|
387
|
-
},
|
|
390
|
+
}, lo = ({
|
|
388
391
|
isEnabled: n
|
|
389
392
|
}) => {
|
|
390
|
-
const { ctx: o } =
|
|
393
|
+
const { ctx: o } = O(), { tokens: u } = re();
|
|
391
394
|
$(() => {
|
|
392
395
|
if (!n)
|
|
393
396
|
return;
|
|
394
397
|
if (!o.sourceToken) {
|
|
395
|
-
|
|
398
|
+
_("tokenSelect", { variant: "target", token: void 0 });
|
|
396
399
|
return;
|
|
397
400
|
}
|
|
398
|
-
const { sourceToken:
|
|
401
|
+
const { sourceToken: a } = o;
|
|
399
402
|
if (o.sourceToken.assetId in wt) {
|
|
400
|
-
const
|
|
401
|
-
(g) => g.isIntent && g.assetId === wt[
|
|
403
|
+
const i = u.find(
|
|
404
|
+
(g) => g.isIntent && g.assetId === wt[a.assetId]
|
|
402
405
|
);
|
|
403
|
-
|
|
406
|
+
_("tokenSelect", {
|
|
404
407
|
variant: "target",
|
|
405
|
-
token:
|
|
408
|
+
token: i
|
|
406
409
|
});
|
|
407
410
|
return;
|
|
408
411
|
}
|
|
409
412
|
const l = u.find(
|
|
410
|
-
(
|
|
413
|
+
(i) => i.isIntent && i.symbol === a.symbol && i.blockchain === "near"
|
|
411
414
|
);
|
|
412
415
|
if (l) {
|
|
413
|
-
|
|
416
|
+
_("tokenSelect", { variant: "target", token: l });
|
|
414
417
|
return;
|
|
415
418
|
}
|
|
416
419
|
const f = u.find(
|
|
417
|
-
(
|
|
420
|
+
(i) => i.isIntent && i.assetId === a.assetId
|
|
418
421
|
), m = u.find(
|
|
419
|
-
(
|
|
422
|
+
(i) => i.isIntent && i.symbol === "USDC" && i.blockchain === "near"
|
|
420
423
|
);
|
|
421
|
-
|
|
424
|
+
_("tokenSelect", {
|
|
422
425
|
variant: "target",
|
|
423
426
|
token: f ?? m
|
|
424
427
|
});
|
|
425
428
|
}, [u, o.sourceToken]);
|
|
426
|
-
},
|
|
427
|
-
const { walletAddress: o } = M(), { ctx: u, state:
|
|
429
|
+
}, fo = ({ isEnabled: n }) => {
|
|
430
|
+
const { walletAddress: o } = M(), { ctx: u, state: a } = O();
|
|
428
431
|
$(() => {
|
|
429
432
|
if (!n)
|
|
430
433
|
return;
|
|
431
|
-
|
|
432
|
-
}, [n, o, u,
|
|
433
|
-
},
|
|
434
|
-
|
|
434
|
+
_("walletAddressSet", o ?? void 0), Z(u, ["initial_dry", "initial_wallet"]) && (a === "initial_wallet" && !o ? Y("initial_dry") : a === "initial_dry" && o && Y("initial_wallet"));
|
|
435
|
+
}, [n, o, u, a]);
|
|
436
|
+
}, It = (n, o) => {
|
|
437
|
+
if (!(o in n))
|
|
438
|
+
throw P.error(`Missing ${o} in quote response`), new H({
|
|
439
|
+
code: "QUOTE_INVALID",
|
|
440
|
+
meta: { isDry: !1 }
|
|
441
|
+
});
|
|
442
|
+
}, po = () => {
|
|
443
|
+
const { ctx: n } = O(), { intentsAccountType: o, oneClickApiQuoteProxyUrl: u, appName: a, fetchQuote: l } = M(), f = !n.walletAddress, m = xe({
|
|
435
444
|
addressType: o,
|
|
436
445
|
walletAddress: f ? ct[o] : n.walletAddress ?? ""
|
|
437
|
-
}),
|
|
446
|
+
}), i = me(null), g = me(new AbortController()), T = W(() => async (k) => l ? l(k) : (await Me.post(
|
|
438
447
|
u,
|
|
439
448
|
k,
|
|
440
449
|
{
|
|
@@ -461,7 +470,7 @@ const se = he.getStore(), Yn = _r({
|
|
|
461
470
|
meta: { isDry: f, message: x }
|
|
462
471
|
});
|
|
463
472
|
}
|
|
464
|
-
|
|
473
|
+
i.current && (g.current.abort("Abort previous quote (auto)"), g.current = new AbortController());
|
|
465
474
|
let E;
|
|
466
475
|
const S = {
|
|
467
476
|
// Settings
|
|
@@ -477,9 +486,9 @@ const se = he.getStore(), Yn = _r({
|
|
|
477
486
|
originAsset: n.sourceToken.assetId === j ? oe : n.sourceToken.assetId,
|
|
478
487
|
amount: h === "exact_out" ? n.targetTokenAmount : n.sourceTokenAmount
|
|
479
488
|
};
|
|
480
|
-
k && (S.customRecipientMsg = k),
|
|
489
|
+
k && (S.customRecipientMsg = k), a && (S.referral = Ut(a));
|
|
481
490
|
try {
|
|
482
|
-
n.sourceToken.isIntent && n.targetToken.isIntent && (
|
|
491
|
+
n.sourceToken.isIntent && n.targetToken.isIntent && (i.current = T({
|
|
483
492
|
...S,
|
|
484
493
|
recipient: m,
|
|
485
494
|
recipientType: J.recipientType.INTENTS,
|
|
@@ -487,7 +496,7 @@ const se = he.getStore(), Yn = _r({
|
|
|
487
496
|
// Refund
|
|
488
497
|
refundTo: m,
|
|
489
498
|
refundType: J.refundType.INTENTS
|
|
490
|
-
}), E = await
|
|
499
|
+
}), E = await i.current), i.current = T({
|
|
491
500
|
...S,
|
|
492
501
|
recipient: !n.targetToken.isIntent && n.sendAddress ? n.sendAddress : m,
|
|
493
502
|
recipientType: n.targetToken.isIntent ? J.recipientType.INTENTS : J.recipientType.DESTINATION_CHAIN,
|
|
@@ -495,24 +504,24 @@ const se = he.getStore(), Yn = _r({
|
|
|
495
504
|
// Refund
|
|
496
505
|
refundTo: n.sourceToken.isIntent ? m : w,
|
|
497
506
|
refundType: n.sourceToken.isIntent ? J.refundType.INTENTS : J.refundType.ORIGIN_CHAIN
|
|
498
|
-
}), E = await
|
|
507
|
+
}), E = await i.current;
|
|
499
508
|
} catch (x) {
|
|
500
|
-
if (x instanceof
|
|
509
|
+
if (x instanceof Ft)
|
|
501
510
|
return;
|
|
502
|
-
if (x instanceof
|
|
503
|
-
const
|
|
504
|
-
if (
|
|
505
|
-
const
|
|
511
|
+
if (x instanceof Ct) {
|
|
512
|
+
const B = x.response?.data.message || x.message;
|
|
513
|
+
if (B.includes("Amount is too low")) {
|
|
514
|
+
const q = B.match(/\d+/), z = q ? q[0] : void 0;
|
|
506
515
|
throw new H({
|
|
507
516
|
code: "QUOTE_AMOUNT_IS_TOO_LOW",
|
|
508
517
|
meta: {
|
|
509
|
-
minAmount: (
|
|
518
|
+
minAmount: (z && ue(z, n.sourceToken.decimals)) ?? "0"
|
|
510
519
|
}
|
|
511
520
|
});
|
|
512
521
|
}
|
|
513
|
-
throw
|
|
522
|
+
throw B.includes("recipient is not valid") ? new H({
|
|
514
523
|
code: "TOKEN_IS_NOT_SUPPORTED"
|
|
515
|
-
}) :
|
|
524
|
+
}) : B.includes("Failed to get a deposit address") ? new H({
|
|
516
525
|
code: "QUOTE_NO_ONE_TIME_ADDRESS"
|
|
517
526
|
}) : x;
|
|
518
527
|
}
|
|
@@ -524,37 +533,27 @@ const se = he.getStore(), Yn = _r({
|
|
|
524
533
|
}
|
|
525
534
|
});
|
|
526
535
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
...E,
|
|
539
|
-
deadline: E.deadline,
|
|
540
|
-
depositAddress: E.depositAddress
|
|
541
|
-
};
|
|
542
|
-
else
|
|
543
|
-
throw new H({
|
|
544
|
-
code: "QUOTE_INVALID",
|
|
545
|
-
meta: { isDry: f }
|
|
546
|
-
});
|
|
547
|
-
return _;
|
|
536
|
+
return f ? {
|
|
537
|
+
dry: !0,
|
|
538
|
+
...E,
|
|
539
|
+
deadline: void 0,
|
|
540
|
+
depositAddress: void 0
|
|
541
|
+
} : (It(E, "deadline"), It(E, "depositAddress"), {
|
|
542
|
+
dry: !1,
|
|
543
|
+
...E,
|
|
544
|
+
deadline: E.deadline,
|
|
545
|
+
depositAddress: E.depositAddress
|
|
546
|
+
});
|
|
548
547
|
},
|
|
549
548
|
cancel: () => {
|
|
550
549
|
g.current.abort("Abort quote manually"), g.current = new AbortController();
|
|
551
550
|
}
|
|
552
551
|
};
|
|
553
|
-
},
|
|
554
|
-
const { ctx: n } =
|
|
552
|
+
}, mo = () => {
|
|
553
|
+
const { ctx: n } = O(), { intentsAccountType: o, oneClickApiQuoteProxyUrl: u } = M(), a = xe({
|
|
555
554
|
addressType: o,
|
|
556
555
|
walletAddress: n.walletAddress ?? ""
|
|
557
|
-
}), l = me(null), f = me(new AbortController()), m = W(() => async (g) =>
|
|
556
|
+
}), l = me(null), f = me(new AbortController()), m = W(() => async (g) => Dn.post(
|
|
558
557
|
"",
|
|
559
558
|
{
|
|
560
559
|
id: 1,
|
|
@@ -600,7 +599,7 @@ const se = he.getStore(), Yn = _r({
|
|
|
600
599
|
message: "For withdrawals use withdrawal SDK instead of POA"
|
|
601
600
|
}
|
|
602
601
|
});
|
|
603
|
-
if (!
|
|
602
|
+
if (!a) {
|
|
604
603
|
const w = "No corresponding intents account to run a quote";
|
|
605
604
|
throw P.error(`[WIDGET] ${w}`), new H({
|
|
606
605
|
code: "QUOTE_INVALID_INITIAL",
|
|
@@ -608,16 +607,16 @@ const se = he.getStore(), Yn = _r({
|
|
|
608
607
|
});
|
|
609
608
|
}
|
|
610
609
|
l.current && (f.current.abort("Abort previous quote (auto)"), f.current = new AbortController());
|
|
611
|
-
const
|
|
612
|
-
if (!
|
|
610
|
+
const T = kr[n.targetToken.blockchain];
|
|
611
|
+
if (!T)
|
|
613
612
|
throw new H({
|
|
614
613
|
code: "QUOTE_INVALID_INITIAL",
|
|
615
614
|
meta: { isDry: !1, message: "Chain is not supported by POA" }
|
|
616
615
|
});
|
|
617
616
|
try {
|
|
618
617
|
return l.current = m({
|
|
619
|
-
chain:
|
|
620
|
-
accountId:
|
|
618
|
+
chain: T,
|
|
619
|
+
accountId: a
|
|
621
620
|
}), {
|
|
622
621
|
depositAddress: (await l.current).data.result.address,
|
|
623
622
|
amountIn: n.sourceTokenAmount,
|
|
@@ -638,14 +637,14 @@ const se = he.getStore(), Yn = _r({
|
|
|
638
637
|
dry: !1
|
|
639
638
|
};
|
|
640
639
|
} catch (w) {
|
|
641
|
-
if (w instanceof
|
|
640
|
+
if (w instanceof Ft)
|
|
642
641
|
return;
|
|
643
|
-
if (P.error(w), w instanceof
|
|
644
|
-
const
|
|
642
|
+
if (P.error(w), w instanceof Ct) {
|
|
643
|
+
const y = w.response?.data.message || w.message;
|
|
645
644
|
throw new H({
|
|
646
645
|
code: "QUOTE_FAILED",
|
|
647
646
|
meta: {
|
|
648
|
-
message:
|
|
647
|
+
message: y ?? "Failed to fetch quote. Please try again."
|
|
649
648
|
}
|
|
650
649
|
});
|
|
651
650
|
}
|
|
@@ -655,114 +654,114 @@ const se = he.getStore(), Yn = _r({
|
|
|
655
654
|
f.current.abort("Abort quote manually"), f.current = new AbortController();
|
|
656
655
|
}
|
|
657
656
|
};
|
|
658
|
-
},
|
|
657
|
+
}, ho = ({
|
|
659
658
|
isEnabled: n,
|
|
660
659
|
message: o,
|
|
661
660
|
type: u = "exact_in"
|
|
662
661
|
}) => {
|
|
663
|
-
const { ctx:
|
|
662
|
+
const { ctx: a } = O(), {
|
|
664
663
|
isDirectTransfer: l,
|
|
665
664
|
isDirectNonNearWithdrawal: f,
|
|
666
665
|
isNearToIntentsSameAssetTransfer: m,
|
|
667
|
-
isDirectNearDeposit:
|
|
668
|
-
} = we(), g = !
|
|
669
|
-
|
|
666
|
+
isDirectNearDeposit: i
|
|
667
|
+
} = we(), g = !a.walletAddress, T = n && !l && !f && !m && !i, { make: w, cancel: y } = po(), { make: k, cancel: h } = mo(), A = () => {
|
|
668
|
+
y(), h();
|
|
670
669
|
};
|
|
671
670
|
$(() => {
|
|
672
|
-
const E = Z(
|
|
673
|
-
(g && !E || !g &&
|
|
674
|
-
}, [A, g,
|
|
675
|
-
if (!
|
|
671
|
+
const E = Z(a, ["input_valid_dry"]), S = Z(a, ["input_valid_external"]), x = Z(a, ["input_valid_internal"]);
|
|
672
|
+
(g && !E || !g && a.targetToken?.isIntent && !x || !g && !a.targetToken?.isIntent && !S) && A();
|
|
673
|
+
}, [A, g, a]), $(() => {
|
|
674
|
+
if (!T || a.sourceToken?.assetId === j && a.targetToken?.assetId === oe)
|
|
676
675
|
return;
|
|
677
|
-
const E = g ?
|
|
676
|
+
const E = g ? a.state === "input_valid_dry" : a.state === "input_valid_external" && !a.targetToken?.isIntent || a.state === "input_valid_internal" && a.targetToken?.isIntent;
|
|
678
677
|
(async () => {
|
|
679
678
|
try {
|
|
680
|
-
if (E &&
|
|
681
|
-
|
|
679
|
+
if (E && a.quoteStatus === "idle") {
|
|
680
|
+
_("quoteSetStatus", "pending");
|
|
682
681
|
let S;
|
|
683
|
-
if (
|
|
682
|
+
if (a.sourceToken?.assetId === a.targetToken?.assetId ? S = await k() : S = await w({ message: o, quoteType: u }), !S)
|
|
684
683
|
return;
|
|
685
|
-
if (
|
|
684
|
+
if (_("quoteSetStatus", "success"), _("quoteSet", S), _("errorSet", null), _("tokenSetAmount", {
|
|
686
685
|
variant: "target",
|
|
687
686
|
amount: S.amountOut
|
|
688
|
-
}),
|
|
687
|
+
}), a.state === "input_valid_dry") {
|
|
689
688
|
Y("quote_success_dry");
|
|
690
689
|
return;
|
|
691
690
|
}
|
|
692
|
-
|
|
691
|
+
a.targetToken?.isIntent ? Y("quote_success_internal") : Y("quote_success_external");
|
|
693
692
|
}
|
|
694
693
|
} catch (S) {
|
|
695
694
|
if (S instanceof H) {
|
|
696
695
|
if (S.data.code === "QUOTE_INVALID_INITIAL") {
|
|
697
|
-
|
|
696
|
+
_("quoteSetStatus", "idle"), _("quoteSet", void 0), _("errorSet", null);
|
|
698
697
|
return;
|
|
699
698
|
}
|
|
700
|
-
|
|
699
|
+
_("quoteSetStatus", "error"), _("quoteSet", void 0), _("errorSet", S.data), qt(a);
|
|
701
700
|
return;
|
|
702
701
|
}
|
|
703
|
-
|
|
702
|
+
_("quoteSetStatus", "error"), _("quoteSet", void 0), _("errorSet", {
|
|
704
703
|
code: "QUOTE_FAILED",
|
|
705
704
|
meta: { message: "Unknown error" }
|
|
706
705
|
});
|
|
707
706
|
}
|
|
708
707
|
})();
|
|
709
|
-
}, [
|
|
708
|
+
}, [a, T, g, w]);
|
|
710
709
|
}, Ue = {
|
|
711
710
|
sol: "sol",
|
|
712
711
|
evm: "eth",
|
|
713
712
|
near: "near"
|
|
714
|
-
},
|
|
713
|
+
}, go = ({
|
|
715
714
|
isEnabled: n,
|
|
716
715
|
skipIntents: o = !1,
|
|
717
716
|
target: u = "none"
|
|
718
717
|
}) => {
|
|
719
|
-
const { tokens:
|
|
720
|
-
walletSupportedChains:
|
|
718
|
+
const { tokens: a } = re(), { ctx: l, state: f } = O(), { intentBalances: m } = Ne(), {
|
|
719
|
+
walletSupportedChains: i,
|
|
721
720
|
chainsFilter: g,
|
|
722
|
-
walletAddress:
|
|
721
|
+
walletAddress: T,
|
|
723
722
|
intentsAccountType: w
|
|
724
|
-
} = M(),
|
|
725
|
-
tokens:
|
|
726
|
-
walletSupportedChains:
|
|
723
|
+
} = M(), y = Zn({
|
|
724
|
+
tokens: a,
|
|
725
|
+
walletSupportedChains: i,
|
|
727
726
|
balances: m,
|
|
728
727
|
across: "intents"
|
|
729
|
-
}), [k, h] = W(() => !
|
|
730
|
-
{ token:
|
|
728
|
+
}), [k, h] = W(() => !T && !o ? [
|
|
729
|
+
{ token: Jn({ tokens: a }), status: "loaded" },
|
|
731
730
|
{ token: void 0, status: "loaded" }
|
|
732
|
-
] : g.source.intents !== "none" && !o ?
|
|
733
|
-
{ token:
|
|
731
|
+
] : g.source.intents !== "none" && !o ? y ? [
|
|
732
|
+
{ token: y, status: "loaded" },
|
|
734
733
|
{ token: void 0, status: "loaded" }
|
|
735
734
|
] : [
|
|
736
735
|
{ token: void 0, status: "loading" },
|
|
737
736
|
{ token: void 0, status: "loading" }
|
|
738
737
|
] : [
|
|
739
|
-
{ token:
|
|
740
|
-
tokens:
|
|
741
|
-
walletSupportedChains:
|
|
738
|
+
{ token: Yn({
|
|
739
|
+
tokens: a,
|
|
740
|
+
walletSupportedChains: i
|
|
742
741
|
}), status: "loaded" },
|
|
743
742
|
{ token: void 0, status: "loaded" }
|
|
744
743
|
], [
|
|
745
|
-
|
|
744
|
+
a,
|
|
746
745
|
o,
|
|
747
746
|
g,
|
|
748
|
-
y,
|
|
749
747
|
T,
|
|
750
|
-
|
|
748
|
+
y,
|
|
749
|
+
i,
|
|
751
750
|
f
|
|
752
751
|
]);
|
|
753
752
|
return $(() => {
|
|
754
753
|
if (!n)
|
|
755
754
|
return;
|
|
756
|
-
if (Z(l, ["initial_dry", "initial_wallet"]) && (k.status === "loaded" && !l.sourceToken &&
|
|
755
|
+
if (Z(l, ["initial_dry", "initial_wallet"]) && (k.status === "loaded" && !l.sourceToken && _("tokenSelect", {
|
|
757
756
|
variant: "source",
|
|
758
757
|
token: k.token
|
|
759
758
|
}), h.status === "loaded" && k.status === "loaded" && !l.targetToken)) {
|
|
760
759
|
let E = h.token;
|
|
761
|
-
u === "same-asset" && (k.token?.isIntent ? E =
|
|
760
|
+
u === "same-asset" && (k.token?.isIntent ? E = a.find(
|
|
762
761
|
(S) => !S.isIntent && S.symbol === l.sourceToken?.symbol && S.blockchain === Ue[w]
|
|
763
|
-
) : E =
|
|
762
|
+
) : E = a.find(
|
|
764
763
|
(S) => S.isIntent && S.symbol === l.sourceToken?.symbol
|
|
765
|
-
)),
|
|
764
|
+
)), _("tokenSelect", {
|
|
766
765
|
variant: "target",
|
|
767
766
|
token: E
|
|
768
767
|
});
|
|
@@ -771,100 +770,100 @@ const se = he.getStore(), Yn = _r({
|
|
|
771
770
|
const A = Z(l, ["initial_dry", "initial_wallet"]);
|
|
772
771
|
if (!n || !A)
|
|
773
772
|
return;
|
|
774
|
-
const E =
|
|
775
|
-
(
|
|
773
|
+
const E = a.find(
|
|
774
|
+
(x) => x.isIntent && x.symbol === "AURORA" && x.blockchain === "near"
|
|
776
775
|
), S = setTimeout(() => {
|
|
777
776
|
if (!k.token)
|
|
778
|
-
if (!o &&
|
|
779
|
-
|
|
777
|
+
if (!o && y)
|
|
778
|
+
_("tokenSelect", {
|
|
780
779
|
variant: "source",
|
|
781
|
-
token:
|
|
780
|
+
token: y
|
|
782
781
|
});
|
|
783
|
-
else if (
|
|
784
|
-
const
|
|
785
|
-
(
|
|
782
|
+
else if (i.length) {
|
|
783
|
+
const x = a.find(
|
|
784
|
+
(B) => !B.isIntent && B.blockchain === Ue[w] && B.symbol.toLowerCase() === Sr[Ue[w]]?.toLowerCase()
|
|
786
785
|
) ?? E;
|
|
787
|
-
|
|
786
|
+
_("tokenSelect", {
|
|
788
787
|
variant: "source",
|
|
789
|
-
token:
|
|
788
|
+
token: x
|
|
790
789
|
});
|
|
791
790
|
} else
|
|
792
|
-
|
|
791
|
+
_("tokenSelect", {
|
|
793
792
|
variant: "source",
|
|
794
793
|
token: E
|
|
795
794
|
});
|
|
796
795
|
}, 3e3);
|
|
797
796
|
return () => clearTimeout(S);
|
|
798
|
-
}, [
|
|
799
|
-
},
|
|
797
|
+
}, [a, k, o]), { source: l.sourceToken, target: l.targetToken };
|
|
798
|
+
}, wo = ({
|
|
800
799
|
isEnabled: n,
|
|
801
800
|
alchemyApiKey: o
|
|
802
801
|
}) => {
|
|
803
|
-
const { ctx: u } =
|
|
804
|
-
|
|
802
|
+
const { ctx: u } = O();
|
|
803
|
+
vt({
|
|
805
804
|
isEnabled: n,
|
|
806
805
|
walletAddress: u.walletAddress,
|
|
807
806
|
alchemyApiKey: o ?? ""
|
|
808
807
|
});
|
|
809
|
-
},
|
|
810
|
-
n && P.debug("[WIDGET] Debug mode is enabled"),
|
|
811
|
-
}),
|
|
808
|
+
}, Io = Lr(({ debug: n }) => {
|
|
809
|
+
n && P.debug("[WIDGET] Debug mode is enabled"), oo(), ro({ debug: n }), to({ debug: n });
|
|
810
|
+
}), Ta = ({ listenTo: n, debug: o = !1 }) => {
|
|
812
811
|
$(() => {
|
|
813
|
-
|
|
812
|
+
Io({ debug: o });
|
|
814
813
|
}, [o]);
|
|
815
814
|
const u = n.find(
|
|
816
815
|
(f) => Array.isArray(f) && f[0] === "setBalancesUsingAlchemyExt"
|
|
817
|
-
),
|
|
816
|
+
), a = n.find(
|
|
818
817
|
(f) => Array.isArray(f) && f[0] === "setDefaultSelectedTokens"
|
|
819
818
|
), l = n.find(
|
|
820
819
|
(f) => Array.isArray(f) && f[0] === "makeQuote"
|
|
821
820
|
);
|
|
822
|
-
|
|
821
|
+
wo({
|
|
823
822
|
isEnabled: !!u,
|
|
824
823
|
alchemyApiKey: u?.[1].alchemyApiKey
|
|
825
|
-
}),
|
|
826
|
-
isEnabled: !!
|
|
827
|
-
skipIntents:
|
|
828
|
-
target:
|
|
829
|
-
}),
|
|
824
|
+
}), go({
|
|
825
|
+
isEnabled: !!a,
|
|
826
|
+
skipIntents: a?.[1].skipIntents,
|
|
827
|
+
target: a?.[1].target
|
|
828
|
+
}), ho({
|
|
830
829
|
isEnabled: !!l,
|
|
831
830
|
message: l?.[1].message,
|
|
832
831
|
type: l?.[1].type
|
|
833
|
-
}),
|
|
832
|
+
}), fo({
|
|
834
833
|
isEnabled: n.includes("checkWalletConnection")
|
|
835
|
-
}),
|
|
834
|
+
}), uo({
|
|
836
835
|
isEnabled: n.includes("setSourceTokenBalance")
|
|
837
|
-
}),
|
|
836
|
+
}), lo({
|
|
838
837
|
isEnabled: n.includes("setSourceTokenIntentsTarget")
|
|
839
|
-
}),
|
|
838
|
+
}), co({
|
|
840
839
|
isEnabled: n.includes("updateBalances"),
|
|
841
840
|
alchemyApiKey: u?.[1].alchemyApiKey
|
|
842
841
|
});
|
|
843
|
-
},
|
|
842
|
+
}, To = he.getStore();
|
|
844
843
|
class te extends Error {
|
|
845
844
|
context;
|
|
846
845
|
_is_widget_error = !0;
|
|
847
846
|
constructor(o, u) {
|
|
848
|
-
super(o), this.name = "WidgetError", this.cause = u?.cause, this.context = Qe(
|
|
847
|
+
super(o), this.name = "WidgetError", this.cause = u?.cause, this.context = Qe(To).context;
|
|
849
848
|
}
|
|
850
849
|
}
|
|
851
|
-
class
|
|
850
|
+
class Pt extends te {
|
|
852
851
|
data;
|
|
853
852
|
constructor(o) {
|
|
854
853
|
super(o.code), this.data = o, this.name = "MachineError";
|
|
855
854
|
}
|
|
856
855
|
}
|
|
857
|
-
class H extends
|
|
856
|
+
class H extends Pt {
|
|
858
857
|
constructor(o) {
|
|
859
858
|
super(o), this.name = "QuoteError";
|
|
860
859
|
}
|
|
861
860
|
}
|
|
862
|
-
class
|
|
861
|
+
class b extends Pt {
|
|
863
862
|
constructor(o) {
|
|
864
863
|
super(o), this.name = "TransferError";
|
|
865
864
|
}
|
|
866
865
|
}
|
|
867
|
-
const
|
|
866
|
+
const ya = (n) => typeof n == "object" && n !== null && "_is_widget_error" in n && !!n._is_widget_error, yo = (n) => null, Ao = (n) => (o) => {
|
|
868
867
|
if (o instanceof te)
|
|
869
868
|
throw o;
|
|
870
869
|
const u = new te(
|
|
@@ -872,19 +871,19 @@ const ma = (n) => typeof n == "object" && n !== null && "_is_widget_error" in n
|
|
|
872
871
|
{ cause: o }
|
|
873
872
|
);
|
|
874
873
|
throw u.context = n, u;
|
|
875
|
-
},
|
|
876
|
-
const { ctx: o } =
|
|
874
|
+
}, Eo = ({ children: n }) => {
|
|
875
|
+
const { ctx: o } = O();
|
|
877
876
|
return /* @__PURE__ */ I(
|
|
878
|
-
|
|
877
|
+
br,
|
|
879
878
|
{
|
|
880
|
-
FallbackComponent:
|
|
881
|
-
onError:
|
|
879
|
+
FallbackComponent: yo,
|
|
880
|
+
onError: Ao(o),
|
|
882
881
|
children: n
|
|
883
882
|
}
|
|
884
883
|
);
|
|
885
884
|
};
|
|
886
|
-
function
|
|
887
|
-
const { walletSupportedChains:
|
|
885
|
+
function ko({ rpcs: n, token: o, walletAddress: u }) {
|
|
886
|
+
const { walletSupportedChains: a } = M();
|
|
888
887
|
return We({
|
|
889
888
|
retry: 2,
|
|
890
889
|
enabled: !!u && Object.keys(n).includes(o.blockchain),
|
|
@@ -892,135 +891,146 @@ function yo({ rpcs: n, token: o, walletAddress: u }) {
|
|
|
892
891
|
queryFn: async () => {
|
|
893
892
|
if (!u)
|
|
894
893
|
return null;
|
|
895
|
-
if (o.blockchain === "near" &&
|
|
896
|
-
return !n.near || n.near.length === 0 ? null : o.assetId === j ?
|
|
897
|
-
if (!
|
|
894
|
+
if (o.blockchain === "near" && a.includes(o.blockchain))
|
|
895
|
+
return !n.near || n.near.length === 0 ? null : o.assetId === j ? Yr(u, n.near) : Jr(o, u, n.near);
|
|
896
|
+
if (!a.includes("eth") && Ee(o.blockchain))
|
|
898
897
|
return null;
|
|
899
|
-
if (Ee(o.blockchain) &&
|
|
898
|
+
if (Ee(o.blockchain) && Rt(o)) {
|
|
900
899
|
const l = n[o.blockchain] ?? [];
|
|
901
|
-
return l.length > 0 ?
|
|
900
|
+
return l.length > 0 ? zr(u, l[0]) : null;
|
|
902
901
|
}
|
|
903
|
-
if (
|
|
902
|
+
if (Hr(o) ?? (jr(o) && Ee(o.blockchain))) {
|
|
904
903
|
const l = n[o.blockchain] ?? [];
|
|
905
|
-
return l.length > 0 ?
|
|
904
|
+
return l.length > 0 ? Zr(o, u, l[0]) : null;
|
|
906
905
|
}
|
|
907
906
|
return null;
|
|
908
907
|
}
|
|
909
908
|
});
|
|
910
909
|
}
|
|
911
|
-
const
|
|
910
|
+
const So = ({
|
|
912
911
|
rpcs: n,
|
|
913
912
|
token: o,
|
|
914
913
|
onBalancesLoaded: u
|
|
915
914
|
}) => ($(() => {
|
|
916
915
|
o.isIntent || !Object.keys(n).includes(o.blockchain) || u({ [o.assetId]: "0" });
|
|
917
|
-
}, [o.assetId]), null),
|
|
918
|
-
({ rpcs: n, token: o, walletAddress: u, onBalancesLoaded:
|
|
919
|
-
const { data: l } =
|
|
916
|
+
}, [o.assetId]), null), Mt = lr(
|
|
917
|
+
({ rpcs: n, token: o, walletAddress: u, onBalancesLoaded: a }) => {
|
|
918
|
+
const { data: l } = ko({
|
|
920
919
|
rpcs: n,
|
|
921
920
|
token: o,
|
|
922
921
|
walletAddress: u
|
|
923
922
|
});
|
|
924
923
|
return $(() => {
|
|
925
|
-
!o.isIntent && l != null &&
|
|
926
|
-
}, [o, l,
|
|
924
|
+
!o.isIntent && l != null && a({ [o.assetId]: l });
|
|
925
|
+
}, [o, l, a]), null;
|
|
927
926
|
},
|
|
928
927
|
(n, o) => n.token.assetId === o.token.assetId
|
|
929
928
|
);
|
|
930
|
-
|
|
931
|
-
const
|
|
932
|
-
Zero:
|
|
929
|
+
Mt.displayName = "TokenBalanceLoader";
|
|
930
|
+
const Tt = Object.assign(Mt, {
|
|
931
|
+
Zero: So
|
|
933
932
|
}), De = [
|
|
934
933
|
{ eth: ["ETH", "USDT", "USDC", "AURORA"] },
|
|
935
934
|
{ near: ["USDT", "USDC", "AURORA"] },
|
|
936
935
|
{ arb: ["ARB", "ETH", "USDT", "USDC"] },
|
|
937
936
|
{ btc: ["BTC"] }
|
|
938
|
-
],
|
|
939
|
-
const
|
|
937
|
+
], xo = (n) => [...n].sort((o, u) => {
|
|
938
|
+
const a = De.findIndex(
|
|
940
939
|
(g) => Object.keys(g)[0] === o.blockchain
|
|
941
940
|
), l = De.findIndex(
|
|
942
941
|
(g) => Object.keys(g)[0] === u.blockchain
|
|
943
942
|
);
|
|
944
|
-
if (
|
|
945
|
-
return
|
|
946
|
-
const f = De[
|
|
947
|
-
return m === -1 &&
|
|
948
|
-
}),
|
|
949
|
-
const { tokens: u } = re(), { walletSupportedChains:
|
|
950
|
-
return W(() =>
|
|
951
|
-
|
|
943
|
+
if (a !== l)
|
|
944
|
+
return a === -1 ? 1 : l === -1 ? -1 : a - l;
|
|
945
|
+
const f = De[a]?.[o.blockchain] ?? [], m = f.indexOf(o.symbol), i = f.indexOf(u.symbol);
|
|
946
|
+
return m === -1 && i === -1 ? 0 : m === -1 ? 1 : i === -1 ? -1 : m - i;
|
|
947
|
+
}), No = ({ rpcs: n, walletAddress: o }) => {
|
|
948
|
+
const { tokens: u } = re(), { walletSupportedChains: a } = M(), { setWalletBalance: l } = Ge(o);
|
|
949
|
+
return W(() => xo(u), [u]).map((m) => a.includes(m.blockchain) ? /* @__PURE__ */ I(
|
|
950
|
+
Tt,
|
|
952
951
|
{
|
|
953
952
|
rpcs: n,
|
|
954
953
|
token: m,
|
|
955
954
|
walletAddress: o,
|
|
956
|
-
onBalancesLoaded: (
|
|
955
|
+
onBalancesLoaded: (i) => l(o, i)
|
|
957
956
|
},
|
|
958
957
|
ie(m)
|
|
959
958
|
) : /* @__PURE__ */ I(
|
|
960
|
-
|
|
959
|
+
Tt.Zero,
|
|
961
960
|
{
|
|
962
961
|
rpcs: n,
|
|
963
962
|
token: m,
|
|
964
|
-
onBalancesLoaded: (
|
|
963
|
+
onBalancesLoaded: (i) => l(o, i)
|
|
965
964
|
},
|
|
966
965
|
ie(m)
|
|
967
966
|
));
|
|
968
967
|
};
|
|
969
|
-
function
|
|
970
|
-
const u = new Map(o.map((
|
|
971
|
-
return [...n].sort((
|
|
972
|
-
const f = u.has(
|
|
973
|
-
return f !== m ? f - m :
|
|
968
|
+
function _o(n, o) {
|
|
969
|
+
const u = new Map(o.map((a, l) => [a, l]));
|
|
970
|
+
return [...n].sort((a, l) => {
|
|
971
|
+
const f = u.has(a.id) ? u.get(a.id) : 1 / 0, m = u.has(l.id) ? u.get(l.id) : 1 / 0;
|
|
972
|
+
return f !== m ? f - m : a.id.localeCompare(l.id, void 0, { sensitivity: "base" });
|
|
974
973
|
});
|
|
975
974
|
}
|
|
976
|
-
const
|
|
975
|
+
const bo = (n) => {
|
|
977
976
|
const {
|
|
978
977
|
chainsOrder: o,
|
|
979
978
|
allowedChainsList: u,
|
|
980
|
-
allowedSourceChainsList:
|
|
979
|
+
allowedSourceChainsList: a,
|
|
981
980
|
allowedTargetChainsList: l
|
|
982
981
|
} = M(), { tokens: f } = re();
|
|
983
982
|
return W(() => {
|
|
984
983
|
const m = Array.from(
|
|
985
|
-
new Set(f.map((
|
|
986
|
-
).filter((
|
|
987
|
-
return o ?
|
|
984
|
+
new Set(f.map((i) => Nt[i.blockchain]))
|
|
985
|
+
).filter((i) => !(u && !u.includes(i.id) || n === "source" && a && !a.includes(i.id) || n === "target" && l && !l.includes(i.id)));
|
|
986
|
+
return o ? _o(m, o) : m;
|
|
988
987
|
}, [f, o, u]);
|
|
989
|
-
},
|
|
990
|
-
const { ctx: o } =
|
|
988
|
+
}, Bo = ({ makeTransfer: n }) => {
|
|
989
|
+
const { ctx: o } = O(), { make: u } = en(), a = (f) => {
|
|
990
|
+
if (n)
|
|
991
|
+
return n;
|
|
992
|
+
if (tn(f))
|
|
993
|
+
return u;
|
|
994
|
+
throw new b({
|
|
995
|
+
code: "TRANSFER_INVALID_INITIAL",
|
|
996
|
+
meta: { message: "No transfer function established." }
|
|
997
|
+
});
|
|
998
|
+
};
|
|
991
999
|
return { make: async () => {
|
|
992
1000
|
if (!o.sourceToken) {
|
|
993
1001
|
const i = "No token selected to transfer.";
|
|
994
|
-
throw new
|
|
1002
|
+
throw new b({
|
|
995
1003
|
code: "TRANSFER_INVALID_INITIAL",
|
|
996
1004
|
meta: { message: i }
|
|
997
1005
|
});
|
|
998
1006
|
}
|
|
999
1007
|
if (!o.quote) {
|
|
1000
1008
|
const i = "Quote is required for a transfer.";
|
|
1001
|
-
throw new
|
|
1009
|
+
throw new b({
|
|
1002
1010
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1003
1011
|
meta: { message: i }
|
|
1004
1012
|
});
|
|
1005
1013
|
}
|
|
1006
1014
|
if (!o.quote.depositAddress) {
|
|
1007
1015
|
const i = "Quote has no deposit address. Make sure not dry.";
|
|
1008
|
-
throw new
|
|
1016
|
+
throw new b({
|
|
1009
1017
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1010
1018
|
meta: { message: i }
|
|
1011
1019
|
});
|
|
1012
1020
|
}
|
|
1021
|
+
const f = {
|
|
1022
|
+
amount: o.quote.amountIn,
|
|
1023
|
+
decimals: o.sourceToken.decimals,
|
|
1024
|
+
address: o.quote.depositAddress,
|
|
1025
|
+
chain: o.sourceToken.blockchain,
|
|
1026
|
+
evmChainId: Ee(o.sourceToken.blockchain) ? xr[o.sourceToken.blockchain] : null,
|
|
1027
|
+
isNativeEthTransfer: !!o.sourceToken && Rt(o.sourceToken),
|
|
1028
|
+
tokenAddress: o.sourceToken.assetId === j ? j : o.sourceToken.contractAddress
|
|
1029
|
+
}, m = a(f.address);
|
|
1013
1030
|
try {
|
|
1014
|
-
const i = await
|
|
1015
|
-
amount: o.quote.amountIn,
|
|
1016
|
-
decimals: o.sourceToken.decimals,
|
|
1017
|
-
address: o.quote.depositAddress,
|
|
1018
|
-
chain: o.sourceToken.blockchain,
|
|
1019
|
-
evmChainId: Ee(o.sourceToken.blockchain) ? kr[o.sourceToken.blockchain] : null,
|
|
1020
|
-
tokenAddress: o.sourceToken.assetId === j ? j : o.sourceToken.contractAddress
|
|
1021
|
-
});
|
|
1031
|
+
const i = await m(f);
|
|
1022
1032
|
if (!i)
|
|
1023
|
-
throw P.error("[TRANSFER ERROR]", "No deposit result"), new
|
|
1033
|
+
throw P.error("[TRANSFER ERROR]", "No deposit result"), new b({
|
|
1024
1034
|
code: "NO_DEPOSIT_RESULT"
|
|
1025
1035
|
});
|
|
1026
1036
|
return {
|
|
@@ -1030,26 +1040,26 @@ const xo = (n) => {
|
|
|
1030
1040
|
};
|
|
1031
1041
|
} catch (i) {
|
|
1032
1042
|
P.error("[TRANSFER ERROR]", i, { error: i });
|
|
1033
|
-
let
|
|
1034
|
-
const
|
|
1035
|
-
if (
|
|
1043
|
+
let g = "Failed to make a transfer. Please try again.";
|
|
1044
|
+
const T = i instanceof Error && Pe(i.message);
|
|
1045
|
+
if (T)
|
|
1036
1046
|
return;
|
|
1037
|
-
throw
|
|
1047
|
+
throw Xr.isAxiosError(i) ? (g = i.response?.data?.detail ?? i.message ?? "Failed to make deposit. Please try again.", new b({
|
|
1038
1048
|
code: "QUOTE_ERROR",
|
|
1039
|
-
meta: { message:
|
|
1040
|
-
})) :
|
|
1049
|
+
meta: { message: g }
|
|
1050
|
+
})) : g === "No quotes found" ? new b({
|
|
1041
1051
|
code: "NO_QUOTE_FOUND"
|
|
1042
|
-
}) : i instanceof Error && !
|
|
1052
|
+
}) : i instanceof Error && !T ? new b({
|
|
1043
1053
|
code: "QUOTE_ERROR",
|
|
1044
1054
|
meta: { message: i.message }
|
|
1045
|
-
}) : new
|
|
1055
|
+
}) : new b({
|
|
1046
1056
|
code: "QUOTE_ERROR",
|
|
1047
1057
|
meta: { message: "Unknown quote transfer error" }
|
|
1048
1058
|
});
|
|
1049
1059
|
}
|
|
1050
1060
|
} };
|
|
1051
1061
|
};
|
|
1052
|
-
class
|
|
1062
|
+
class Ro {
|
|
1053
1063
|
constructor(o, u) {
|
|
1054
1064
|
this.account = o, this.getProvider = u;
|
|
1055
1065
|
}
|
|
@@ -1063,7 +1073,7 @@ class _o {
|
|
|
1063
1073
|
identifier: this.account.walletAddress,
|
|
1064
1074
|
method: "evm"
|
|
1065
1075
|
})
|
|
1066
|
-
}),
|
|
1076
|
+
}), a = await this.getProvider(), l = await a.request({ method: "eth_requestAccounts" }), f = await a.request({
|
|
1067
1077
|
method: "personal_sign",
|
|
1068
1078
|
params: [u, l[0]]
|
|
1069
1079
|
});
|
|
@@ -1076,18 +1086,18 @@ class _o {
|
|
|
1076
1086
|
};
|
|
1077
1087
|
}
|
|
1078
1088
|
}
|
|
1079
|
-
const
|
|
1089
|
+
const Fo = ({
|
|
1080
1090
|
walletAddress: n,
|
|
1081
1091
|
getProvider: o
|
|
1082
|
-
}) =>
|
|
1092
|
+
}) => rn({
|
|
1083
1093
|
accountId: n,
|
|
1084
1094
|
signMessage: async (u) => {
|
|
1085
|
-
const
|
|
1086
|
-
if (!
|
|
1095
|
+
const a = o();
|
|
1096
|
+
if (!a.signMessage)
|
|
1087
1097
|
throw new te("Near wallet has no signMessage method exposed");
|
|
1088
1098
|
let l;
|
|
1089
1099
|
try {
|
|
1090
|
-
l = await
|
|
1100
|
+
l = await a.signMessage({
|
|
1091
1101
|
...u,
|
|
1092
1102
|
nonce: Buffer.from(u.nonce)
|
|
1093
1103
|
});
|
|
@@ -1103,25 +1113,25 @@ const bo = ({
|
|
|
1103
1113
|
signature: l.signature
|
|
1104
1114
|
};
|
|
1105
1115
|
}
|
|
1106
|
-
}),
|
|
1116
|
+
}), Co = (n, o) => {
|
|
1107
1117
|
if (o) {
|
|
1108
1118
|
if (n.sendAddress)
|
|
1109
1119
|
return n.sendAddress;
|
|
1110
|
-
throw new
|
|
1120
|
+
throw new b({
|
|
1111
1121
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1112
1122
|
meta: { message: "Send to address is required for a direct transfer" }
|
|
1113
1123
|
});
|
|
1114
1124
|
}
|
|
1115
1125
|
if (!n.quote || n.quote.dry)
|
|
1116
|
-
throw new
|
|
1126
|
+
throw new b({
|
|
1117
1127
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1118
1128
|
meta: { message: "Quote is required for intents non-direct transfer" }
|
|
1119
1129
|
});
|
|
1120
1130
|
return n.quote.depositAddress;
|
|
1121
|
-
},
|
|
1131
|
+
}, Uo = async (n, o) => {
|
|
1122
1132
|
let u = ut.getItem("nearWalletsPk")[o];
|
|
1123
1133
|
if (!n.signMessage)
|
|
1124
|
-
throw new
|
|
1134
|
+
throw new b({
|
|
1125
1135
|
code: "DIRECT_TRANSFER_ERROR",
|
|
1126
1136
|
meta: { message: "Your wallet doesn't support signing messages" }
|
|
1127
1137
|
});
|
|
@@ -1130,10 +1140,10 @@ const bo = ({
|
|
|
1130
1140
|
const f = await n.signMessage({
|
|
1131
1141
|
message: "Authenticate",
|
|
1132
1142
|
recipient: "intents.near",
|
|
1133
|
-
nonce: Buffer.from(
|
|
1143
|
+
nonce: Buffer.from(un(32))
|
|
1134
1144
|
});
|
|
1135
1145
|
if (!f)
|
|
1136
|
-
throw new
|
|
1146
|
+
throw new b({
|
|
1137
1147
|
code: "DIRECT_TRANSFER_ERROR",
|
|
1138
1148
|
meta: { message: "Signing message failed" }
|
|
1139
1149
|
});
|
|
@@ -1141,20 +1151,20 @@ const bo = ({
|
|
|
1141
1151
|
[o]: f.publicKey
|
|
1142
1152
|
});
|
|
1143
1153
|
} catch {
|
|
1144
|
-
throw new
|
|
1154
|
+
throw new b({
|
|
1145
1155
|
code: "DIRECT_TRANSFER_ERROR",
|
|
1146
1156
|
meta: { message: "Your wallet doesn't support signing messages" }
|
|
1147
1157
|
});
|
|
1148
1158
|
}
|
|
1149
|
-
const
|
|
1159
|
+
const a = xe({
|
|
1150
1160
|
walletAddress: o,
|
|
1151
1161
|
addressType: "near"
|
|
1152
1162
|
});
|
|
1153
|
-
if (!await
|
|
1163
|
+
if (!await an({
|
|
1154
1164
|
contractId: ve,
|
|
1155
1165
|
methodName: "has_public_key",
|
|
1156
1166
|
args: {
|
|
1157
|
-
account_id:
|
|
1167
|
+
account_id: a,
|
|
1158
1168
|
public_key: u
|
|
1159
1169
|
}
|
|
1160
1170
|
}))
|
|
@@ -1179,65 +1189,65 @@ const bo = ({
|
|
|
1179
1189
|
]
|
|
1180
1190
|
});
|
|
1181
1191
|
} catch {
|
|
1182
|
-
throw new
|
|
1192
|
+
throw new b({
|
|
1183
1193
|
code: "DIRECT_TRANSFER_ERROR",
|
|
1184
1194
|
meta: { message: "Unable to add public key to intents account" }
|
|
1185
1195
|
});
|
|
1186
1196
|
}
|
|
1187
|
-
},
|
|
1188
|
-
const { ctx: o } =
|
|
1197
|
+
}, Do = ({ providers: n }) => {
|
|
1198
|
+
const { ctx: o } = O(), { isDirectTransfer: u, isDirectNonNearWithdrawal: a } = we(), { appName: l, intentsAccountType: f } = M();
|
|
1189
1199
|
return { make: async ({
|
|
1190
|
-
message:
|
|
1200
|
+
message: i,
|
|
1191
1201
|
onPending: g
|
|
1192
1202
|
}) => {
|
|
1193
1203
|
if (!o.walletAddress)
|
|
1194
|
-
throw new
|
|
1204
|
+
throw new b({
|
|
1195
1205
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1196
1206
|
meta: { message: "No connected wallet to sign a transfer." }
|
|
1197
1207
|
});
|
|
1198
1208
|
if (!o.sourceToken || !o.targetToken)
|
|
1199
|
-
throw new
|
|
1209
|
+
throw new b({
|
|
1200
1210
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1201
1211
|
meta: { message: "No token selected to transfer." }
|
|
1202
1212
|
});
|
|
1203
1213
|
if (!o.sourceToken.isIntent)
|
|
1204
|
-
throw new
|
|
1214
|
+
throw new b({
|
|
1205
1215
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1206
1216
|
meta: {
|
|
1207
1217
|
message: "For not intents source token use useMakeQuoteTransfer instead"
|
|
1208
1218
|
}
|
|
1209
1219
|
});
|
|
1210
|
-
let
|
|
1220
|
+
let T;
|
|
1211
1221
|
switch (f) {
|
|
1212
1222
|
case "evm":
|
|
1213
1223
|
if (!n.evm)
|
|
1214
|
-
throw new
|
|
1224
|
+
throw new b({
|
|
1215
1225
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1216
1226
|
meta: { message: "No EVM provider configured" }
|
|
1217
1227
|
});
|
|
1218
|
-
|
|
1228
|
+
T = new Ro(
|
|
1219
1229
|
{ walletAddress: o.walletAddress },
|
|
1220
1230
|
n.evm
|
|
1221
1231
|
);
|
|
1222
1232
|
break;
|
|
1223
1233
|
case "sol":
|
|
1224
1234
|
if (!n.sol)
|
|
1225
|
-
throw new
|
|
1235
|
+
throw new b({
|
|
1226
1236
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1227
1237
|
meta: { message: "No SOL provider configured" }
|
|
1228
1238
|
});
|
|
1229
|
-
|
|
1239
|
+
T = new ln(
|
|
1230
1240
|
{ walletAddress: o.walletAddress },
|
|
1231
1241
|
n.sol
|
|
1232
1242
|
);
|
|
1233
1243
|
break;
|
|
1234
1244
|
case "near": {
|
|
1235
1245
|
if (!n.near)
|
|
1236
|
-
throw new
|
|
1246
|
+
throw new b({
|
|
1237
1247
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1238
1248
|
meta: { message: "No NEAR provider configured" }
|
|
1239
1249
|
});
|
|
1240
|
-
await
|
|
1250
|
+
await Uo(n.near(), o.walletAddress), T = Fo({
|
|
1241
1251
|
walletAddress: o.walletAddress,
|
|
1242
1252
|
getProvider: n.near
|
|
1243
1253
|
});
|
|
@@ -1246,21 +1256,21 @@ const bo = ({
|
|
|
1246
1256
|
default:
|
|
1247
1257
|
je(f);
|
|
1248
1258
|
}
|
|
1249
|
-
const w = new
|
|
1250
|
-
w.setIntentSigner(
|
|
1251
|
-
let
|
|
1252
|
-
o.sourceToken.assetId === oe && o.targetToken.assetId === j ?
|
|
1259
|
+
const w = new nn({ referral: Ut(l) });
|
|
1260
|
+
w.setIntentSigner(T);
|
|
1261
|
+
let y;
|
|
1262
|
+
o.sourceToken.assetId === oe && o.targetToken.assetId === j ? y = void 0 : u ? y = on(i ?? void 0) : a ? y = void 0 : y = sn();
|
|
1253
1263
|
const k = w.createWithdrawal({
|
|
1254
1264
|
withdrawalParams: {
|
|
1255
1265
|
assetId: o.sourceToken.assetId,
|
|
1256
1266
|
amount: BigInt(o.sourceTokenAmount),
|
|
1257
|
-
destinationAddress:
|
|
1267
|
+
destinationAddress: Co(
|
|
1258
1268
|
o,
|
|
1259
|
-
u ||
|
|
1269
|
+
u || a
|
|
1260
1270
|
),
|
|
1261
1271
|
destinationMemo: void 0,
|
|
1262
1272
|
feeInclusive: !1,
|
|
1263
|
-
routeConfig:
|
|
1273
|
+
routeConfig: y
|
|
1264
1274
|
}
|
|
1265
1275
|
});
|
|
1266
1276
|
try {
|
|
@@ -1270,35 +1280,35 @@ const bo = ({
|
|
|
1270
1280
|
const A = await k.waitForIntentSettlement();
|
|
1271
1281
|
return await k.waitForWithdrawalCompletion(), {
|
|
1272
1282
|
hash: A.hash,
|
|
1273
|
-
transactionLink:
|
|
1283
|
+
transactionLink: cn(Nr.near, A.hash),
|
|
1274
1284
|
intent: h
|
|
1275
1285
|
};
|
|
1276
1286
|
} catch (h) {
|
|
1277
1287
|
if (P.error("[TRANSFER ERROR]", h), h instanceof Error) {
|
|
1278
1288
|
if (h.message.includes("Fee is not estimated"))
|
|
1279
|
-
throw new
|
|
1289
|
+
throw new b({
|
|
1280
1290
|
code: "FEES_NOT_ESTIMATED"
|
|
1281
1291
|
});
|
|
1282
1292
|
if (Pe(h.message) || Pe(`${h.cause}`))
|
|
1283
1293
|
return;
|
|
1284
1294
|
}
|
|
1285
|
-
throw new
|
|
1295
|
+
throw new b({
|
|
1286
1296
|
code: "DIRECT_TRANSFER_ERROR"
|
|
1287
1297
|
});
|
|
1288
1298
|
}
|
|
1289
1299
|
} };
|
|
1290
|
-
},
|
|
1300
|
+
}, Lo = async ({
|
|
1291
1301
|
contractId: n,
|
|
1292
1302
|
accountId: o
|
|
1293
1303
|
}) => {
|
|
1294
1304
|
try {
|
|
1295
|
-
const u = { account_id: o },
|
|
1305
|
+
const u = { account_id: o }, a = Buffer.from(JSON.stringify(u)).toString("base64"), l = await fn.query({
|
|
1296
1306
|
request_type: "call_function",
|
|
1297
1307
|
method_name: "storage_balance_of",
|
|
1298
1308
|
account_id: n,
|
|
1299
|
-
args_base64:
|
|
1309
|
+
args_base64: a,
|
|
1300
1310
|
finality: "optimistic"
|
|
1301
|
-
}), f =
|
|
1311
|
+
}), f = dn(
|
|
1302
1312
|
l,
|
|
1303
1313
|
ye.union([ye.null(), ye.object({ total: ye.string() })])
|
|
1304
1314
|
);
|
|
@@ -1307,33 +1317,33 @@ const bo = ({
|
|
|
1307
1317
|
throw new te("Error fetching balance", { cause: u });
|
|
1308
1318
|
}
|
|
1309
1319
|
};
|
|
1310
|
-
function
|
|
1311
|
-
const { ctx: o } =
|
|
1320
|
+
function Oo(n) {
|
|
1321
|
+
const { ctx: o } = O(), u = o.sourceToken?.contractAddress, a = o.quote?.amountIn ?? o.sourceTokenAmount;
|
|
1312
1322
|
return {
|
|
1313
1323
|
make: async (f, m) => {
|
|
1314
1324
|
if (!n)
|
|
1315
|
-
throw new
|
|
1325
|
+
throw new b({
|
|
1316
1326
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1317
1327
|
meta: { message: "No connected wallet to sign a transfer." }
|
|
1318
1328
|
});
|
|
1319
1329
|
if (!u && o.sourceToken?.assetId !== j)
|
|
1320
|
-
throw new
|
|
1330
|
+
throw new b({
|
|
1321
1331
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1322
1332
|
meta: { message: "No token selected to transfer." }
|
|
1323
1333
|
});
|
|
1324
1334
|
if (!f)
|
|
1325
|
-
throw new
|
|
1335
|
+
throw new b({
|
|
1326
1336
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1327
1337
|
meta: { message: "No recipient address to transfer." }
|
|
1328
1338
|
});
|
|
1329
|
-
if (!
|
|
1330
|
-
throw new
|
|
1339
|
+
if (!a)
|
|
1340
|
+
throw new b({
|
|
1331
1341
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1332
1342
|
meta: { message: "No amount to transfer." }
|
|
1333
1343
|
});
|
|
1334
|
-
const
|
|
1344
|
+
const i = n();
|
|
1335
1345
|
if (o.sourceToken.assetId === j && o.targetToken?.assetId !== oe) {
|
|
1336
|
-
const
|
|
1346
|
+
const T = await i.signAndSendTransactions({
|
|
1337
1347
|
transactions: [
|
|
1338
1348
|
{
|
|
1339
1349
|
signerId: o.walletAddress,
|
|
@@ -1342,7 +1352,7 @@ function Uo(n) {
|
|
|
1342
1352
|
{
|
|
1343
1353
|
type: "Transfer",
|
|
1344
1354
|
params: {
|
|
1345
|
-
deposit:
|
|
1355
|
+
deposit: a
|
|
1346
1356
|
// Amount in yoctoNEAR
|
|
1347
1357
|
}
|
|
1348
1358
|
}
|
|
@@ -1350,9 +1360,9 @@ function Uo(n) {
|
|
|
1350
1360
|
}
|
|
1351
1361
|
]
|
|
1352
1362
|
});
|
|
1353
|
-
return
|
|
1354
|
-
hash:
|
|
1355
|
-
transactionLink: `https://nearblocks.io/txns/${
|
|
1363
|
+
return T && T.length > 0 ? {
|
|
1364
|
+
hash: T[0].transaction?.hash ?? "",
|
|
1365
|
+
transactionLink: `https://nearblocks.io/txns/${T[0].transaction?.hash}`,
|
|
1356
1366
|
intent: void 0
|
|
1357
1367
|
} : {
|
|
1358
1368
|
hash: "",
|
|
@@ -1368,7 +1378,7 @@ function Uo(n) {
|
|
|
1368
1378
|
params: {
|
|
1369
1379
|
methodName: "near_deposit",
|
|
1370
1380
|
gas: dt,
|
|
1371
|
-
deposit:
|
|
1381
|
+
deposit: a,
|
|
1372
1382
|
args: {}
|
|
1373
1383
|
}
|
|
1374
1384
|
}), g.push({
|
|
@@ -1379,13 +1389,13 @@ function Uo(n) {
|
|
|
1379
1389
|
// 1 yocto required by NEP-141
|
|
1380
1390
|
gas: ft,
|
|
1381
1391
|
args: {
|
|
1382
|
-
amount:
|
|
1392
|
+
amount: a,
|
|
1383
1393
|
receiver_id: f,
|
|
1384
1394
|
msg: m ?? ""
|
|
1385
1395
|
}
|
|
1386
1396
|
}
|
|
1387
1397
|
});
|
|
1388
|
-
const
|
|
1398
|
+
const T = await i.signAndSendTransactions({
|
|
1389
1399
|
transactions: [
|
|
1390
1400
|
{
|
|
1391
1401
|
receiverId: "wrap.near",
|
|
@@ -1393,42 +1403,42 @@ function Uo(n) {
|
|
|
1393
1403
|
}
|
|
1394
1404
|
]
|
|
1395
1405
|
});
|
|
1396
|
-
if (
|
|
1406
|
+
if (T?.[0]?.transaction?.hash)
|
|
1397
1407
|
return {
|
|
1398
|
-
hash:
|
|
1399
|
-
transactionLink: `https://nearblocks.io/txns/${
|
|
1408
|
+
hash: T[0].transaction?.hash ?? "",
|
|
1409
|
+
transactionLink: `https://nearblocks.io/txns/${T[0].transaction?.hash}`,
|
|
1400
1410
|
intent: void 0
|
|
1401
1411
|
};
|
|
1402
|
-
throw new
|
|
1412
|
+
throw new b({
|
|
1403
1413
|
code: "NO_DEPOSIT_RESULT"
|
|
1404
1414
|
});
|
|
1405
|
-
} catch (
|
|
1406
|
-
throw P.error("[TRANSFER ERROR]",
|
|
1415
|
+
} catch (T) {
|
|
1416
|
+
throw P.error("[TRANSFER ERROR]", T), new b({
|
|
1407
1417
|
code: "DIRECT_TRANSFER_ERROR"
|
|
1408
1418
|
});
|
|
1409
1419
|
}
|
|
1410
1420
|
if (!u)
|
|
1411
|
-
throw new
|
|
1421
|
+
throw new b({
|
|
1412
1422
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1413
1423
|
meta: { message: "No token selected to transfer." }
|
|
1414
1424
|
});
|
|
1415
1425
|
try {
|
|
1416
|
-
const [
|
|
1417
|
-
|
|
1426
|
+
const [T, w] = await Promise.all([
|
|
1427
|
+
pn({
|
|
1418
1428
|
contractId: u
|
|
1419
1429
|
}),
|
|
1420
|
-
|
|
1430
|
+
Lo({
|
|
1421
1431
|
contractId: u,
|
|
1422
1432
|
accountId: f
|
|
1423
1433
|
})
|
|
1424
|
-
]),
|
|
1425
|
-
|
|
1434
|
+
]), y = T - w;
|
|
1435
|
+
y > 0n && g.push({
|
|
1426
1436
|
type: "FunctionCall",
|
|
1427
1437
|
params: {
|
|
1428
1438
|
methodName: "storage_deposit",
|
|
1429
1439
|
args: { account_id: f },
|
|
1430
1440
|
gas: dt,
|
|
1431
|
-
deposit:
|
|
1441
|
+
deposit: y.toString()
|
|
1432
1442
|
}
|
|
1433
1443
|
}), g.push({
|
|
1434
1444
|
type: "FunctionCall",
|
|
@@ -1436,14 +1446,14 @@ function Uo(n) {
|
|
|
1436
1446
|
methodName: "ft_transfer_call",
|
|
1437
1447
|
args: {
|
|
1438
1448
|
receiver_id: f,
|
|
1439
|
-
amount:
|
|
1449
|
+
amount: a,
|
|
1440
1450
|
msg: m ?? ""
|
|
1441
1451
|
},
|
|
1442
1452
|
gas: ft,
|
|
1443
1453
|
deposit: "1"
|
|
1444
1454
|
}
|
|
1445
1455
|
});
|
|
1446
|
-
const k = await
|
|
1456
|
+
const k = await i.signAndSendTransactions({
|
|
1447
1457
|
transactions: [
|
|
1448
1458
|
{
|
|
1449
1459
|
receiverId: u,
|
|
@@ -1457,74 +1467,74 @@ function Uo(n) {
|
|
|
1457
1467
|
transactionLink: `https://nearblocks.io/txns/${k[0].transaction?.hash}`,
|
|
1458
1468
|
intent: void 0
|
|
1459
1469
|
};
|
|
1460
|
-
throw new
|
|
1470
|
+
throw new b({
|
|
1461
1471
|
code: "NO_DEPOSIT_RESULT"
|
|
1462
1472
|
});
|
|
1463
|
-
} catch (
|
|
1464
|
-
throw P.error("[TRANSFER ERROR]",
|
|
1473
|
+
} catch (T) {
|
|
1474
|
+
throw P.error("[TRANSFER ERROR]", T), new b({
|
|
1465
1475
|
code: "DIRECT_TRANSFER_ERROR"
|
|
1466
1476
|
});
|
|
1467
1477
|
}
|
|
1468
1478
|
}
|
|
1469
1479
|
};
|
|
1470
1480
|
}
|
|
1471
|
-
const
|
|
1481
|
+
const qo = ({
|
|
1472
1482
|
message: n,
|
|
1473
1483
|
providers: o,
|
|
1474
1484
|
makeTransfer: u
|
|
1475
1485
|
}) => {
|
|
1476
|
-
const { ctx:
|
|
1486
|
+
const { ctx: a } = O(), { isNearToIntentsSameAssetTransfer: l, isDirectNearDeposit: f } = we(), { make: m } = Do({ providers: o }), { make: i } = Bo({ makeTransfer: u }), { make: g } = Oo(
|
|
1477
1487
|
o?.near
|
|
1478
1488
|
);
|
|
1479
1489
|
return { make: async () => {
|
|
1480
|
-
if (!
|
|
1490
|
+
if (!a.targetToken)
|
|
1481
1491
|
return;
|
|
1482
1492
|
let w;
|
|
1483
|
-
const
|
|
1493
|
+
const y = a.sourceToken?.assetId === j && a.targetToken?.assetId === oe;
|
|
1484
1494
|
try {
|
|
1485
|
-
if (
|
|
1495
|
+
if (_("transferSetStatus", {
|
|
1486
1496
|
status: "pending",
|
|
1487
1497
|
reason: "WAITING_CONFIRMATION"
|
|
1488
|
-
}),
|
|
1498
|
+
}), a.sourceToken?.isIntent)
|
|
1489
1499
|
w = await m({
|
|
1490
1500
|
message: n,
|
|
1491
1501
|
onPending: (k) => {
|
|
1492
|
-
|
|
1502
|
+
_("transferSetStatus", {
|
|
1493
1503
|
status: "pending",
|
|
1494
1504
|
reason: k
|
|
1495
1505
|
});
|
|
1496
1506
|
}
|
|
1497
1507
|
});
|
|
1498
|
-
else if (l ||
|
|
1508
|
+
else if (l || y)
|
|
1499
1509
|
w = await g(
|
|
1500
1510
|
ve,
|
|
1501
1511
|
n
|
|
1502
1512
|
);
|
|
1503
1513
|
else if (f) {
|
|
1504
|
-
if (!
|
|
1505
|
-
throw new
|
|
1514
|
+
if (!a.sendAddress)
|
|
1515
|
+
throw new b({
|
|
1506
1516
|
code: "TRANSFER_INVALID_INITIAL",
|
|
1507
1517
|
meta: { message: "No recipient address to transfer." }
|
|
1508
1518
|
});
|
|
1509
1519
|
w = await g(
|
|
1510
|
-
|
|
1520
|
+
a.sendAddress,
|
|
1511
1521
|
n
|
|
1512
1522
|
);
|
|
1513
1523
|
} else
|
|
1514
|
-
w = await
|
|
1524
|
+
w = await i();
|
|
1515
1525
|
} catch (k) {
|
|
1516
|
-
k instanceof
|
|
1526
|
+
k instanceof b && (P.error(k.data), _("transferSetStatus", { status: "error" }), _("errorSet", k.data));
|
|
1517
1527
|
}
|
|
1518
1528
|
if (!w) {
|
|
1519
|
-
|
|
1529
|
+
_("transferSetStatus", { status: "idle" });
|
|
1520
1530
|
return;
|
|
1521
1531
|
}
|
|
1522
|
-
return
|
|
1532
|
+
return _("transferSetStatus", { status: "success" }), Y("transfer_success"), w;
|
|
1523
1533
|
} };
|
|
1524
1534
|
}, K = {
|
|
1525
1535
|
size: "lg",
|
|
1526
1536
|
variant: "primary"
|
|
1527
|
-
},
|
|
1537
|
+
}, $t = (n) => {
|
|
1528
1538
|
const { t: o } = ge();
|
|
1529
1539
|
if (n.error?.code === "SOURCE_BALANCE_INSUFFICIENT")
|
|
1530
1540
|
return /* @__PURE__ */ I(G, { state: "error", ...K, children: o("submit.error.insufficientBalance", "Insufficient balance") });
|
|
@@ -1533,7 +1543,7 @@ const Do = ({
|
|
|
1533
1543
|
if (n.error?.code === "QUOTE_AMOUNT_IS_TOO_LOW")
|
|
1534
1544
|
return /* @__PURE__ */ C("div", { className: "gap-sw-md flex flex-col", children: [
|
|
1535
1545
|
/* @__PURE__ */ I(G, { state: "error", ...K, children: o("submit.error.amountTooLow.label", "Amount is too low") }),
|
|
1536
|
-
/* @__PURE__ */ I(pe, { children: /* @__PURE__ */ C(
|
|
1546
|
+
/* @__PURE__ */ I(pe, { children: /* @__PURE__ */ C(yr, { i18nKey: "submit.error.amountTooLow.message", children: [
|
|
1537
1547
|
"Amount you entered is very low. Please try increasing it",
|
|
1538
1548
|
" ",
|
|
1539
1549
|
/* @__PURE__ */ C("span", { className: "text-nowrap", children: [
|
|
@@ -1563,81 +1573,81 @@ const Do = ({
|
|
|
1563
1573
|
/* @__PURE__ */ I(G, { state: "error", ...K, children: o("submit.error.transferFailed.label", "Transfer failed") }),
|
|
1564
1574
|
n.error.meta?.message ? /* @__PURE__ */ I(pe, { children: n.error.meta.message }) : null
|
|
1565
1575
|
] });
|
|
1566
|
-
},
|
|
1567
|
-
const { ctx: n } =
|
|
1568
|
-
return
|
|
1569
|
-
},
|
|
1576
|
+
}, vo = () => {
|
|
1577
|
+
const { ctx: n } = O();
|
|
1578
|
+
return $t(n);
|
|
1579
|
+
}, Po = ({
|
|
1570
1580
|
providers: n,
|
|
1571
1581
|
makeTransfer: o,
|
|
1572
1582
|
onMsg: u,
|
|
1573
|
-
internalSwapLabel:
|
|
1583
|
+
internalSwapLabel: a,
|
|
1574
1584
|
externalSwapLabel: l,
|
|
1575
1585
|
transferLabel: f
|
|
1576
1586
|
}) => {
|
|
1577
|
-
const { ctx: m } =
|
|
1587
|
+
const { ctx: m } = O(), { t: i } = ge(), {
|
|
1578
1588
|
isDirectTransfer: g,
|
|
1579
|
-
isDirectNonNearWithdrawal:
|
|
1589
|
+
isDirectNonNearWithdrawal: T,
|
|
1580
1590
|
isNearToIntentsSameAssetTransfer: w,
|
|
1581
|
-
isDirectNearDeposit:
|
|
1582
|
-
} = we(), { make: k } =
|
|
1583
|
-
const
|
|
1584
|
-
|
|
1591
|
+
isDirectNearDeposit: y
|
|
1592
|
+
} = we(), { make: k } = qo({ providers: n, makeTransfer: o }), h = $t(m), A = m.sourceToken?.assetId === j && m.targetToken?.assetId === oe, E = () => g || T || w || y || A ? f : m.sourceToken?.isIntent && m.targetToken?.isIntent ? a : l, S = async () => {
|
|
1593
|
+
const x = await k();
|
|
1594
|
+
x && u({
|
|
1585
1595
|
type: "on_successful_transfer",
|
|
1586
|
-
transfer:
|
|
1596
|
+
transfer: x
|
|
1587
1597
|
});
|
|
1588
1598
|
};
|
|
1589
|
-
if (!
|
|
1599
|
+
if (!mn(m.sourceTokenAmount))
|
|
1590
1600
|
return /* @__PURE__ */ I(G, { ...K, state: "disabled", children: "Enter amount" });
|
|
1591
1601
|
if (h)
|
|
1592
1602
|
return h;
|
|
1593
1603
|
if (m.transferStatus.status === "pending")
|
|
1594
1604
|
switch (m.transferStatus.reason) {
|
|
1595
1605
|
case "WAITING_CONFIRMATION":
|
|
1596
|
-
return /* @__PURE__ */ I(G, { state: "loading", ...K, children:
|
|
1606
|
+
return /* @__PURE__ */ I(G, { state: "loading", ...K, children: i("submit.pending.transfer.confirmInWallet", "Confirm in wallet") });
|
|
1597
1607
|
case "PROCESSING":
|
|
1598
1608
|
default:
|
|
1599
|
-
return /* @__PURE__ */ I(G, { state: "loading", ...K, children:
|
|
1609
|
+
return /* @__PURE__ */ I(G, { state: "loading", ...K, children: i("submit.pending.transfer.finalizing", "Finalizing transfer") });
|
|
1600
1610
|
}
|
|
1601
1611
|
return m.transferStatus.status === "error" ? /* @__PURE__ */ C("div", { className: "gap-sw-md flex flex-col", children: [
|
|
1602
1612
|
/* @__PURE__ */ I(G, { ...K, children: E() }),
|
|
1603
1613
|
/* @__PURE__ */ I(pe, { children: (() => {
|
|
1604
1614
|
switch (m.error?.code) {
|
|
1605
1615
|
case "FEES_NOT_ESTIMATED":
|
|
1606
|
-
return
|
|
1616
|
+
return i(
|
|
1607
1617
|
"submit.error.transfer.noFees",
|
|
1608
1618
|
"Transfer fees could not be estimated."
|
|
1609
1619
|
);
|
|
1610
1620
|
default:
|
|
1611
|
-
return
|
|
1621
|
+
return i(
|
|
1612
1622
|
"submit.error.transfer.failed",
|
|
1613
1623
|
"Transfer can not be completed."
|
|
1614
1624
|
);
|
|
1615
1625
|
}
|
|
1616
1626
|
})() })
|
|
1617
|
-
] }) : m.quoteStatus === "pending" ? /* @__PURE__ */ I(G, { state: "loading", ...K, children:
|
|
1618
|
-
},
|
|
1619
|
-
Error:
|
|
1620
|
-
}),
|
|
1621
|
-
const { t: o } = ge(), { defaultMaxSlippage: u } = M(), { ctx:
|
|
1622
|
-
return
|
|
1623
|
-
|
|
1627
|
+
] }) : m.quoteStatus === "pending" ? /* @__PURE__ */ I(G, { state: "loading", ...K, children: i("submit.pending.quote.finalizing", "Finalizing quote") }) : m.error ? /* @__PURE__ */ I(G, { state: "disabled", ...K, children: E() }) : !m.quote && !g && !T && !w && !y && !A ? /* @__PURE__ */ I(G, { state: "disabled", ...K, children: E() }) : /* @__PURE__ */ I(G, { ...K, onClick: S, children: E() });
|
|
1628
|
+
}, Aa = Object.assign(Po, {
|
|
1629
|
+
Error: vo
|
|
1630
|
+
}), Mo = ({ className: n }) => {
|
|
1631
|
+
const { t: o } = ge(), { defaultMaxSlippage: u } = M(), { ctx: a } = O(), l = a.sourceToken && a.targetToken && a.sourceToken.price / a.targetToken.price;
|
|
1632
|
+
return a.sourceToken ? /* @__PURE__ */ I(
|
|
1633
|
+
hn,
|
|
1624
1634
|
{
|
|
1625
1635
|
expandedByDefault: !1,
|
|
1626
|
-
expandedHeightPx:
|
|
1627
|
-
isBadgeLoading:
|
|
1628
|
-
badge:
|
|
1636
|
+
expandedHeightPx: a.walletAddress ? 80 : 50,
|
|
1637
|
+
isBadgeLoading: a.quoteStatus === "pending",
|
|
1638
|
+
badge: a.quote ? `~ ${a.quote.timeEstimate} sec` : void 0,
|
|
1629
1639
|
className: n,
|
|
1630
|
-
title:
|
|
1631
|
-
`1 ${
|
|
1640
|
+
title: a.sourceToken && a.targetToken ? /* @__PURE__ */ C(Oe, { children: [
|
|
1641
|
+
`1 ${a.sourceToken.symbol} ≈ `,
|
|
1632
1642
|
" ",
|
|
1633
|
-
|
|
1643
|
+
gn(l ?? 0),
|
|
1634
1644
|
" ",
|
|
1635
|
-
`${
|
|
1636
|
-
/* @__PURE__ */ I("span", { className: "text-sw-gray-50", children: `(${pt(
|
|
1645
|
+
`${a.targetToken.symbol}`,
|
|
1646
|
+
/* @__PURE__ */ I("span", { className: "text-sw-gray-50", children: `(${pt(a.sourceToken.price)})` })
|
|
1637
1647
|
] }) : /* @__PURE__ */ C(Oe, { children: [
|
|
1638
|
-
`1 ${
|
|
1648
|
+
`1 ${a.sourceToken.symbol} ≈ `,
|
|
1639
1649
|
" ",
|
|
1640
|
-
pt(
|
|
1650
|
+
pt(a.sourceToken.price),
|
|
1641
1651
|
" USD"
|
|
1642
1652
|
] }),
|
|
1643
1653
|
children: /* @__PURE__ */ C(Fe, { children: [
|
|
@@ -1648,34 +1658,34 @@ const Do = ({
|
|
|
1648
1658
|
value: `${(u * 100).toFixed(2)}%`
|
|
1649
1659
|
}
|
|
1650
1660
|
),
|
|
1651
|
-
!!
|
|
1661
|
+
!!a.walletAddress && /* @__PURE__ */ I(
|
|
1652
1662
|
Fe.Item,
|
|
1653
1663
|
{
|
|
1654
|
-
isLoading:
|
|
1664
|
+
isLoading: a.quoteStatus === "pending",
|
|
1655
1665
|
label: o("quote.result.processingTime.label", "Processing time"),
|
|
1656
|
-
value:
|
|
1666
|
+
value: a.quote ? `${a.quote.timeEstimate} sec.` : "—"
|
|
1657
1667
|
}
|
|
1658
1668
|
)
|
|
1659
1669
|
] })
|
|
1660
1670
|
}
|
|
1661
|
-
) : /* @__PURE__ */ I(
|
|
1662
|
-
},
|
|
1663
|
-
Skeleton:
|
|
1664
|
-
}),
|
|
1671
|
+
) : /* @__PURE__ */ I(Dt, {});
|
|
1672
|
+
}, Ea = Object.assign(Mo, {
|
|
1673
|
+
Skeleton: Dt
|
|
1674
|
+
}), $o = ({
|
|
1665
1675
|
token: n,
|
|
1666
1676
|
balance: o,
|
|
1667
1677
|
isNotSufficient: u = !1,
|
|
1668
|
-
onClick:
|
|
1678
|
+
onClick: a
|
|
1669
1679
|
}) => {
|
|
1670
1680
|
const l = M();
|
|
1671
|
-
return !n.isIntent && !l.walletSupportedChains.includes(n.blockchain) ? /* @__PURE__ */ I("span", {}) : o === void 0 ? /* @__PURE__ */ I(
|
|
1681
|
+
return !n.isIntent && !l.walletSupportedChains.includes(n.blockchain) ? /* @__PURE__ */ I("span", {}) : o === void 0 ? /* @__PURE__ */ I(An, { width: 100 }) : /* @__PURE__ */ I(
|
|
1672
1682
|
"span",
|
|
1673
1683
|
{
|
|
1674
|
-
onClick:
|
|
1675
|
-
className:
|
|
1684
|
+
onClick: a,
|
|
1685
|
+
className: yn("text-sw-label-s", {
|
|
1676
1686
|
"text-sw-alert-100": u,
|
|
1677
1687
|
"text-sw-gray-100": !u,
|
|
1678
|
-
"cursor-pointer": !!
|
|
1688
|
+
"cursor-pointer": !!a
|
|
1679
1689
|
}),
|
|
1680
1690
|
children: /* @__PURE__ */ I(
|
|
1681
1691
|
He,
|
|
@@ -1690,27 +1700,27 @@ const Do = ({
|
|
|
1690
1700
|
token: n,
|
|
1691
1701
|
balance: o,
|
|
1692
1702
|
value: u = "",
|
|
1693
|
-
quoteUsdDelta:
|
|
1703
|
+
quoteUsdDelta: a,
|
|
1694
1704
|
quoteUsdValue: l,
|
|
1695
1705
|
state: f = "default",
|
|
1696
1706
|
showBalance: m = !0,
|
|
1697
|
-
showQuickBalanceActions:
|
|
1707
|
+
showQuickBalanceActions: i = !0,
|
|
1698
1708
|
onMsg: g
|
|
1699
1709
|
}) => {
|
|
1700
|
-
const
|
|
1710
|
+
const T = dr(), w = M(), { t: y } = ge(), k = kn(n, u, l), h = (A) => {
|
|
1701
1711
|
g({
|
|
1702
1712
|
type: "on_change_amount",
|
|
1703
|
-
amount:
|
|
1713
|
+
amount: En(o, n.decimals, A)
|
|
1704
1714
|
});
|
|
1705
1715
|
};
|
|
1706
|
-
return /* @__PURE__ */ C(
|
|
1716
|
+
return /* @__PURE__ */ C(In, { className: "gap-sw-lg flex flex-col", children: [
|
|
1707
1717
|
/* @__PURE__ */ C("div", { className: "flex items-center justify-between", children: [
|
|
1708
1718
|
/* @__PURE__ */ I(
|
|
1709
|
-
|
|
1719
|
+
Tn,
|
|
1710
1720
|
{
|
|
1711
1721
|
value: u,
|
|
1712
|
-
name:
|
|
1713
|
-
setValue:
|
|
1722
|
+
name: T,
|
|
1723
|
+
setValue: wn,
|
|
1714
1724
|
placeholder: "0",
|
|
1715
1725
|
state: f === "default" || f === "disabled" ? f : "error",
|
|
1716
1726
|
onChange: (A) => {
|
|
@@ -1730,7 +1740,7 @@ const Do = ({
|
|
|
1730
1740
|
}
|
|
1731
1741
|
),
|
|
1732
1742
|
children: [
|
|
1733
|
-
/* @__PURE__ */ I(
|
|
1743
|
+
/* @__PURE__ */ I(Lt, { chainShowIcon: !n.isIntent, ...n }),
|
|
1734
1744
|
/* @__PURE__ */ I("span", { className: "text-sw-label-m text-sw-gray-50", children: n.symbol })
|
|
1735
1745
|
]
|
|
1736
1746
|
}
|
|
@@ -1739,20 +1749,20 @@ const Do = ({
|
|
|
1739
1749
|
/* @__PURE__ */ C("div", { className: "gap-sw-sm min-h-sw-2xl flex items-center justify-between", children: [
|
|
1740
1750
|
/* @__PURE__ */ C("div", { className: "gap-sw-md flex items-center", children: [
|
|
1741
1751
|
/* @__PURE__ */ I("span", { className: "text-sw-label-s text-sw-gray-100", children: k }),
|
|
1742
|
-
|
|
1752
|
+
a ? /* @__PURE__ */ I(
|
|
1743
1753
|
Ce,
|
|
1744
1754
|
{
|
|
1745
1755
|
size: "sm",
|
|
1746
1756
|
detail: "dimmed",
|
|
1747
1757
|
isClickable: !1,
|
|
1748
|
-
variant:
|
|
1749
|
-
children: `${
|
|
1758
|
+
variant: Sn(a),
|
|
1759
|
+
children: `${a > 0 ? "+" : ""}${a.toFixed(2)}%`
|
|
1750
1760
|
}
|
|
1751
1761
|
) : null
|
|
1752
1762
|
] }),
|
|
1753
1763
|
/* @__PURE__ */ C("div", { className: "gap-sw-sm flex items-center", children: [
|
|
1754
1764
|
n && !!w.walletAddress && m && /* @__PURE__ */ I(
|
|
1755
|
-
|
|
1765
|
+
$o,
|
|
1756
1766
|
{
|
|
1757
1767
|
token: n,
|
|
1758
1768
|
balance: o,
|
|
@@ -1760,13 +1770,13 @@ const Do = ({
|
|
|
1760
1770
|
onClick: () => h(1)
|
|
1761
1771
|
}
|
|
1762
1772
|
),
|
|
1763
|
-
!!o && m &&
|
|
1773
|
+
!!o && m && i && /* @__PURE__ */ C(Oe, { children: [
|
|
1764
1774
|
/* @__PURE__ */ I(
|
|
1765
1775
|
Ce,
|
|
1766
1776
|
{
|
|
1767
1777
|
isClickable: f !== "disabled",
|
|
1768
1778
|
onClick: () => h(2),
|
|
1769
|
-
children:
|
|
1779
|
+
children: y("tokens.input.half.label", "50%")
|
|
1770
1780
|
}
|
|
1771
1781
|
),
|
|
1772
1782
|
/* @__PURE__ */ I(
|
|
@@ -1774,24 +1784,24 @@ const Do = ({
|
|
|
1774
1784
|
{
|
|
1775
1785
|
isClickable: f !== "disabled",
|
|
1776
1786
|
onClick: () => h(1),
|
|
1777
|
-
children:
|
|
1787
|
+
children: y("tokens.input.max.label", "Max")
|
|
1778
1788
|
}
|
|
1779
1789
|
)
|
|
1780
1790
|
] }),
|
|
1781
|
-
!m && /* @__PURE__ */ I("div", { className: "rounded-full bg-sw-gray-700 py-sw-xs px-sw-sm flex items-center justify-center", children: /* @__PURE__ */ I("span", { className: "text-sw-gray-100 text-label-s", children:
|
|
1791
|
+
!m && /* @__PURE__ */ I("div", { className: "rounded-full bg-sw-gray-700 py-sw-xs px-sw-sm flex items-center justify-center", children: /* @__PURE__ */ I("span", { className: "text-sw-gray-100 text-label-s", children: y("tokens.input.externalBalance.label", "External balance") }) })
|
|
1782
1792
|
] })
|
|
1783
1793
|
] })
|
|
1784
1794
|
] });
|
|
1785
|
-
},
|
|
1786
|
-
const { mergedBalance: o } = _e(), [u,
|
|
1795
|
+
}, Qt = (n) => {
|
|
1796
|
+
const { mergedBalance: o } = _e(), [u, a] = fr(
|
|
1787
1797
|
n ? o[ie(n)] : void 0
|
|
1788
1798
|
);
|
|
1789
1799
|
return $(() => {
|
|
1790
1800
|
let l;
|
|
1791
1801
|
if (n) {
|
|
1792
1802
|
const f = o[ie(n)];
|
|
1793
|
-
f ?
|
|
1794
|
-
|
|
1803
|
+
f ? a(f) : l = setTimeout(() => {
|
|
1804
|
+
a(
|
|
1795
1805
|
n ? o[ie(n)] ?? 0 : 0
|
|
1796
1806
|
);
|
|
1797
1807
|
}, 2e3);
|
|
@@ -1800,53 +1810,53 @@ const Do = ({
|
|
|
1800
1810
|
l && clearTimeout(l);
|
|
1801
1811
|
};
|
|
1802
1812
|
}, [n, o]), u;
|
|
1803
|
-
},
|
|
1804
|
-
const { tokens: u } = re(n),
|
|
1813
|
+
}, Wt = (n, o) => {
|
|
1814
|
+
const { tokens: u } = re(n), a = Array.from(
|
|
1805
1815
|
new Set(u.map((l) => l.assetId))
|
|
1806
1816
|
);
|
|
1807
1817
|
$(() => {
|
|
1808
|
-
const l =
|
|
1818
|
+
const l = a.length === 1 ? u[0] : null;
|
|
1809
1819
|
l && o({ type: "on_select_token", token: l });
|
|
1810
1820
|
}, [u]);
|
|
1811
|
-
},
|
|
1821
|
+
}, Qo = ({
|
|
1812
1822
|
onMsg: n,
|
|
1813
1823
|
isChanging: o = !0,
|
|
1814
1824
|
showBalance: u = !0
|
|
1815
1825
|
}) => {
|
|
1816
|
-
const { ctx:
|
|
1817
|
-
|
|
1826
|
+
const { ctx: a } = O(), l = Qt(a.sourceToken);
|
|
1827
|
+
Wt("source", n);
|
|
1818
1828
|
const f = W(() => {
|
|
1819
|
-
if (!o &&
|
|
1829
|
+
if (!o && a.quoteStatus === "pending")
|
|
1820
1830
|
return "disabled";
|
|
1821
|
-
if (!
|
|
1831
|
+
if (!a.error)
|
|
1822
1832
|
return "default";
|
|
1823
|
-
if (
|
|
1833
|
+
if (a.error.code === "QUOTE_AMOUNT_IS_TOO_LOW")
|
|
1824
1834
|
return "error";
|
|
1825
|
-
if (
|
|
1835
|
+
if (a.error.code === "SOURCE_BALANCE_INSUFFICIENT")
|
|
1826
1836
|
return "error-balance";
|
|
1827
|
-
}, [o,
|
|
1828
|
-
return
|
|
1837
|
+
}, [o, a.error, a.quoteStatus]);
|
|
1838
|
+
return a.sourceToken ? /* @__PURE__ */ I(
|
|
1829
1839
|
Ye,
|
|
1830
1840
|
{
|
|
1831
|
-
token:
|
|
1841
|
+
token: a.sourceToken,
|
|
1832
1842
|
state: f,
|
|
1833
1843
|
balance: l,
|
|
1834
1844
|
showBalance: u,
|
|
1835
1845
|
showQuickBalanceActions: !0,
|
|
1836
|
-
value: ue(
|
|
1846
|
+
value: ue(a.sourceTokenAmount, a.sourceToken?.decimals),
|
|
1837
1847
|
onMsg: n
|
|
1838
1848
|
}
|
|
1839
1849
|
) : /* @__PURE__ */ I(ze, { onMsg: n });
|
|
1840
|
-
},
|
|
1841
|
-
const { ctx: u } =
|
|
1842
|
-
|
|
1850
|
+
}, Wo = ({ isChanging: n = !1, onMsg: o }) => {
|
|
1851
|
+
const { ctx: u } = O(), { usdTradeDelta: a } = we(), l = Qt(u.targetToken);
|
|
1852
|
+
Wt("target", o);
|
|
1843
1853
|
const f = W(() => !n && u.quoteStatus === "pending" ? "disabled" : "default", [n, u.quoteStatus]);
|
|
1844
1854
|
return u.targetToken ? /* @__PURE__ */ I(
|
|
1845
1855
|
Ye,
|
|
1846
1856
|
{
|
|
1847
1857
|
token: u.targetToken,
|
|
1848
1858
|
balance: l,
|
|
1849
|
-
quoteUsdDelta:
|
|
1859
|
+
quoteUsdDelta: a?.percentage,
|
|
1850
1860
|
quoteUsdValue: u.quote && parseFloat(u.quote.amountOutUsd),
|
|
1851
1861
|
value: ue(u.targetTokenAmount, u.targetToken?.decimals),
|
|
1852
1862
|
state: f,
|
|
@@ -1855,38 +1865,38 @@ const Do = ({
|
|
|
1855
1865
|
onMsg: o
|
|
1856
1866
|
}
|
|
1857
1867
|
) : /* @__PURE__ */ I(ze, { onMsg: o });
|
|
1858
|
-
},
|
|
1859
|
-
Skeleton:
|
|
1860
|
-
Source:
|
|
1861
|
-
Target:
|
|
1862
|
-
}),
|
|
1868
|
+
}, Vo = ({ token: n, ...o }) => n ? /* @__PURE__ */ I(Ye, { ...o, token: n }) : /* @__PURE__ */ I(ze, { onMsg: o.onMsg }), ka = Object.assign(Vo, {
|
|
1869
|
+
Skeleton: xn,
|
|
1870
|
+
Source: Qo,
|
|
1871
|
+
Target: Wo
|
|
1872
|
+
}), yt = 58, Vt = ({
|
|
1863
1873
|
token: n,
|
|
1864
1874
|
balance: o,
|
|
1865
1875
|
showBalance: u = !0,
|
|
1866
|
-
isNotSelectable:
|
|
1876
|
+
isNotSelectable: a,
|
|
1867
1877
|
className: l,
|
|
1868
1878
|
onMsg: f
|
|
1869
1879
|
}) => {
|
|
1870
|
-
const { ctx: m } =
|
|
1880
|
+
const { ctx: m } = O(), { walletSupportedChains: i, appName: g } = M(), T = _n(o, n), w = i.includes(n.blockchain) || n.isIntent, y = o !== "0" && o !== 0 && o !== void 0;
|
|
1871
1881
|
return /* @__PURE__ */ I("li", { className: "list-none", children: /* @__PURE__ */ C(
|
|
1872
1882
|
"div",
|
|
1873
1883
|
{
|
|
1874
1884
|
className: Ke(
|
|
1875
1885
|
"gap-sw-lg p-sw-lg flex cursor-pointer justify-between rounded-sw-md transition-colors hover:bg-sw-gray-600",
|
|
1876
1886
|
{
|
|
1877
|
-
"cursor-not-allowed hover:bg-transparent":
|
|
1887
|
+
"cursor-not-allowed hover:bg-transparent": a
|
|
1878
1888
|
},
|
|
1879
1889
|
l
|
|
1880
1890
|
),
|
|
1881
|
-
onClick: () => !
|
|
1891
|
+
onClick: () => !a && f({ type: "on_select_token", token: n }),
|
|
1882
1892
|
children: [
|
|
1883
|
-
/* @__PURE__ */ I(
|
|
1893
|
+
/* @__PURE__ */ I(Lt, { chainShowIcon: !n.isIntent, ...n }),
|
|
1884
1894
|
/* @__PURE__ */ C("div", { className: "gap-sw-sm mr-auto flex flex-col", children: [
|
|
1885
1895
|
/* @__PURE__ */ I("span", { className: "text-sw-label-m text-sw-gray-50", children: n.name }),
|
|
1886
1896
|
n.isIntent ? /* @__PURE__ */ C("div", { className: "flex items-center gap-sw-xs", children: [
|
|
1887
1897
|
/* @__PURE__ */ I("span", { className: "text-sw-label-s text-sw-gray-100", children: n.symbol }),
|
|
1888
1898
|
" ",
|
|
1889
|
-
/* @__PURE__ */ I("span", { className: "text-sw-label-s text-sw-gray-200", children: `on ${g} ${n.chainName !== "Near" &&
|
|
1899
|
+
/* @__PURE__ */ I("span", { className: "text-sw-label-s text-sw-gray-200", children: `on ${g} ${n.chainName !== "Near" && y ? `(${n.chainName})` : ""}` })
|
|
1890
1900
|
] }) : /* @__PURE__ */ C("div", { className: "flex items-center gap-sw-xs", children: [
|
|
1891
1901
|
/* @__PURE__ */ I("span", { className: "text-sw-label-s text-sw-gray-100", children: n.symbol }),
|
|
1892
1902
|
" ",
|
|
@@ -1894,19 +1904,19 @@ const Do = ({
|
|
|
1894
1904
|
] })
|
|
1895
1905
|
] }),
|
|
1896
1906
|
w && !!m.walletAddress && u && /* @__PURE__ */ C("div", { className: "gap-sw-sm flex flex-col items-end", children: [
|
|
1897
|
-
o === void 0 && !n.isIntent ? /* @__PURE__ */ I("span", { className: "h-[16px] w-[60px] animate-pulse rounded-full bg-sw-gray-700" }) : /* @__PURE__ */ I("span", { className: "h-[16px] text-sw-label-m text-sw-gray-50", children:
|
|
1907
|
+
o === void 0 && !n.isIntent ? /* @__PURE__ */ I("span", { className: "h-[16px] w-[60px] animate-pulse rounded-full bg-sw-gray-700" }) : /* @__PURE__ */ I("span", { className: "h-[16px] text-sw-label-m text-sw-gray-50", children: y && /* @__PURE__ */ I(
|
|
1898
1908
|
He,
|
|
1899
1909
|
{
|
|
1900
1910
|
decimals: n.decimals,
|
|
1901
1911
|
value: o === void 0 ? "0" : `${o}`
|
|
1902
1912
|
}
|
|
1903
1913
|
) }),
|
|
1904
|
-
|
|
1914
|
+
y && /* @__PURE__ */ I("span", { className: "text-sw-label-s text-sw-gray-100", children: T })
|
|
1905
1915
|
] })
|
|
1906
1916
|
]
|
|
1907
1917
|
}
|
|
1908
1918
|
) });
|
|
1909
|
-
},
|
|
1919
|
+
}, At = [
|
|
1910
1920
|
"nep141:eth-0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf.omft.near",
|
|
1911
1921
|
// cbBTC (eth)
|
|
1912
1922
|
"nep141:base-0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf.omft.near",
|
|
@@ -1917,79 +1927,79 @@ const Do = ({
|
|
|
1917
1927
|
// wBTC (near)
|
|
1918
1928
|
"nep245:v2_1.omni.hot.tg:56_SZzgw3HSudhZcTwPWUTi2RJB19t"
|
|
1919
1929
|
// NEAR (bsc)
|
|
1920
|
-
],
|
|
1930
|
+
], Go = () => {
|
|
1921
1931
|
const { tokens: n } = re();
|
|
1922
1932
|
return {
|
|
1923
1933
|
uniqueIntentsTokens: W(() => {
|
|
1924
1934
|
const o = n.filter(
|
|
1925
|
-
(l) => l.isIntent && l.blockchain === "near" && !
|
|
1926
|
-
), u = o.map((l) => l.isIntent && l.symbol),
|
|
1927
|
-
return [...o, ...
|
|
1935
|
+
(l) => l.isIntent && l.blockchain === "near" && !At.includes(l.assetId)
|
|
1936
|
+
), u = o.map((l) => l.isIntent && l.symbol), a = n.filter((l) => l.isIntent && l.blockchain !== "near" && !u.includes(l.symbol) && !At.includes(l.assetId));
|
|
1937
|
+
return [...o, ...a];
|
|
1928
1938
|
}, [n])
|
|
1929
1939
|
};
|
|
1930
|
-
},
|
|
1940
|
+
}, Ko = ({
|
|
1931
1941
|
variant: n,
|
|
1932
1942
|
search: o,
|
|
1933
1943
|
selectedChain: u,
|
|
1934
|
-
chainsFilter:
|
|
1944
|
+
chainsFilter: a,
|
|
1935
1945
|
walletSupportedChains: l
|
|
1936
1946
|
}) => {
|
|
1937
|
-
|
|
1938
|
-
const { tokens: f } = re(n), { mergedBalance: m } = _e(), { intentBalances:
|
|
1947
|
+
bo(n);
|
|
1948
|
+
const { tokens: f } = re(n), { mergedBalance: m } = _e(), { intentBalances: i } = Ne(), { uniqueIntentsTokens: g } = Go(), T = Fn(
|
|
1939
1949
|
m,
|
|
1940
1950
|
l,
|
|
1941
1951
|
o
|
|
1942
|
-
), w = f.filter(
|
|
1943
|
-
|
|
1952
|
+
), w = f.filter(Cn({ search: o })).filter(
|
|
1953
|
+
Un({
|
|
1944
1954
|
selectedChain: u,
|
|
1945
|
-
chainsFilter:
|
|
1955
|
+
chainsFilter: a,
|
|
1946
1956
|
walletSupportedChains: l,
|
|
1947
|
-
intentBalances:
|
|
1948
|
-
uniqueIntentTokenIds: g.map((
|
|
1957
|
+
intentBalances: i,
|
|
1958
|
+
uniqueIntentTokenIds: g.map((y) => y.assetId)
|
|
1949
1959
|
})
|
|
1950
1960
|
);
|
|
1951
1961
|
return {
|
|
1952
|
-
all: w.sort(
|
|
1953
|
-
intents: w.filter(mt({ isIntent: !0 })).sort(
|
|
1954
|
-
wallet: w.filter(mt({ isIntent: !1 })).sort(
|
|
1962
|
+
all: w.sort(T),
|
|
1963
|
+
intents: w.filter(mt({ isIntent: !0 })).sort(T),
|
|
1964
|
+
wallet: w.filter(mt({ isIntent: !1 })).sort(T)
|
|
1955
1965
|
};
|
|
1956
|
-
},
|
|
1966
|
+
}, Ho = (n, o) => n.length === 0 && o ? "EMPTY_SEARCH" : n.length === 0 && !o ? "NO_TOKENS" : "HAS_TOKENS", jo = ({
|
|
1957
1967
|
variant: n,
|
|
1958
1968
|
search: o,
|
|
1959
1969
|
className: u,
|
|
1960
|
-
groupTokens:
|
|
1970
|
+
groupTokens: a,
|
|
1961
1971
|
showBalances: l,
|
|
1962
1972
|
chainsFilter: f,
|
|
1963
1973
|
selectedChain: m,
|
|
1964
|
-
chainIsNotSupported:
|
|
1974
|
+
chainIsNotSupported: i,
|
|
1965
1975
|
onMsg: g
|
|
1966
1976
|
}) => {
|
|
1967
|
-
const { t:
|
|
1977
|
+
const { t: T } = ge(), { ctx: w } = O(), { walletSupportedChains: y, appName: k } = M(), { mergedBalance: h } = _e(), A = Ko({
|
|
1968
1978
|
variant: n,
|
|
1969
1979
|
search: o,
|
|
1970
1980
|
chainsFilter: f,
|
|
1971
1981
|
selectedChain: m,
|
|
1972
|
-
walletSupportedChains:
|
|
1973
|
-
}), E = w.walletAddress ?
|
|
1982
|
+
walletSupportedChains: y
|
|
1983
|
+
}), E = w.walletAddress ? a : !1, S = Ho(A.all, o), x = W(
|
|
1974
1984
|
() => [{ label: null, tokens: A.all }],
|
|
1975
1985
|
[A.all]
|
|
1976
|
-
),
|
|
1986
|
+
), B = W(
|
|
1977
1987
|
() => [
|
|
1978
1988
|
{ label: `${k} account`, tokens: A.intents },
|
|
1979
1989
|
{
|
|
1980
|
-
label:
|
|
1990
|
+
label: i ? null : "Connected wallet",
|
|
1981
1991
|
tokens: A.wallet
|
|
1982
1992
|
}
|
|
1983
1993
|
],
|
|
1984
|
-
[A.wallet, A.intents,
|
|
1985
|
-
),
|
|
1986
|
-
(
|
|
1994
|
+
[A.wallet, A.intents, i]
|
|
1995
|
+
), q = W(() => (E ? B : x).reduce(
|
|
1996
|
+
(F, ee) => F + ee.tokens.length,
|
|
1987
1997
|
0
|
|
1988
|
-
), [
|
|
1998
|
+
), [B, x, E]), z = "450px";
|
|
1989
1999
|
switch (S) {
|
|
1990
2000
|
case "EMPTY_SEARCH":
|
|
1991
2001
|
return /* @__PURE__ */ I(
|
|
1992
|
-
|
|
2002
|
+
Ot,
|
|
1993
2003
|
{
|
|
1994
2004
|
className: "pt-sw-5xl pb-sw-5xl",
|
|
1995
2005
|
onResetSearch: () => g({ type: "on_reset_search" })
|
|
@@ -1997,63 +2007,63 @@ const Do = ({
|
|
|
1997
2007
|
);
|
|
1998
2008
|
case "HAS_TOKENS":
|
|
1999
2009
|
return /* @__PURE__ */ I("div", { className: Ke("gap-sw-lg flex flex-col", u), children: /* @__PURE__ */ I(
|
|
2000
|
-
|
|
2010
|
+
bn,
|
|
2001
2011
|
{
|
|
2002
2012
|
className: "hide-scrollbar",
|
|
2003
2013
|
style: {
|
|
2004
2014
|
maxHeight: z,
|
|
2005
2015
|
minHeight: 200,
|
|
2006
|
-
height:
|
|
2016
|
+
height: q ? q * yt + (E ? B.length * 62 : 0) : yt * 2
|
|
2007
2017
|
},
|
|
2008
|
-
children: (E ?
|
|
2009
|
-
({ label:
|
|
2010
|
-
ee.length &&
|
|
2011
|
-
/* @__PURE__ */ I(
|
|
2012
|
-
/* @__PURE__ */ I("span", { className: "text-sw-label-s pt-sw-xl text-sw-gray-100", children: `${
|
|
2018
|
+
children: (E ? B : x).map(
|
|
2019
|
+
({ label: F, tokens: ee }) => /* @__PURE__ */ C(pr, { children: [
|
|
2020
|
+
ee.length && F ? /* @__PURE__ */ C("header", { className: "pb-sw-lg flex flex-col", children: [
|
|
2021
|
+
/* @__PURE__ */ I(Bn, {}),
|
|
2022
|
+
/* @__PURE__ */ I("span", { className: "text-sw-label-s pt-sw-xl text-sw-gray-100", children: `${F} — ${ee.length}` })
|
|
2013
2023
|
] }) : null,
|
|
2014
2024
|
ee.map((le) => {
|
|
2015
2025
|
const Ie = ie(le);
|
|
2016
2026
|
return /* @__PURE__ */ I(
|
|
2017
|
-
|
|
2027
|
+
Vt,
|
|
2018
2028
|
{
|
|
2019
2029
|
token: le,
|
|
2020
2030
|
showBalance: l,
|
|
2021
2031
|
balance: h[Ie],
|
|
2022
|
-
isNotSelectable:
|
|
2032
|
+
isNotSelectable: i && !!w.walletAddress,
|
|
2023
2033
|
onMsg: g
|
|
2024
2034
|
},
|
|
2025
2035
|
Ie
|
|
2026
2036
|
);
|
|
2027
2037
|
}),
|
|
2028
2038
|
ee.length ? /* @__PURE__ */ I("div", { className: "h-sw-2xl" }) : null
|
|
2029
|
-
] },
|
|
2039
|
+
] }, F ?? "ungrouped-tokens")
|
|
2030
2040
|
)
|
|
2031
2041
|
}
|
|
2032
2042
|
) });
|
|
2033
2043
|
case "NO_TOKENS":
|
|
2034
2044
|
default:
|
|
2035
2045
|
return /* @__PURE__ */ I(
|
|
2036
|
-
|
|
2046
|
+
Rn,
|
|
2037
2047
|
{
|
|
2038
2048
|
variant: "info",
|
|
2039
2049
|
className: "mb-sw-4xl",
|
|
2040
|
-
message:
|
|
2050
|
+
message: T("tokens.list.noBalanceOnApp.label", {
|
|
2041
2051
|
defaultValue: "No balances available on {{appName}}",
|
|
2042
2052
|
appName: k
|
|
2043
2053
|
})
|
|
2044
2054
|
}
|
|
2045
2055
|
);
|
|
2046
2056
|
}
|
|
2047
|
-
},
|
|
2048
|
-
Placeholder:
|
|
2049
|
-
Item:
|
|
2057
|
+
}, Sa = Object.assign(jo, {
|
|
2058
|
+
Placeholder: Ot,
|
|
2059
|
+
Item: Vt
|
|
2050
2060
|
});
|
|
2051
|
-
var Le = {}, fe = {},
|
|
2052
|
-
function
|
|
2053
|
-
if (
|
|
2054
|
-
|
|
2055
|
-
for (var n = [], o = [], u = typeof Uint8Array < "u" ? Uint8Array : Array,
|
|
2056
|
-
n[l] =
|
|
2061
|
+
var Le = {}, fe = {}, Et;
|
|
2062
|
+
function zo() {
|
|
2063
|
+
if (Et) return fe;
|
|
2064
|
+
Et = 1, fe.byteLength = i, fe.toByteArray = T, fe.fromByteArray = k;
|
|
2065
|
+
for (var n = [], o = [], u = typeof Uint8Array < "u" ? Uint8Array : Array, a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", l = 0, f = a.length; l < f; ++l)
|
|
2066
|
+
n[l] = a[l], o[a.charCodeAt(l)] = l;
|
|
2057
2067
|
o[45] = 62, o[95] = 63;
|
|
2058
2068
|
function m(h) {
|
|
2059
2069
|
var A = h.length;
|
|
@@ -2064,61 +2074,61 @@ function Ko() {
|
|
|
2064
2074
|
var S = E === A ? 0 : 4 - E % 4;
|
|
2065
2075
|
return [E, S];
|
|
2066
2076
|
}
|
|
2067
|
-
function
|
|
2077
|
+
function i(h) {
|
|
2068
2078
|
var A = m(h), E = A[0], S = A[1];
|
|
2069
2079
|
return (E + S) * 3 / 4 - S;
|
|
2070
2080
|
}
|
|
2071
2081
|
function g(h, A, E) {
|
|
2072
2082
|
return (A + E) * 3 / 4 - E;
|
|
2073
2083
|
}
|
|
2074
|
-
function
|
|
2075
|
-
var A, E = m(h), S = E[0],
|
|
2076
|
-
for (
|
|
2077
|
-
A = o[h.charCodeAt(
|
|
2078
|
-
return
|
|
2084
|
+
function T(h) {
|
|
2085
|
+
var A, E = m(h), S = E[0], x = E[1], B = new u(g(h, S, x)), q = 0, z = x > 0 ? S - 4 : S, F;
|
|
2086
|
+
for (F = 0; F < z; F += 4)
|
|
2087
|
+
A = o[h.charCodeAt(F)] << 18 | o[h.charCodeAt(F + 1)] << 12 | o[h.charCodeAt(F + 2)] << 6 | o[h.charCodeAt(F + 3)], B[q++] = A >> 16 & 255, B[q++] = A >> 8 & 255, B[q++] = A & 255;
|
|
2088
|
+
return x === 2 && (A = o[h.charCodeAt(F)] << 2 | o[h.charCodeAt(F + 1)] >> 4, B[q++] = A & 255), x === 1 && (A = o[h.charCodeAt(F)] << 10 | o[h.charCodeAt(F + 1)] << 4 | o[h.charCodeAt(F + 2)] >> 2, B[q++] = A >> 8 & 255, B[q++] = A & 255), B;
|
|
2079
2089
|
}
|
|
2080
2090
|
function w(h) {
|
|
2081
2091
|
return n[h >> 18 & 63] + n[h >> 12 & 63] + n[h >> 6 & 63] + n[h & 63];
|
|
2082
2092
|
}
|
|
2083
|
-
function
|
|
2084
|
-
for (var S,
|
|
2085
|
-
S = (h[
|
|
2086
|
-
return
|
|
2093
|
+
function y(h, A, E) {
|
|
2094
|
+
for (var S, x = [], B = A; B < E; B += 3)
|
|
2095
|
+
S = (h[B] << 16 & 16711680) + (h[B + 1] << 8 & 65280) + (h[B + 2] & 255), x.push(w(S));
|
|
2096
|
+
return x.join("");
|
|
2087
2097
|
}
|
|
2088
2098
|
function k(h) {
|
|
2089
|
-
for (var A, E = h.length, S = E % 3,
|
|
2090
|
-
|
|
2091
|
-
return S === 1 ? (A = h[E - 1],
|
|
2099
|
+
for (var A, E = h.length, S = E % 3, x = [], B = 16383, q = 0, z = E - S; q < z; q += B)
|
|
2100
|
+
x.push(y(h, q, q + B > z ? z : q + B));
|
|
2101
|
+
return S === 1 ? (A = h[E - 1], x.push(
|
|
2092
2102
|
n[A >> 2] + n[A << 4 & 63] + "=="
|
|
2093
|
-
)) : S === 2 && (A = (h[E - 2] << 8) + h[E - 1],
|
|
2103
|
+
)) : S === 2 && (A = (h[E - 2] << 8) + h[E - 1], x.push(
|
|
2094
2104
|
n[A >> 10] + n[A >> 4 & 63] + n[A << 2 & 63] + "="
|
|
2095
|
-
)),
|
|
2105
|
+
)), x.join("");
|
|
2096
2106
|
}
|
|
2097
2107
|
return fe;
|
|
2098
2108
|
}
|
|
2099
2109
|
var Ae = {};
|
|
2100
2110
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
2101
|
-
var
|
|
2102
|
-
function
|
|
2103
|
-
return
|
|
2104
|
-
var f, m,
|
|
2105
|
-
for (
|
|
2111
|
+
var kt;
|
|
2112
|
+
function Yo() {
|
|
2113
|
+
return kt || (kt = 1, Ae.read = function(n, o, u, a, l) {
|
|
2114
|
+
var f, m, i = l * 8 - a - 1, g = (1 << i) - 1, T = g >> 1, w = -7, y = u ? l - 1 : 0, k = u ? -1 : 1, h = n[o + y];
|
|
2115
|
+
for (y += k, f = h & (1 << -w) - 1, h >>= -w, w += i; w > 0; f = f * 256 + n[o + y], y += k, w -= 8)
|
|
2106
2116
|
;
|
|
2107
|
-
for (m = f & (1 << -w) - 1, f >>= -w, w +=
|
|
2117
|
+
for (m = f & (1 << -w) - 1, f >>= -w, w += a; w > 0; m = m * 256 + n[o + y], y += k, w -= 8)
|
|
2108
2118
|
;
|
|
2109
2119
|
if (f === 0)
|
|
2110
|
-
f = 1 -
|
|
2120
|
+
f = 1 - T;
|
|
2111
2121
|
else {
|
|
2112
2122
|
if (f === g)
|
|
2113
2123
|
return m ? NaN : (h ? -1 : 1) * (1 / 0);
|
|
2114
|
-
m = m + Math.pow(2,
|
|
2124
|
+
m = m + Math.pow(2, a), f = f - T;
|
|
2115
2125
|
}
|
|
2116
|
-
return (h ? -1 : 1) * m * Math.pow(2, f -
|
|
2117
|
-
}, Ae.write = function(n, o, u,
|
|
2118
|
-
var m,
|
|
2119
|
-
for (o = Math.abs(o), isNaN(o) || o === 1 / 0 ? (
|
|
2126
|
+
return (h ? -1 : 1) * m * Math.pow(2, f - a);
|
|
2127
|
+
}, Ae.write = function(n, o, u, a, l, f) {
|
|
2128
|
+
var m, i, g, T = f * 8 - l - 1, w = (1 << T) - 1, y = w >> 1, k = l === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, h = a ? 0 : f - 1, A = a ? 1 : -1, E = o < 0 || o === 0 && 1 / o < 0 ? 1 : 0;
|
|
2129
|
+
for (o = Math.abs(o), isNaN(o) || o === 1 / 0 ? (i = isNaN(o) ? 1 : 0, m = w) : (m = Math.floor(Math.log(o) / Math.LN2), o * (g = Math.pow(2, -m)) < 1 && (m--, g *= 2), m + y >= 1 ? o += k / g : o += k * Math.pow(2, 1 - y), o * g >= 2 && (m++, g /= 2), m + y >= w ? (i = 0, m = w) : m + y >= 1 ? (i = (o * g - 1) * Math.pow(2, l), m = m + y) : (i = o * Math.pow(2, y - 1) * Math.pow(2, l), m = 0)); l >= 8; n[u + h] = i & 255, h += A, i /= 256, l -= 8)
|
|
2120
2130
|
;
|
|
2121
|
-
for (m = m << l |
|
|
2131
|
+
for (m = m << l | i, T += l; T > 0; n[u + h] = m & 255, h += A, m /= 256, T -= 8)
|
|
2122
2132
|
;
|
|
2123
2133
|
n[u + h - A] |= E * 128;
|
|
2124
2134
|
}), Ae;
|
|
@@ -2129,13 +2139,13 @@ function Ho() {
|
|
|
2129
2139
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
2130
2140
|
* @license MIT
|
|
2131
2141
|
*/
|
|
2132
|
-
var
|
|
2133
|
-
function
|
|
2134
|
-
return
|
|
2135
|
-
const o =
|
|
2136
|
-
n.Buffer =
|
|
2142
|
+
var St;
|
|
2143
|
+
function Jo() {
|
|
2144
|
+
return St || (St = 1, (function(n) {
|
|
2145
|
+
const o = zo(), u = Yo(), a = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
2146
|
+
n.Buffer = i, n.SlowBuffer = B, n.INSPECT_MAX_BYTES = 50;
|
|
2137
2147
|
const l = 2147483647;
|
|
2138
|
-
n.kMaxLength = l,
|
|
2148
|
+
n.kMaxLength = l, i.TYPED_ARRAY_SUPPORT = f(), !i.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
2139
2149
|
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
|
|
2140
2150
|
);
|
|
2141
2151
|
function f() {
|
|
@@ -2148,16 +2158,16 @@ function jo() {
|
|
|
2148
2158
|
return !1;
|
|
2149
2159
|
}
|
|
2150
2160
|
}
|
|
2151
|
-
Object.defineProperty(
|
|
2161
|
+
Object.defineProperty(i.prototype, "parent", {
|
|
2152
2162
|
enumerable: !0,
|
|
2153
2163
|
get: function() {
|
|
2154
|
-
if (
|
|
2164
|
+
if (i.isBuffer(this))
|
|
2155
2165
|
return this.buffer;
|
|
2156
2166
|
}
|
|
2157
|
-
}), Object.defineProperty(
|
|
2167
|
+
}), Object.defineProperty(i.prototype, "offset", {
|
|
2158
2168
|
enumerable: !0,
|
|
2159
2169
|
get: function() {
|
|
2160
|
-
if (
|
|
2170
|
+
if (i.isBuffer(this))
|
|
2161
2171
|
return this.byteOffset;
|
|
2162
2172
|
}
|
|
2163
2173
|
});
|
|
@@ -2165,19 +2175,19 @@ function jo() {
|
|
|
2165
2175
|
if (r > l)
|
|
2166
2176
|
throw new RangeError('The value "' + r + '" is invalid for option "size"');
|
|
2167
2177
|
const e = new Uint8Array(r);
|
|
2168
|
-
return Object.setPrototypeOf(e,
|
|
2178
|
+
return Object.setPrototypeOf(e, i.prototype), e;
|
|
2169
2179
|
}
|
|
2170
|
-
function
|
|
2180
|
+
function i(r, e, t) {
|
|
2171
2181
|
if (typeof r == "number") {
|
|
2172
2182
|
if (typeof e == "string")
|
|
2173
2183
|
throw new TypeError(
|
|
2174
2184
|
'The "string" argument must be of type string. Received type number'
|
|
2175
2185
|
);
|
|
2176
|
-
return
|
|
2186
|
+
return y(r);
|
|
2177
2187
|
}
|
|
2178
2188
|
return g(r, e, t);
|
|
2179
2189
|
}
|
|
2180
|
-
|
|
2190
|
+
i.poolSize = 8192;
|
|
2181
2191
|
function g(r, e, t) {
|
|
2182
2192
|
if (typeof r == "string")
|
|
2183
2193
|
return k(r, e);
|
|
@@ -2195,48 +2205,48 @@ function jo() {
|
|
|
2195
2205
|
);
|
|
2196
2206
|
const s = r.valueOf && r.valueOf();
|
|
2197
2207
|
if (s != null && s !== r)
|
|
2198
|
-
return
|
|
2208
|
+
return i.from(s, e, t);
|
|
2199
2209
|
const c = S(r);
|
|
2200
2210
|
if (c) return c;
|
|
2201
2211
|
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof r[Symbol.toPrimitive] == "function")
|
|
2202
|
-
return
|
|
2212
|
+
return i.from(r[Symbol.toPrimitive]("string"), e, t);
|
|
2203
2213
|
throw new TypeError(
|
|
2204
2214
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof r
|
|
2205
2215
|
);
|
|
2206
2216
|
}
|
|
2207
|
-
|
|
2217
|
+
i.from = function(r, e, t) {
|
|
2208
2218
|
return g(r, e, t);
|
|
2209
|
-
}, Object.setPrototypeOf(
|
|
2210
|
-
function
|
|
2219
|
+
}, Object.setPrototypeOf(i.prototype, Uint8Array.prototype), Object.setPrototypeOf(i, Uint8Array);
|
|
2220
|
+
function T(r) {
|
|
2211
2221
|
if (typeof r != "number")
|
|
2212
2222
|
throw new TypeError('"size" argument must be of type number');
|
|
2213
2223
|
if (r < 0)
|
|
2214
2224
|
throw new RangeError('The value "' + r + '" is invalid for option "size"');
|
|
2215
2225
|
}
|
|
2216
2226
|
function w(r, e, t) {
|
|
2217
|
-
return
|
|
2227
|
+
return T(r), r <= 0 ? m(r) : e !== void 0 ? typeof t == "string" ? m(r).fill(e, t) : m(r).fill(e) : m(r);
|
|
2218
2228
|
}
|
|
2219
|
-
|
|
2229
|
+
i.alloc = function(r, e, t) {
|
|
2220
2230
|
return w(r, e, t);
|
|
2221
2231
|
};
|
|
2222
|
-
function
|
|
2223
|
-
return
|
|
2232
|
+
function y(r) {
|
|
2233
|
+
return T(r), m(r < 0 ? 0 : x(r) | 0);
|
|
2224
2234
|
}
|
|
2225
|
-
|
|
2226
|
-
return
|
|
2227
|
-
},
|
|
2228
|
-
return
|
|
2235
|
+
i.allocUnsafe = function(r) {
|
|
2236
|
+
return y(r);
|
|
2237
|
+
}, i.allocUnsafeSlow = function(r) {
|
|
2238
|
+
return y(r);
|
|
2229
2239
|
};
|
|
2230
2240
|
function k(r, e) {
|
|
2231
|
-
if ((typeof e != "string" || e === "") && (e = "utf8"), !
|
|
2241
|
+
if ((typeof e != "string" || e === "") && (e = "utf8"), !i.isEncoding(e))
|
|
2232
2242
|
throw new TypeError("Unknown encoding: " + e);
|
|
2233
|
-
const t =
|
|
2243
|
+
const t = q(r, e) | 0;
|
|
2234
2244
|
let s = m(t);
|
|
2235
2245
|
const c = s.write(r, e);
|
|
2236
2246
|
return c !== t && (s = s.slice(0, c)), s;
|
|
2237
2247
|
}
|
|
2238
2248
|
function h(r) {
|
|
2239
|
-
const e = r.length < 0 ? 0 :
|
|
2249
|
+
const e = r.length < 0 ? 0 : x(r.length) | 0, t = m(e);
|
|
2240
2250
|
for (let s = 0; s < e; s += 1)
|
|
2241
2251
|
t[s] = r[s] & 255;
|
|
2242
2252
|
return t;
|
|
@@ -2254,11 +2264,11 @@ function jo() {
|
|
|
2254
2264
|
if (r.byteLength < e + (t || 0))
|
|
2255
2265
|
throw new RangeError('"length" is outside of buffer bounds');
|
|
2256
2266
|
let s;
|
|
2257
|
-
return e === void 0 && t === void 0 ? s = new Uint8Array(r) : t === void 0 ? s = new Uint8Array(r, e) : s = new Uint8Array(r, e, t), Object.setPrototypeOf(s,
|
|
2267
|
+
return e === void 0 && t === void 0 ? s = new Uint8Array(r) : t === void 0 ? s = new Uint8Array(r, e) : s = new Uint8Array(r, e, t), Object.setPrototypeOf(s, i.prototype), s;
|
|
2258
2268
|
}
|
|
2259
2269
|
function S(r) {
|
|
2260
|
-
if (
|
|
2261
|
-
const e =
|
|
2270
|
+
if (i.isBuffer(r)) {
|
|
2271
|
+
const e = x(r.length) | 0, t = m(e);
|
|
2262
2272
|
return t.length === 0 || r.copy(t, 0, 0, e), t;
|
|
2263
2273
|
}
|
|
2264
2274
|
if (r.length !== void 0)
|
|
@@ -2266,18 +2276,18 @@ function jo() {
|
|
|
2266
2276
|
if (r.type === "Buffer" && Array.isArray(r.data))
|
|
2267
2277
|
return h(r.data);
|
|
2268
2278
|
}
|
|
2269
|
-
function
|
|
2279
|
+
function x(r) {
|
|
2270
2280
|
if (r >= l)
|
|
2271
2281
|
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + l.toString(16) + " bytes");
|
|
2272
2282
|
return r | 0;
|
|
2273
2283
|
}
|
|
2274
|
-
function
|
|
2275
|
-
return +r != r && (r = 0),
|
|
2284
|
+
function B(r) {
|
|
2285
|
+
return +r != r && (r = 0), i.alloc(+r);
|
|
2276
2286
|
}
|
|
2277
|
-
|
|
2278
|
-
return e != null && e._isBuffer === !0 && e !==
|
|
2279
|
-
},
|
|
2280
|
-
if (X(e, Uint8Array) && (e =
|
|
2287
|
+
i.isBuffer = function(e) {
|
|
2288
|
+
return e != null && e._isBuffer === !0 && e !== i.prototype;
|
|
2289
|
+
}, i.compare = function(e, t) {
|
|
2290
|
+
if (X(e, Uint8Array) && (e = i.from(e, e.offset, e.byteLength)), X(t, Uint8Array) && (t = i.from(t, t.offset, t.byteLength)), !i.isBuffer(e) || !i.isBuffer(t))
|
|
2281
2291
|
throw new TypeError(
|
|
2282
2292
|
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
2283
2293
|
);
|
|
@@ -2289,7 +2299,7 @@ function jo() {
|
|
|
2289
2299
|
break;
|
|
2290
2300
|
}
|
|
2291
2301
|
return s < c ? -1 : c < s ? 1 : 0;
|
|
2292
|
-
},
|
|
2302
|
+
}, i.isEncoding = function(e) {
|
|
2293
2303
|
switch (String(e).toLowerCase()) {
|
|
2294
2304
|
case "hex":
|
|
2295
2305
|
case "utf8":
|
|
@@ -2306,26 +2316,26 @@ function jo() {
|
|
|
2306
2316
|
default:
|
|
2307
2317
|
return !1;
|
|
2308
2318
|
}
|
|
2309
|
-
},
|
|
2319
|
+
}, i.concat = function(e, t) {
|
|
2310
2320
|
if (!Array.isArray(e))
|
|
2311
2321
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
2312
2322
|
if (e.length === 0)
|
|
2313
|
-
return
|
|
2323
|
+
return i.alloc(0);
|
|
2314
2324
|
let s;
|
|
2315
2325
|
if (t === void 0)
|
|
2316
2326
|
for (t = 0, s = 0; s < e.length; ++s)
|
|
2317
2327
|
t += e[s].length;
|
|
2318
|
-
const c =
|
|
2328
|
+
const c = i.allocUnsafe(t);
|
|
2319
2329
|
let d = 0;
|
|
2320
2330
|
for (s = 0; s < e.length; ++s) {
|
|
2321
2331
|
let p = e[s];
|
|
2322
2332
|
if (X(p, Uint8Array))
|
|
2323
|
-
d + p.length > c.length ? (
|
|
2333
|
+
d + p.length > c.length ? (i.isBuffer(p) || (p = i.from(p)), p.copy(c, d)) : Uint8Array.prototype.set.call(
|
|
2324
2334
|
c,
|
|
2325
2335
|
p,
|
|
2326
2336
|
d
|
|
2327
2337
|
);
|
|
2328
|
-
else if (
|
|
2338
|
+
else if (i.isBuffer(p))
|
|
2329
2339
|
p.copy(c, d);
|
|
2330
2340
|
else
|
|
2331
2341
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
@@ -2333,8 +2343,8 @@ function jo() {
|
|
|
2333
2343
|
}
|
|
2334
2344
|
return c;
|
|
2335
2345
|
};
|
|
2336
|
-
function
|
|
2337
|
-
if (
|
|
2346
|
+
function q(r, e) {
|
|
2347
|
+
if (i.isBuffer(r))
|
|
2338
2348
|
return r.length;
|
|
2339
2349
|
if (ArrayBuffer.isView(r) || X(r, ArrayBuffer))
|
|
2340
2350
|
return r.byteLength;
|
|
@@ -2369,7 +2379,7 @@ function jo() {
|
|
|
2369
2379
|
e = ("" + e).toLowerCase(), c = !0;
|
|
2370
2380
|
}
|
|
2371
2381
|
}
|
|
2372
|
-
|
|
2382
|
+
i.byteLength = q;
|
|
2373
2383
|
function z(r, e, t) {
|
|
2374
2384
|
let s = !1;
|
|
2375
2385
|
if ((e === void 0 || e < 0) && (e = 0), e > this.length || ((t === void 0 || t > this.length) && (t = this.length), t <= 0) || (t >>>= 0, e >>>= 0, t <= e))
|
|
@@ -2377,65 +2387,65 @@ function jo() {
|
|
|
2377
2387
|
for (r || (r = "utf8"); ; )
|
|
2378
2388
|
switch (r) {
|
|
2379
2389
|
case "hex":
|
|
2380
|
-
return
|
|
2390
|
+
return er(this, e, t);
|
|
2381
2391
|
case "utf8":
|
|
2382
2392
|
case "utf-8":
|
|
2383
2393
|
return Ze(this, e, t);
|
|
2384
2394
|
case "ascii":
|
|
2385
|
-
return
|
|
2395
|
+
return Zt(this, e, t);
|
|
2386
2396
|
case "latin1":
|
|
2387
2397
|
case "binary":
|
|
2388
|
-
return
|
|
2398
|
+
return Xt(this, e, t);
|
|
2389
2399
|
case "base64":
|
|
2390
|
-
return
|
|
2400
|
+
return Yt(this, e, t);
|
|
2391
2401
|
case "ucs2":
|
|
2392
2402
|
case "ucs-2":
|
|
2393
2403
|
case "utf16le":
|
|
2394
2404
|
case "utf-16le":
|
|
2395
|
-
return
|
|
2405
|
+
return tr(this, e, t);
|
|
2396
2406
|
default:
|
|
2397
2407
|
if (s) throw new TypeError("Unknown encoding: " + r);
|
|
2398
2408
|
r = (r + "").toLowerCase(), s = !0;
|
|
2399
2409
|
}
|
|
2400
2410
|
}
|
|
2401
|
-
|
|
2402
|
-
function
|
|
2411
|
+
i.prototype._isBuffer = !0;
|
|
2412
|
+
function F(r, e, t) {
|
|
2403
2413
|
const s = r[e];
|
|
2404
2414
|
r[e] = r[t], r[t] = s;
|
|
2405
2415
|
}
|
|
2406
|
-
|
|
2416
|
+
i.prototype.swap16 = function() {
|
|
2407
2417
|
const e = this.length;
|
|
2408
2418
|
if (e % 2 !== 0)
|
|
2409
2419
|
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
2410
2420
|
for (let t = 0; t < e; t += 2)
|
|
2411
|
-
|
|
2421
|
+
F(this, t, t + 1);
|
|
2412
2422
|
return this;
|
|
2413
|
-
},
|
|
2423
|
+
}, i.prototype.swap32 = function() {
|
|
2414
2424
|
const e = this.length;
|
|
2415
2425
|
if (e % 4 !== 0)
|
|
2416
2426
|
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
2417
2427
|
for (let t = 0; t < e; t += 4)
|
|
2418
|
-
|
|
2428
|
+
F(this, t, t + 3), F(this, t + 1, t + 2);
|
|
2419
2429
|
return this;
|
|
2420
|
-
},
|
|
2430
|
+
}, i.prototype.swap64 = function() {
|
|
2421
2431
|
const e = this.length;
|
|
2422
2432
|
if (e % 8 !== 0)
|
|
2423
2433
|
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
2424
2434
|
for (let t = 0; t < e; t += 8)
|
|
2425
|
-
|
|
2435
|
+
F(this, t, t + 7), F(this, t + 1, t + 6), F(this, t + 2, t + 5), F(this, t + 3, t + 4);
|
|
2426
2436
|
return this;
|
|
2427
|
-
},
|
|
2437
|
+
}, i.prototype.toString = function() {
|
|
2428
2438
|
const e = this.length;
|
|
2429
2439
|
return e === 0 ? "" : arguments.length === 0 ? Ze(this, 0, e) : z.apply(this, arguments);
|
|
2430
|
-
},
|
|
2431
|
-
if (!
|
|
2432
|
-
return this === e ? !0 :
|
|
2433
|
-
},
|
|
2440
|
+
}, i.prototype.toLocaleString = i.prototype.toString, i.prototype.equals = function(e) {
|
|
2441
|
+
if (!i.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
|
|
2442
|
+
return this === e ? !0 : i.compare(this, e) === 0;
|
|
2443
|
+
}, i.prototype.inspect = function() {
|
|
2434
2444
|
let e = "";
|
|
2435
2445
|
const t = n.INSPECT_MAX_BYTES;
|
|
2436
2446
|
return e = this.toString("hex", 0, t).replace(/(.{2})/g, "$1 ").trim(), this.length > t && (e += " ... "), "<Buffer " + e + ">";
|
|
2437
|
-
},
|
|
2438
|
-
if (X(e, Uint8Array) && (e =
|
|
2447
|
+
}, a && (i.prototype[a] = i.prototype.inspect), i.prototype.compare = function(e, t, s, c, d) {
|
|
2448
|
+
if (X(e, Uint8Array) && (e = i.from(e, e.offset, e.byteLength)), !i.isBuffer(e))
|
|
2439
2449
|
throw new TypeError(
|
|
2440
2450
|
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof e
|
|
2441
2451
|
);
|
|
@@ -2449,10 +2459,10 @@ function jo() {
|
|
|
2449
2459
|
return 1;
|
|
2450
2460
|
if (t >>>= 0, s >>>= 0, c >>>= 0, d >>>= 0, this === e) return 0;
|
|
2451
2461
|
let p = d - c, N = s - t;
|
|
2452
|
-
const
|
|
2453
|
-
for (let
|
|
2454
|
-
if (U[
|
|
2455
|
-
p = U[
|
|
2462
|
+
const D = Math.min(p, N), U = this.slice(c, d), L = e.slice(t, s);
|
|
2463
|
+
for (let R = 0; R < D; ++R)
|
|
2464
|
+
if (U[R] !== L[R]) {
|
|
2465
|
+
p = U[R], N = L[R];
|
|
2456
2466
|
break;
|
|
2457
2467
|
}
|
|
2458
2468
|
return p < N ? -1 : N < p ? 1 : 0;
|
|
@@ -2465,7 +2475,7 @@ function jo() {
|
|
|
2465
2475
|
} else if (t < 0)
|
|
2466
2476
|
if (c) t = 0;
|
|
2467
2477
|
else return -1;
|
|
2468
|
-
if (typeof e == "string" && (e =
|
|
2478
|
+
if (typeof e == "string" && (e = i.from(e, s)), i.isBuffer(e))
|
|
2469
2479
|
return e.length === 0 ? -1 : le(r, e, t, s, c);
|
|
2470
2480
|
if (typeof e == "number")
|
|
2471
2481
|
return e = e & 255, typeof Uint8Array.prototype.indexOf == "function" ? c ? Uint8Array.prototype.indexOf.call(r, e, t) : Uint8Array.prototype.lastIndexOf.call(r, e, t) : le(r, [e], t, s, c);
|
|
@@ -2478,34 +2488,34 @@ function jo() {
|
|
|
2478
2488
|
return -1;
|
|
2479
2489
|
d = 2, p /= 2, N /= 2, t /= 2;
|
|
2480
2490
|
}
|
|
2481
|
-
function L
|
|
2482
|
-
return d === 1 ?
|
|
2491
|
+
function D(L, R) {
|
|
2492
|
+
return d === 1 ? L[R] : L.readUInt16BE(R * d);
|
|
2483
2493
|
}
|
|
2484
2494
|
let U;
|
|
2485
2495
|
if (c) {
|
|
2486
|
-
let
|
|
2496
|
+
let L = -1;
|
|
2487
2497
|
for (U = t; U < p; U++)
|
|
2488
|
-
if (
|
|
2489
|
-
if (
|
|
2498
|
+
if (D(r, U) === D(e, L === -1 ? 0 : U - L)) {
|
|
2499
|
+
if (L === -1 && (L = U), U - L + 1 === N) return L * d;
|
|
2490
2500
|
} else
|
|
2491
|
-
|
|
2501
|
+
L !== -1 && (U -= U - L), L = -1;
|
|
2492
2502
|
} else
|
|
2493
2503
|
for (t + N > p && (t = p - N), U = t; U >= 0; U--) {
|
|
2494
|
-
let
|
|
2495
|
-
for (let
|
|
2496
|
-
if (
|
|
2497
|
-
|
|
2504
|
+
let L = !0;
|
|
2505
|
+
for (let R = 0; R < N; R++)
|
|
2506
|
+
if (D(r, U + R) !== D(e, R)) {
|
|
2507
|
+
L = !1;
|
|
2498
2508
|
break;
|
|
2499
2509
|
}
|
|
2500
|
-
if (
|
|
2510
|
+
if (L) return U;
|
|
2501
2511
|
}
|
|
2502
2512
|
return -1;
|
|
2503
2513
|
}
|
|
2504
|
-
|
|
2514
|
+
i.prototype.includes = function(e, t, s) {
|
|
2505
2515
|
return this.indexOf(e, t, s) !== -1;
|
|
2506
|
-
},
|
|
2516
|
+
}, i.prototype.indexOf = function(e, t, s) {
|
|
2507
2517
|
return ee(this, e, t, s, !0);
|
|
2508
|
-
},
|
|
2518
|
+
}, i.prototype.lastIndexOf = function(e, t, s) {
|
|
2509
2519
|
return ee(this, e, t, s, !1);
|
|
2510
2520
|
};
|
|
2511
2521
|
function Ie(r, e, t, s) {
|
|
@@ -2522,19 +2532,19 @@ function jo() {
|
|
|
2522
2532
|
}
|
|
2523
2533
|
return p;
|
|
2524
2534
|
}
|
|
2525
|
-
function
|
|
2535
|
+
function Kt(r, e, t, s) {
|
|
2526
2536
|
return Te(Be(e, r.length - t), r, t, s);
|
|
2527
2537
|
}
|
|
2528
|
-
function
|
|
2529
|
-
return Te(
|
|
2538
|
+
function Ht(r, e, t, s) {
|
|
2539
|
+
return Te(sr(e), r, t, s);
|
|
2530
2540
|
}
|
|
2531
|
-
function
|
|
2541
|
+
function jt(r, e, t, s) {
|
|
2532
2542
|
return Te(at(e), r, t, s);
|
|
2533
2543
|
}
|
|
2534
|
-
function
|
|
2535
|
-
return Te(
|
|
2544
|
+
function zt(r, e, t, s) {
|
|
2545
|
+
return Te(ir(e, r.length - t), r, t, s);
|
|
2536
2546
|
}
|
|
2537
|
-
|
|
2547
|
+
i.prototype.write = function(e, t, s, c) {
|
|
2538
2548
|
if (t === void 0)
|
|
2539
2549
|
c = "utf8", s = this.length, t = 0;
|
|
2540
2550
|
else if (s === void 0 && typeof t == "string")
|
|
@@ -2556,29 +2566,29 @@ function jo() {
|
|
|
2556
2566
|
return Ie(this, e, t, s);
|
|
2557
2567
|
case "utf8":
|
|
2558
2568
|
case "utf-8":
|
|
2559
|
-
return
|
|
2569
|
+
return Kt(this, e, t, s);
|
|
2560
2570
|
case "ascii":
|
|
2561
2571
|
case "latin1":
|
|
2562
2572
|
case "binary":
|
|
2563
|
-
return
|
|
2573
|
+
return Ht(this, e, t, s);
|
|
2564
2574
|
case "base64":
|
|
2565
|
-
return
|
|
2575
|
+
return jt(this, e, t, s);
|
|
2566
2576
|
case "ucs2":
|
|
2567
2577
|
case "ucs-2":
|
|
2568
2578
|
case "utf16le":
|
|
2569
2579
|
case "utf-16le":
|
|
2570
|
-
return
|
|
2580
|
+
return zt(this, e, t, s);
|
|
2571
2581
|
default:
|
|
2572
2582
|
if (p) throw new TypeError("Unknown encoding: " + c);
|
|
2573
2583
|
c = ("" + c).toLowerCase(), p = !0;
|
|
2574
2584
|
}
|
|
2575
|
-
},
|
|
2585
|
+
}, i.prototype.toJSON = function() {
|
|
2576
2586
|
return {
|
|
2577
2587
|
type: "Buffer",
|
|
2578
2588
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
2579
2589
|
};
|
|
2580
2590
|
};
|
|
2581
|
-
function
|
|
2591
|
+
function Yt(r, e, t) {
|
|
2582
2592
|
return e === 0 && t === r.length ? o.fromByteArray(r) : o.fromByteArray(r.slice(e, t));
|
|
2583
2593
|
}
|
|
2584
2594
|
function Ze(r, e, t) {
|
|
@@ -2589,27 +2599,27 @@ function jo() {
|
|
|
2589
2599
|
const d = r[c];
|
|
2590
2600
|
let p = null, N = d > 239 ? 4 : d > 223 ? 3 : d > 191 ? 2 : 1;
|
|
2591
2601
|
if (c + N <= t) {
|
|
2592
|
-
let
|
|
2602
|
+
let D, U, L, R;
|
|
2593
2603
|
switch (N) {
|
|
2594
2604
|
case 1:
|
|
2595
2605
|
d < 128 && (p = d);
|
|
2596
2606
|
break;
|
|
2597
2607
|
case 2:
|
|
2598
|
-
|
|
2608
|
+
D = r[c + 1], (D & 192) === 128 && (R = (d & 31) << 6 | D & 63, R > 127 && (p = R));
|
|
2599
2609
|
break;
|
|
2600
2610
|
case 3:
|
|
2601
|
-
|
|
2611
|
+
D = r[c + 1], U = r[c + 2], (D & 192) === 128 && (U & 192) === 128 && (R = (d & 15) << 12 | (D & 63) << 6 | U & 63, R > 2047 && (R < 55296 || R > 57343) && (p = R));
|
|
2602
2612
|
break;
|
|
2603
2613
|
case 4:
|
|
2604
|
-
|
|
2614
|
+
D = r[c + 1], U = r[c + 2], L = r[c + 3], (D & 192) === 128 && (U & 192) === 128 && (L & 192) === 128 && (R = (d & 15) << 18 | (D & 63) << 12 | (U & 63) << 6 | L & 63, R > 65535 && R < 1114112 && (p = R));
|
|
2605
2615
|
}
|
|
2606
2616
|
}
|
|
2607
2617
|
p === null ? (p = 65533, N = 1) : p > 65535 && (p -= 65536, s.push(p >>> 10 & 1023 | 55296), p = 56320 | p & 1023), s.push(p), c += N;
|
|
2608
2618
|
}
|
|
2609
|
-
return
|
|
2619
|
+
return Jt(s);
|
|
2610
2620
|
}
|
|
2611
2621
|
const Xe = 4096;
|
|
2612
|
-
function
|
|
2622
|
+
function Jt(r) {
|
|
2613
2623
|
const e = r.length;
|
|
2614
2624
|
if (e <= Xe)
|
|
2615
2625
|
return String.fromCharCode.apply(String, r);
|
|
@@ -2621,133 +2631,133 @@ function jo() {
|
|
|
2621
2631
|
);
|
|
2622
2632
|
return t;
|
|
2623
2633
|
}
|
|
2624
|
-
function
|
|
2634
|
+
function Zt(r, e, t) {
|
|
2625
2635
|
let s = "";
|
|
2626
2636
|
t = Math.min(r.length, t);
|
|
2627
2637
|
for (let c = e; c < t; ++c)
|
|
2628
2638
|
s += String.fromCharCode(r[c] & 127);
|
|
2629
2639
|
return s;
|
|
2630
2640
|
}
|
|
2631
|
-
function
|
|
2641
|
+
function Xt(r, e, t) {
|
|
2632
2642
|
let s = "";
|
|
2633
2643
|
t = Math.min(r.length, t);
|
|
2634
2644
|
for (let c = e; c < t; ++c)
|
|
2635
2645
|
s += String.fromCharCode(r[c]);
|
|
2636
2646
|
return s;
|
|
2637
2647
|
}
|
|
2638
|
-
function
|
|
2648
|
+
function er(r, e, t) {
|
|
2639
2649
|
const s = r.length;
|
|
2640
2650
|
(!e || e < 0) && (e = 0), (!t || t < 0 || t > s) && (t = s);
|
|
2641
2651
|
let c = "";
|
|
2642
2652
|
for (let d = e; d < t; ++d)
|
|
2643
|
-
c +=
|
|
2653
|
+
c += ar[r[d]];
|
|
2644
2654
|
return c;
|
|
2645
2655
|
}
|
|
2646
|
-
function
|
|
2656
|
+
function tr(r, e, t) {
|
|
2647
2657
|
const s = r.slice(e, t);
|
|
2648
2658
|
let c = "";
|
|
2649
2659
|
for (let d = 0; d < s.length - 1; d += 2)
|
|
2650
2660
|
c += String.fromCharCode(s[d] + s[d + 1] * 256);
|
|
2651
2661
|
return c;
|
|
2652
2662
|
}
|
|
2653
|
-
|
|
2663
|
+
i.prototype.slice = function(e, t) {
|
|
2654
2664
|
const s = this.length;
|
|
2655
2665
|
e = ~~e, t = t === void 0 ? s : ~~t, e < 0 ? (e += s, e < 0 && (e = 0)) : e > s && (e = s), t < 0 ? (t += s, t < 0 && (t = 0)) : t > s && (t = s), t < e && (t = e);
|
|
2656
2666
|
const c = this.subarray(e, t);
|
|
2657
|
-
return Object.setPrototypeOf(c,
|
|
2667
|
+
return Object.setPrototypeOf(c, i.prototype), c;
|
|
2658
2668
|
};
|
|
2659
2669
|
function v(r, e, t) {
|
|
2660
2670
|
if (r % 1 !== 0 || r < 0) throw new RangeError("offset is not uint");
|
|
2661
2671
|
if (r + e > t) throw new RangeError("Trying to access beyond buffer length");
|
|
2662
2672
|
}
|
|
2663
|
-
|
|
2673
|
+
i.prototype.readUintLE = i.prototype.readUIntLE = function(e, t, s) {
|
|
2664
2674
|
e = e >>> 0, t = t >>> 0, s || v(e, t, this.length);
|
|
2665
2675
|
let c = this[e], d = 1, p = 0;
|
|
2666
2676
|
for (; ++p < t && (d *= 256); )
|
|
2667
2677
|
c += this[e + p] * d;
|
|
2668
2678
|
return c;
|
|
2669
|
-
},
|
|
2679
|
+
}, i.prototype.readUintBE = i.prototype.readUIntBE = function(e, t, s) {
|
|
2670
2680
|
e = e >>> 0, t = t >>> 0, s || v(e, t, this.length);
|
|
2671
2681
|
let c = this[e + --t], d = 1;
|
|
2672
2682
|
for (; t > 0 && (d *= 256); )
|
|
2673
2683
|
c += this[e + --t] * d;
|
|
2674
2684
|
return c;
|
|
2675
|
-
},
|
|
2685
|
+
}, i.prototype.readUint8 = i.prototype.readUInt8 = function(e, t) {
|
|
2676
2686
|
return e = e >>> 0, t || v(e, 1, this.length), this[e];
|
|
2677
|
-
},
|
|
2687
|
+
}, i.prototype.readUint16LE = i.prototype.readUInt16LE = function(e, t) {
|
|
2678
2688
|
return e = e >>> 0, t || v(e, 2, this.length), this[e] | this[e + 1] << 8;
|
|
2679
|
-
},
|
|
2689
|
+
}, i.prototype.readUint16BE = i.prototype.readUInt16BE = function(e, t) {
|
|
2680
2690
|
return e = e >>> 0, t || v(e, 2, this.length), this[e] << 8 | this[e + 1];
|
|
2681
|
-
},
|
|
2691
|
+
}, i.prototype.readUint32LE = i.prototype.readUInt32LE = function(e, t) {
|
|
2682
2692
|
return e = e >>> 0, t || v(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
|
|
2683
|
-
},
|
|
2693
|
+
}, i.prototype.readUint32BE = i.prototype.readUInt32BE = function(e, t) {
|
|
2684
2694
|
return e = e >>> 0, t || v(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
|
|
2685
|
-
},
|
|
2695
|
+
}, i.prototype.readBigUInt64LE = ne(function(e) {
|
|
2686
2696
|
e = e >>> 0, ce(e, "offset");
|
|
2687
2697
|
const t = this[e], s = this[e + 7];
|
|
2688
2698
|
(t === void 0 || s === void 0) && de(e, this.length - 8);
|
|
2689
2699
|
const c = t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24, d = this[++e] + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + s * 2 ** 24;
|
|
2690
2700
|
return BigInt(c) + (BigInt(d) << BigInt(32));
|
|
2691
|
-
}),
|
|
2701
|
+
}), i.prototype.readBigUInt64BE = ne(function(e) {
|
|
2692
2702
|
e = e >>> 0, ce(e, "offset");
|
|
2693
2703
|
const t = this[e], s = this[e + 7];
|
|
2694
2704
|
(t === void 0 || s === void 0) && de(e, this.length - 8);
|
|
2695
2705
|
const c = t * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e], d = this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + s;
|
|
2696
2706
|
return (BigInt(c) << BigInt(32)) + BigInt(d);
|
|
2697
|
-
}),
|
|
2707
|
+
}), i.prototype.readIntLE = function(e, t, s) {
|
|
2698
2708
|
e = e >>> 0, t = t >>> 0, s || v(e, t, this.length);
|
|
2699
2709
|
let c = this[e], d = 1, p = 0;
|
|
2700
2710
|
for (; ++p < t && (d *= 256); )
|
|
2701
2711
|
c += this[e + p] * d;
|
|
2702
2712
|
return d *= 128, c >= d && (c -= Math.pow(2, 8 * t)), c;
|
|
2703
|
-
},
|
|
2713
|
+
}, i.prototype.readIntBE = function(e, t, s) {
|
|
2704
2714
|
e = e >>> 0, t = t >>> 0, s || v(e, t, this.length);
|
|
2705
2715
|
let c = t, d = 1, p = this[e + --c];
|
|
2706
2716
|
for (; c > 0 && (d *= 256); )
|
|
2707
2717
|
p += this[e + --c] * d;
|
|
2708
2718
|
return d *= 128, p >= d && (p -= Math.pow(2, 8 * t)), p;
|
|
2709
|
-
},
|
|
2719
|
+
}, i.prototype.readInt8 = function(e, t) {
|
|
2710
2720
|
return e = e >>> 0, t || v(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
|
|
2711
|
-
},
|
|
2721
|
+
}, i.prototype.readInt16LE = function(e, t) {
|
|
2712
2722
|
e = e >>> 0, t || v(e, 2, this.length);
|
|
2713
2723
|
const s = this[e] | this[e + 1] << 8;
|
|
2714
2724
|
return s & 32768 ? s | 4294901760 : s;
|
|
2715
|
-
},
|
|
2725
|
+
}, i.prototype.readInt16BE = function(e, t) {
|
|
2716
2726
|
e = e >>> 0, t || v(e, 2, this.length);
|
|
2717
2727
|
const s = this[e + 1] | this[e] << 8;
|
|
2718
2728
|
return s & 32768 ? s | 4294901760 : s;
|
|
2719
|
-
},
|
|
2729
|
+
}, i.prototype.readInt32LE = function(e, t) {
|
|
2720
2730
|
return e = e >>> 0, t || v(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
|
|
2721
|
-
},
|
|
2731
|
+
}, i.prototype.readInt32BE = function(e, t) {
|
|
2722
2732
|
return e = e >>> 0, t || v(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
2723
|
-
},
|
|
2733
|
+
}, i.prototype.readBigInt64LE = ne(function(e) {
|
|
2724
2734
|
e = e >>> 0, ce(e, "offset");
|
|
2725
2735
|
const t = this[e], s = this[e + 7];
|
|
2726
2736
|
(t === void 0 || s === void 0) && de(e, this.length - 8);
|
|
2727
2737
|
const c = this[e + 4] + this[e + 5] * 2 ** 8 + this[e + 6] * 2 ** 16 + (s << 24);
|
|
2728
2738
|
return (BigInt(c) << BigInt(32)) + BigInt(t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24);
|
|
2729
|
-
}),
|
|
2739
|
+
}), i.prototype.readBigInt64BE = ne(function(e) {
|
|
2730
2740
|
e = e >>> 0, ce(e, "offset");
|
|
2731
2741
|
const t = this[e], s = this[e + 7];
|
|
2732
2742
|
(t === void 0 || s === void 0) && de(e, this.length - 8);
|
|
2733
2743
|
const c = (t << 24) + // Overflow
|
|
2734
2744
|
this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e];
|
|
2735
2745
|
return (BigInt(c) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + s);
|
|
2736
|
-
}),
|
|
2746
|
+
}), i.prototype.readFloatLE = function(e, t) {
|
|
2737
2747
|
return e = e >>> 0, t || v(e, 4, this.length), u.read(this, e, !0, 23, 4);
|
|
2738
|
-
},
|
|
2748
|
+
}, i.prototype.readFloatBE = function(e, t) {
|
|
2739
2749
|
return e = e >>> 0, t || v(e, 4, this.length), u.read(this, e, !1, 23, 4);
|
|
2740
|
-
},
|
|
2750
|
+
}, i.prototype.readDoubleLE = function(e, t) {
|
|
2741
2751
|
return e = e >>> 0, t || v(e, 8, this.length), u.read(this, e, !0, 52, 8);
|
|
2742
|
-
},
|
|
2752
|
+
}, i.prototype.readDoubleBE = function(e, t) {
|
|
2743
2753
|
return e = e >>> 0, t || v(e, 8, this.length), u.read(this, e, !1, 52, 8);
|
|
2744
2754
|
};
|
|
2745
2755
|
function V(r, e, t, s, c, d) {
|
|
2746
|
-
if (!
|
|
2756
|
+
if (!i.isBuffer(r)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
2747
2757
|
if (e > c || e < d) throw new RangeError('"value" argument is out of bounds');
|
|
2748
2758
|
if (t + s > r.length) throw new RangeError("Index out of range");
|
|
2749
2759
|
}
|
|
2750
|
-
|
|
2760
|
+
i.prototype.writeUintLE = i.prototype.writeUIntLE = function(e, t, s, c) {
|
|
2751
2761
|
if (e = +e, t = t >>> 0, s = s >>> 0, !c) {
|
|
2752
2762
|
const N = Math.pow(2, 8 * s) - 1;
|
|
2753
2763
|
V(this, e, t, s, N, 0);
|
|
@@ -2756,7 +2766,7 @@ function jo() {
|
|
|
2756
2766
|
for (this[t] = e & 255; ++p < s && (d *= 256); )
|
|
2757
2767
|
this[t + p] = e / d & 255;
|
|
2758
2768
|
return t + s;
|
|
2759
|
-
},
|
|
2769
|
+
}, i.prototype.writeUintBE = i.prototype.writeUIntBE = function(e, t, s, c) {
|
|
2760
2770
|
if (e = +e, t = t >>> 0, s = s >>> 0, !c) {
|
|
2761
2771
|
const N = Math.pow(2, 8 * s) - 1;
|
|
2762
2772
|
V(this, e, t, s, N, 0);
|
|
@@ -2765,15 +2775,15 @@ function jo() {
|
|
|
2765
2775
|
for (this[t + d] = e & 255; --d >= 0 && (p *= 256); )
|
|
2766
2776
|
this[t + d] = e / p & 255;
|
|
2767
2777
|
return t + s;
|
|
2768
|
-
},
|
|
2778
|
+
}, i.prototype.writeUint8 = i.prototype.writeUInt8 = function(e, t, s) {
|
|
2769
2779
|
return e = +e, t = t >>> 0, s || V(this, e, t, 1, 255, 0), this[t] = e & 255, t + 1;
|
|
2770
|
-
},
|
|
2780
|
+
}, i.prototype.writeUint16LE = i.prototype.writeUInt16LE = function(e, t, s) {
|
|
2771
2781
|
return e = +e, t = t >>> 0, s || V(this, e, t, 2, 65535, 0), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
|
|
2772
|
-
},
|
|
2782
|
+
}, i.prototype.writeUint16BE = i.prototype.writeUInt16BE = function(e, t, s) {
|
|
2773
2783
|
return e = +e, t = t >>> 0, s || V(this, e, t, 2, 65535, 0), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
|
|
2774
|
-
},
|
|
2784
|
+
}, i.prototype.writeUint32LE = i.prototype.writeUInt32LE = function(e, t, s) {
|
|
2775
2785
|
return e = +e, t = t >>> 0, s || V(this, e, t, 4, 4294967295, 0), this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = e & 255, t + 4;
|
|
2776
|
-
},
|
|
2786
|
+
}, i.prototype.writeUint32BE = i.prototype.writeUInt32BE = function(e, t, s) {
|
|
2777
2787
|
return e = +e, t = t >>> 0, s || V(this, e, t, 4, 4294967295, 0), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
|
|
2778
2788
|
};
|
|
2779
2789
|
function et(r, e, t, s, c) {
|
|
@@ -2790,41 +2800,41 @@ function jo() {
|
|
|
2790
2800
|
let p = Number(e >> BigInt(32) & BigInt(4294967295));
|
|
2791
2801
|
return r[t + 3] = p, p = p >> 8, r[t + 2] = p, p = p >> 8, r[t + 1] = p, p = p >> 8, r[t] = p, t + 8;
|
|
2792
2802
|
}
|
|
2793
|
-
|
|
2803
|
+
i.prototype.writeBigUInt64LE = ne(function(e, t = 0) {
|
|
2794
2804
|
return et(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
2795
|
-
}),
|
|
2805
|
+
}), i.prototype.writeBigUInt64BE = ne(function(e, t = 0) {
|
|
2796
2806
|
return tt(this, e, t, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
2797
|
-
}),
|
|
2807
|
+
}), i.prototype.writeIntLE = function(e, t, s, c) {
|
|
2798
2808
|
if (e = +e, t = t >>> 0, !c) {
|
|
2799
|
-
const
|
|
2800
|
-
V(this, e, t, s,
|
|
2809
|
+
const D = Math.pow(2, 8 * s - 1);
|
|
2810
|
+
V(this, e, t, s, D - 1, -D);
|
|
2801
2811
|
}
|
|
2802
2812
|
let d = 0, p = 1, N = 0;
|
|
2803
2813
|
for (this[t] = e & 255; ++d < s && (p *= 256); )
|
|
2804
2814
|
e < 0 && N === 0 && this[t + d - 1] !== 0 && (N = 1), this[t + d] = (e / p >> 0) - N & 255;
|
|
2805
2815
|
return t + s;
|
|
2806
|
-
},
|
|
2816
|
+
}, i.prototype.writeIntBE = function(e, t, s, c) {
|
|
2807
2817
|
if (e = +e, t = t >>> 0, !c) {
|
|
2808
|
-
const
|
|
2809
|
-
V(this, e, t, s,
|
|
2818
|
+
const D = Math.pow(2, 8 * s - 1);
|
|
2819
|
+
V(this, e, t, s, D - 1, -D);
|
|
2810
2820
|
}
|
|
2811
2821
|
let d = s - 1, p = 1, N = 0;
|
|
2812
2822
|
for (this[t + d] = e & 255; --d >= 0 && (p *= 256); )
|
|
2813
2823
|
e < 0 && N === 0 && this[t + d + 1] !== 0 && (N = 1), this[t + d] = (e / p >> 0) - N & 255;
|
|
2814
2824
|
return t + s;
|
|
2815
|
-
},
|
|
2825
|
+
}, i.prototype.writeInt8 = function(e, t, s) {
|
|
2816
2826
|
return e = +e, t = t >>> 0, s || V(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = e & 255, t + 1;
|
|
2817
|
-
},
|
|
2827
|
+
}, i.prototype.writeInt16LE = function(e, t, s) {
|
|
2818
2828
|
return e = +e, t = t >>> 0, s || V(this, e, t, 2, 32767, -32768), this[t] = e & 255, this[t + 1] = e >>> 8, t + 2;
|
|
2819
|
-
},
|
|
2829
|
+
}, i.prototype.writeInt16BE = function(e, t, s) {
|
|
2820
2830
|
return e = +e, t = t >>> 0, s || V(this, e, t, 2, 32767, -32768), this[t] = e >>> 8, this[t + 1] = e & 255, t + 2;
|
|
2821
|
-
},
|
|
2831
|
+
}, i.prototype.writeInt32LE = function(e, t, s) {
|
|
2822
2832
|
return e = +e, t = t >>> 0, s || V(this, e, t, 4, 2147483647, -2147483648), this[t] = e & 255, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24, t + 4;
|
|
2823
|
-
},
|
|
2833
|
+
}, i.prototype.writeInt32BE = function(e, t, s) {
|
|
2824
2834
|
return e = +e, t = t >>> 0, s || V(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = e & 255, t + 4;
|
|
2825
|
-
},
|
|
2835
|
+
}, i.prototype.writeBigInt64LE = ne(function(e, t = 0) {
|
|
2826
2836
|
return et(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
2827
|
-
}),
|
|
2837
|
+
}), i.prototype.writeBigInt64BE = ne(function(e, t = 0) {
|
|
2828
2838
|
return tt(this, e, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
2829
2839
|
});
|
|
2830
2840
|
function rt(r, e, t, s, c, d) {
|
|
@@ -2834,20 +2844,20 @@ function jo() {
|
|
|
2834
2844
|
function nt(r, e, t, s, c) {
|
|
2835
2845
|
return e = +e, t = t >>> 0, c || rt(r, e, t, 4), u.write(r, e, t, s, 23, 4), t + 4;
|
|
2836
2846
|
}
|
|
2837
|
-
|
|
2847
|
+
i.prototype.writeFloatLE = function(e, t, s) {
|
|
2838
2848
|
return nt(this, e, t, !0, s);
|
|
2839
|
-
},
|
|
2849
|
+
}, i.prototype.writeFloatBE = function(e, t, s) {
|
|
2840
2850
|
return nt(this, e, t, !1, s);
|
|
2841
2851
|
};
|
|
2842
2852
|
function ot(r, e, t, s, c) {
|
|
2843
2853
|
return e = +e, t = t >>> 0, c || rt(r, e, t, 8), u.write(r, e, t, s, 52, 8), t + 8;
|
|
2844
2854
|
}
|
|
2845
|
-
|
|
2855
|
+
i.prototype.writeDoubleLE = function(e, t, s) {
|
|
2846
2856
|
return ot(this, e, t, !0, s);
|
|
2847
|
-
},
|
|
2857
|
+
}, i.prototype.writeDoubleBE = function(e, t, s) {
|
|
2848
2858
|
return ot(this, e, t, !1, s);
|
|
2849
|
-
},
|
|
2850
|
-
if (!
|
|
2859
|
+
}, i.prototype.copy = function(e, t, s, c) {
|
|
2860
|
+
if (!i.isBuffer(e)) throw new TypeError("argument should be a Buffer");
|
|
2851
2861
|
if (s || (s = 0), !c && c !== 0 && (c = this.length), t >= e.length && (t = e.length), t || (t = 0), c > 0 && c < s && (c = s), c === s || e.length === 0 || this.length === 0) return 0;
|
|
2852
2862
|
if (t < 0)
|
|
2853
2863
|
throw new RangeError("targetStart out of bounds");
|
|
@@ -2860,11 +2870,11 @@ function jo() {
|
|
|
2860
2870
|
this.subarray(s, c),
|
|
2861
2871
|
t
|
|
2862
2872
|
), d;
|
|
2863
|
-
},
|
|
2873
|
+
}, i.prototype.fill = function(e, t, s, c) {
|
|
2864
2874
|
if (typeof e == "string") {
|
|
2865
2875
|
if (typeof t == "string" ? (c = t, t = 0, s = this.length) : typeof s == "string" && (c = s, s = this.length), c !== void 0 && typeof c != "string")
|
|
2866
2876
|
throw new TypeError("encoding must be a string");
|
|
2867
|
-
if (typeof c == "string" && !
|
|
2877
|
+
if (typeof c == "string" && !i.isEncoding(c))
|
|
2868
2878
|
throw new TypeError("Unknown encoding: " + c);
|
|
2869
2879
|
if (e.length === 1) {
|
|
2870
2880
|
const p = e.charCodeAt(0);
|
|
@@ -2881,7 +2891,7 @@ function jo() {
|
|
|
2881
2891
|
for (d = t; d < s; ++d)
|
|
2882
2892
|
this[d] = e;
|
|
2883
2893
|
else {
|
|
2884
|
-
const p =
|
|
2894
|
+
const p = i.isBuffer(e) ? e : i.from(e, c), N = p.length;
|
|
2885
2895
|
if (N === 0)
|
|
2886
2896
|
throw new TypeError('The value "' + e + '" is invalid for argument "value"');
|
|
2887
2897
|
for (d = 0; d < s - t; ++d)
|
|
@@ -2942,7 +2952,7 @@ function jo() {
|
|
|
2942
2952
|
e = `_${r.slice(t - 3, t)}${e}`;
|
|
2943
2953
|
return `${r.slice(0, t)}${e}`;
|
|
2944
2954
|
}
|
|
2945
|
-
function
|
|
2955
|
+
function rr(r, e, t) {
|
|
2946
2956
|
ce(e, "offset"), (r[e] === void 0 || r[e + t] === void 0) && de(e, r.length - (t + 1));
|
|
2947
2957
|
}
|
|
2948
2958
|
function it(r, e, t, s, c, d) {
|
|
@@ -2951,7 +2961,7 @@ function jo() {
|
|
|
2951
2961
|
let N;
|
|
2952
2962
|
throw e === 0 || e === BigInt(0) ? N = `>= 0${p} and < 2${p} ** ${(d + 1) * 8}${p}` : N = `>= -(2${p} ** ${(d + 1) * 8 - 1}${p}) and < 2 ** ${(d + 1) * 8 - 1}${p}`, new ae.ERR_OUT_OF_RANGE("value", N, r);
|
|
2953
2963
|
}
|
|
2954
|
-
|
|
2964
|
+
rr(s, c, d);
|
|
2955
2965
|
}
|
|
2956
2966
|
function ce(r, e) {
|
|
2957
2967
|
if (typeof r != "number")
|
|
@@ -2964,9 +2974,9 @@ function jo() {
|
|
|
2964
2974
|
r
|
|
2965
2975
|
);
|
|
2966
2976
|
}
|
|
2967
|
-
const
|
|
2968
|
-
function
|
|
2969
|
-
if (r = r.split("=")[0], r = r.trim().replace(
|
|
2977
|
+
const nr = /[^+/0-9A-Za-z-_]/g;
|
|
2978
|
+
function or(r) {
|
|
2979
|
+
if (r = r.split("=")[0], r = r.trim().replace(nr, ""), r.length < 2) return "";
|
|
2970
2980
|
for (; r.length % 4 !== 0; )
|
|
2971
2981
|
r = r + "=";
|
|
2972
2982
|
return r;
|
|
@@ -3025,13 +3035,13 @@ function jo() {
|
|
|
3025
3035
|
}
|
|
3026
3036
|
return d;
|
|
3027
3037
|
}
|
|
3028
|
-
function
|
|
3038
|
+
function sr(r) {
|
|
3029
3039
|
const e = [];
|
|
3030
3040
|
for (let t = 0; t < r.length; ++t)
|
|
3031
3041
|
e.push(r.charCodeAt(t) & 255);
|
|
3032
3042
|
return e;
|
|
3033
3043
|
}
|
|
3034
|
-
function
|
|
3044
|
+
function ir(r, e) {
|
|
3035
3045
|
let t, s, c;
|
|
3036
3046
|
const d = [];
|
|
3037
3047
|
for (let p = 0; p < r.length && !((e -= 2) < 0); ++p)
|
|
@@ -3039,7 +3049,7 @@ function jo() {
|
|
|
3039
3049
|
return d;
|
|
3040
3050
|
}
|
|
3041
3051
|
function at(r) {
|
|
3042
|
-
return o.toByteArray(
|
|
3052
|
+
return o.toByteArray(or(r));
|
|
3043
3053
|
}
|
|
3044
3054
|
function Te(r, e, t, s) {
|
|
3045
3055
|
let c;
|
|
@@ -3053,7 +3063,7 @@ function jo() {
|
|
|
3053
3063
|
function Re(r) {
|
|
3054
3064
|
return r !== r;
|
|
3055
3065
|
}
|
|
3056
|
-
const
|
|
3066
|
+
const ar = (function() {
|
|
3057
3067
|
const r = "0123456789abcdef", e = new Array(256);
|
|
3058
3068
|
for (let t = 0; t < 16; ++t) {
|
|
3059
3069
|
const s = t * 16;
|
|
@@ -3063,26 +3073,26 @@ function jo() {
|
|
|
3063
3073
|
return e;
|
|
3064
3074
|
})();
|
|
3065
3075
|
function ne(r) {
|
|
3066
|
-
return typeof BigInt > "u" ?
|
|
3076
|
+
return typeof BigInt > "u" ? cr : r;
|
|
3067
3077
|
}
|
|
3068
|
-
function
|
|
3078
|
+
function cr() {
|
|
3069
3079
|
throw new Error("BigInt not supported");
|
|
3070
3080
|
}
|
|
3071
3081
|
})(Le)), Le;
|
|
3072
3082
|
}
|
|
3073
|
-
var
|
|
3074
|
-
const
|
|
3083
|
+
var Na = Jo();
|
|
3084
|
+
const Zo = new Ir({
|
|
3075
3085
|
defaultOptions: {
|
|
3076
3086
|
queries: {
|
|
3077
3087
|
staleTime: 2e3 * 60
|
|
3078
3088
|
}
|
|
3079
3089
|
}
|
|
3080
|
-
}),
|
|
3090
|
+
}), Xo = ["fms", "abg", "stjack", "noear", "testnebula"], ke = {
|
|
3081
3091
|
appName: "Unknown",
|
|
3082
3092
|
appIcon: "https://wtmcxrwapthiogjpxwfr.supabase.co/storage/v1/object/public/swap-widget/unknown.svg",
|
|
3083
3093
|
defaultMaxSlippage: 0.01,
|
|
3084
3094
|
intentsAccountType: "evm",
|
|
3085
|
-
walletSupportedChains:
|
|
3095
|
+
walletSupportedChains: _r,
|
|
3086
3096
|
oneClickApiQuoteProxyUrl: "https://1click.chaindefuser.com/v0/quote",
|
|
3087
3097
|
enableAutoTokensSwitching: !0,
|
|
3088
3098
|
showIntentTokens: !0,
|
|
@@ -3108,28 +3118,28 @@ const zo = new gr({
|
|
|
3108
3118
|
"gnosis",
|
|
3109
3119
|
"doge"
|
|
3110
3120
|
],
|
|
3111
|
-
filterTokens: (n) => !
|
|
3121
|
+
filterTokens: (n) => !Xo.includes(n.symbol.toLocaleLowerCase()),
|
|
3112
3122
|
chainsFilter: {
|
|
3113
3123
|
source: { external: "wallet-supported", intents: "with-balance" },
|
|
3114
3124
|
target: { external: "all", intents: "all" }
|
|
3115
3125
|
}
|
|
3116
|
-
},
|
|
3126
|
+
}, Gt = hr({
|
|
3117
3127
|
config: ke
|
|
3118
|
-
}), Je =
|
|
3128
|
+
}), Je = xt({
|
|
3119
3129
|
config: ke
|
|
3120
3130
|
}), M = () => {
|
|
3121
|
-
const n =
|
|
3131
|
+
const n = mr(Gt);
|
|
3122
3132
|
return Se(n).config;
|
|
3123
|
-
},
|
|
3133
|
+
}, es = (n) => {
|
|
3124
3134
|
Je.config = qe(n);
|
|
3125
|
-
},
|
|
3135
|
+
}, _a = ({
|
|
3126
3136
|
children: n,
|
|
3127
3137
|
config: o,
|
|
3128
3138
|
localisation: u,
|
|
3129
|
-
rpcs:
|
|
3139
|
+
rpcs: a
|
|
3130
3140
|
}) => {
|
|
3131
3141
|
const l = me(
|
|
3132
|
-
|
|
3142
|
+
xt({
|
|
3133
3143
|
config: qe({
|
|
3134
3144
|
...ke,
|
|
3135
3145
|
...o
|
|
@@ -3141,13 +3151,13 @@ const zo = new gr({
|
|
|
3141
3151
|
...ke,
|
|
3142
3152
|
...o
|
|
3143
3153
|
});
|
|
3144
|
-
Object.assign(l.current.config, f),
|
|
3145
|
-
}, [o]),
|
|
3146
|
-
/* @__PURE__ */ I(
|
|
3154
|
+
Object.assign(l.current.config, f), es(f);
|
|
3155
|
+
}, [o]), Vr(u ?? {}), Wr("headlessui-portal-root", "sw"), /* @__PURE__ */ I(Tr, { client: Zo, children: /* @__PURE__ */ I(Ar, { i18n: ur, children: /* @__PURE__ */ C(Gt.Provider, { value: l.current, children: [
|
|
3156
|
+
/* @__PURE__ */ I(Eo, { children: n }),
|
|
3147
3157
|
!!o?.walletAddress && /* @__PURE__ */ I(
|
|
3148
|
-
|
|
3158
|
+
No,
|
|
3149
3159
|
{
|
|
3150
|
-
rpcs:
|
|
3160
|
+
rpcs: a ?? Ln,
|
|
3151
3161
|
walletAddress: o.walletAddress
|
|
3152
3162
|
}
|
|
3153
3163
|
)
|
|
@@ -3155,66 +3165,66 @@ const zo = new gr({
|
|
|
3155
3165
|
};
|
|
3156
3166
|
export {
|
|
3157
3167
|
Ye as $,
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3168
|
+
to as A,
|
|
3169
|
+
No as B,
|
|
3170
|
+
ro as C,
|
|
3171
|
+
no as D,
|
|
3172
|
+
oo as E,
|
|
3173
|
+
co as F,
|
|
3174
|
+
uo as G,
|
|
3175
|
+
lo as H,
|
|
3176
|
+
fo as I,
|
|
3177
|
+
mo as J,
|
|
3178
|
+
ho as K,
|
|
3179
|
+
go as L,
|
|
3180
|
+
Pt as M,
|
|
3181
|
+
wo as N,
|
|
3182
|
+
Eo as O,
|
|
3183
|
+
ko as P,
|
|
3174
3184
|
H as Q,
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3185
|
+
Tt as R,
|
|
3186
|
+
Aa as S,
|
|
3187
|
+
Vo as T,
|
|
3188
|
+
Ro as U,
|
|
3189
|
+
Fo as V,
|
|
3190
|
+
_a as W,
|
|
3191
|
+
Lo as X,
|
|
3192
|
+
Oo as Y,
|
|
3193
|
+
Mo as Z,
|
|
3194
|
+
$o as _,
|
|
3195
|
+
Ia as a,
|
|
3196
|
+
Wt as a0,
|
|
3197
|
+
Qo as a1,
|
|
3198
|
+
Wo as a2,
|
|
3199
|
+
yt as a3,
|
|
3200
|
+
Vt as a4,
|
|
3201
|
+
Go as a5,
|
|
3202
|
+
jo as a6,
|
|
3193
3203
|
Je as a7,
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3204
|
+
O as b,
|
|
3205
|
+
Ta as c,
|
|
3206
|
+
bo as d,
|
|
3197
3207
|
Ne as e,
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3208
|
+
Do as f,
|
|
3209
|
+
po as g,
|
|
3210
|
+
qo as h,
|
|
3211
|
+
Bo as i,
|
|
3202
3212
|
_e as j,
|
|
3203
|
-
|
|
3213
|
+
Ko as k,
|
|
3204
3214
|
re as l,
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3215
|
+
Ea as m,
|
|
3216
|
+
ka as n,
|
|
3217
|
+
Sa as o,
|
|
3218
|
+
Qt as p,
|
|
3219
|
+
vt as q,
|
|
3220
|
+
Io as r,
|
|
3211
3221
|
te as s,
|
|
3212
|
-
|
|
3222
|
+
b as t,
|
|
3213
3223
|
we as u,
|
|
3214
|
-
|
|
3224
|
+
ya as v,
|
|
3215
3225
|
M as w,
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3226
|
+
Na as x,
|
|
3227
|
+
qt as y,
|
|
3228
|
+
eo as z
|
|
3219
3229
|
};
|
|
3220
|
-
//# sourceMappingURL=config-
|
|
3230
|
+
//# sourceMappingURL=config-DuYu3wzi.js.map
|