@aurora-is-near/intents-swap-widget 3.18.2 → 3.19.0

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