@aurora-is-near/intents-swap-widget 3.17.1 → 3.17.2

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