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

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 (140) hide show
  1. package/dist/components/Accordion.js +31 -32
  2. package/dist/components/Accordion.js.map +1 -1
  3. package/dist/components/Button.d.ts +8 -0
  4. package/dist/components/Button.js +53 -43
  5. package/dist/components/Button.js.map +1 -1
  6. package/dist/components/CopyButton.d.ts +5 -2
  7. package/dist/components/CopyButton.js +11 -7
  8. package/dist/components/CopyButton.js.map +1 -1
  9. package/dist/components/Notes.js +1 -1
  10. package/dist/components/Notes.js.map +1 -1
  11. package/dist/{config-CgCb5P7j.js → config-BMvXuF1-.js} +164 -165
  12. package/dist/{config-CgCb5P7j.js.map → config-BMvXuF1-.js.map} +1 -1
  13. package/dist/config.js +8 -9
  14. package/dist/config.js.map +1 -1
  15. package/dist/errors.js +1 -1
  16. package/dist/ext/alchemy/index.js +1 -1
  17. package/dist/ext/index.js +1 -1
  18. package/dist/features/BalanceRpcLoader/TokenBalanceLoader.js +1 -1
  19. package/dist/features/BalanceRpcLoader/index.js +1 -1
  20. package/dist/features/BalanceRpcLoader/useTokenBalanceRpc.js +1 -1
  21. package/dist/features/ChainsDropdown/index.js +1 -1
  22. package/dist/features/DepositMethodSwitcher.js +1 -1
  23. package/dist/features/ErrorBoundary.js +1 -1
  24. package/dist/features/ExternalDeposit.js +1 -1
  25. package/dist/features/SendAddress/index.js +1 -1
  26. package/dist/features/SendAddress/useNotification.js +1 -1
  27. package/dist/features/SubmitButton/index.js +1 -1
  28. package/dist/features/SuccessScreen/CopyableValue.d.ts +5 -0
  29. package/dist/features/SuccessScreen/CopyableValue.js +11 -0
  30. package/dist/features/SuccessScreen/CopyableValue.js.map +1 -0
  31. package/dist/features/SuccessScreen/TokenRow.d.ts +8 -0
  32. package/dist/features/SuccessScreen/TokenRow.js +20 -0
  33. package/dist/features/SuccessScreen/TokenRow.js.map +1 -0
  34. package/dist/features/SuccessScreen/index.d.ts +5 -4
  35. package/dist/features/SuccessScreen/index.js +151 -49
  36. package/dist/features/SuccessScreen/index.js.map +1 -1
  37. package/dist/features/SuccessScreen/useSummaryItemsCount.d.ts +1 -0
  38. package/dist/features/SuccessScreen/useSummaryItemsCount.js +14 -0
  39. package/dist/features/SuccessScreen/useSummaryItemsCount.js.map +1 -0
  40. package/dist/features/SwapDirectionSwitcher.js +1 -1
  41. package/dist/features/SwapQuote/SwapQuote.js +1 -1
  42. package/dist/features/SwapQuote/index.js +1 -1
  43. package/dist/features/TokenInput/TokenInput.js +1 -1
  44. package/dist/features/TokenInput/TokenInputEmpty.js +1 -1
  45. package/dist/features/TokenInput/TokenInputSource.js +1 -1
  46. package/dist/features/TokenInput/TokenInputTarget.js +2 -2
  47. package/dist/features/TokenInput/WalletBalance.js +1 -1
  48. package/dist/features/TokenInput/hooks/index.js +1 -1
  49. package/dist/features/TokenInput/hooks/useTokenInputBalance.js +1 -1
  50. package/dist/features/TokenInput/index.js +1 -1
  51. package/dist/features/TokensList/TokenItem.js +2 -2
  52. package/dist/features/TokensList/TokensList.js +1 -1
  53. package/dist/features/TokensList/index.js +1 -1
  54. package/dist/features/TokensModal.js +1 -1
  55. package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js +1 -1
  56. package/dist/features/WalletCompatibilityCheck/index.js +1 -1
  57. package/dist/features/index.js +1 -1
  58. package/dist/hooks/index.js +1 -1
  59. package/dist/hooks/useAllTokens.js +1 -1
  60. package/dist/hooks/useChains.js +1 -1
  61. package/dist/hooks/useCompatibilityCheck.js +1 -1
  62. package/dist/hooks/useDefaultToken.js +1 -1
  63. package/dist/hooks/useExternalDepositStatus/index.js +1 -1
  64. package/dist/hooks/useExternalDepositStatus/usePoaExternalDepositStatus.js +1 -1
  65. package/dist/hooks/useIntentsBalance.js +1 -1
  66. package/dist/hooks/useIsCompatibilityCheckRequired.js +1 -1
  67. package/dist/hooks/useMakeDepositAddress.js +1 -1
  68. package/dist/hooks/useMakeIntentsTransfer.js +1 -1
  69. package/dist/hooks/useMakeNEARFtTransferCall.js +1 -1
  70. package/dist/hooks/useMakeQuote.js +1 -1
  71. package/dist/hooks/useMakeQuoteTransfer.js +1 -1
  72. package/dist/hooks/useMakeTransfer.js +1 -1
  73. package/dist/hooks/useMergedBalance.js +1 -1
  74. package/dist/hooks/useSwitchChain.js +1 -1
  75. package/dist/hooks/useTheme.js +1 -1
  76. package/dist/hooks/useTokenInputPair.js +1 -1
  77. package/dist/hooks/useTokens.js +1 -1
  78. package/dist/hooks/useTokensFiltered.js +1 -1
  79. package/dist/hooks/useTokensIntentsUnique.js +1 -1
  80. package/dist/index.js +1 -1
  81. package/dist/machine/effects/index.js +1 -1
  82. package/dist/machine/effects/useAlchemyBalanceEffect.js +1 -1
  83. package/dist/machine/effects/useBalancesUpdateEffect.js +1 -1
  84. package/dist/machine/effects/useMakeQuoteEffect.js +1 -1
  85. package/dist/machine/effects/useSelectedTokensEffect.js +1 -1
  86. package/dist/machine/effects/useSetTokenBalanceEffect.js +1 -1
  87. package/dist/machine/effects/useSetTokenIntentsTargetEffect.js +1 -1
  88. package/dist/machine/effects/useWalletConnEffect.js +1 -1
  89. package/dist/machine/events/index.js +1 -1
  90. package/dist/machine/events/reset.d.ts +1 -0
  91. package/dist/machine/events/reset.js +2 -2
  92. package/dist/machine/events/reset.js.map +1 -1
  93. package/dist/machine/events/tokenSelect.js +1 -1
  94. package/dist/machine/events/validateInputAndMoveTo.js +1 -1
  95. package/dist/machine/events/validateInputs.js +1 -1
  96. package/dist/machine/index.js +1 -1
  97. package/dist/machine/snap.js +1 -1
  98. package/dist/machine/subscriptions/checkers/isSendAddressAsConnected.js +1 -1
  99. package/dist/machine/subscriptions/index.js +1 -1
  100. package/dist/styles.css +1 -1
  101. package/dist/theme/ThemeProvider.js +1 -1
  102. package/dist/types/localisation.d.ts +1 -1
  103. package/dist/utils/intents/signers/near.js +1 -1
  104. package/dist/utils/intents/signers/privy.js +1 -1
  105. package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
  106. package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +73 -72
  107. package/dist/widgets/WidgetDeposit/WidgetDepositContent.js.map +1 -1
  108. package/dist/widgets/WidgetDeposit/WidgetDepositSkeleton.js +1 -1
  109. package/dist/widgets/WidgetSwap/WidgetSwapContent.js +69 -67
  110. package/dist/widgets/WidgetSwap/WidgetSwapContent.js.map +1 -1
  111. package/dist/widgets/WidgetSwap/WidgetSwapSkeleton.js +1 -1
  112. package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +63 -61
  113. package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js.map +1 -1
  114. package/dist/widgets/WidgetWithdraw/WidgetWithdrawSkeleton.js +1 -1
  115. package/package.json +1 -1
  116. package/src/components/Accordion.tsx +5 -6
  117. package/src/components/Button.tsx +17 -1
  118. package/src/components/CopyButton.tsx +12 -2
  119. package/src/components/Notes.tsx +1 -1
  120. package/src/features/SuccessScreen/CopyableValue.tsx +13 -0
  121. package/src/features/SuccessScreen/TokenRow.tsx +26 -0
  122. package/src/features/SuccessScreen/index.tsx +161 -55
  123. package/src/features/SuccessScreen/useSummaryItemsCount.ts +33 -0
  124. package/src/machine/events/reset.ts +6 -3
  125. package/src/types/localisation.ts +10 -3
  126. package/src/widgets/WidgetDeposit/WidgetDepositContent.tsx +6 -4
  127. package/src/widgets/WidgetSwap/WidgetSwapContent.tsx +7 -4
  128. package/src/widgets/WidgetWithdraw/WidgetWithdrawContent.tsx +7 -4
  129. package/dist/features/SuccessScreen/CheckIcon.d.ts +0 -1
  130. package/dist/features/SuccessScreen/CheckIcon.js +0 -7
  131. package/dist/features/SuccessScreen/CheckIcon.js.map +0 -1
  132. package/dist/features/SuccessScreen/ExternalAction.d.ts +0 -5
  133. package/dist/features/SuccessScreen/ExternalAction.js +0 -16
  134. package/dist/features/SuccessScreen/ExternalAction.js.map +0 -1
  135. package/dist/features/SuccessScreen/SummaryItem.d.ts +0 -8
  136. package/dist/features/SuccessScreen/SummaryItem.js +0 -21
  137. package/dist/features/SuccessScreen/SummaryItem.js.map +0 -1
  138. package/src/features/SuccessScreen/CheckIcon.tsx +0 -7
  139. package/src/features/SuccessScreen/ExternalAction.tsx +0 -15
  140. package/src/features/SuccessScreen/SummaryItem.tsx +0 -28
@@ -113,12 +113,15 @@ import { queryContract as ur } from "./utils/near/queryContract.js";
113
113
  import { utils as Xe } from "@defuse-protocol/internal-utils";
114
114
  import { getTransactionLink as mr } from "./utils/formatters/getTransactionLink.js";
115
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";
116
+ import "@material-symbols-svg/react-rounded/w700";
118
117
  import "copy-text-to-clipboard";
119
118
  import "@material-symbols-svg/react-rounded/icons/content-copy";
120
- import { SwapQuoteSkeleton as bt } from "./features/SwapQuote/SwapQuoteSkeleton.js";
121
119
  import { Notes as he } from "./components/Notes.js";
120
+ import "@material-symbols-svg/react-rounded/icons/progress-activity";
121
+ import "bs58";
122
+ import "viem/chains";
123
+ import "browser-or-node";
124
+ import { SwapQuoteSkeleton as bt } from "./features/SwapQuote/SwapQuoteSkeleton.js";
122
125
  import { Accordion as pr } from "./components/Accordion.js";
123
126
  import { formatUsdAmount as Ze } from "./utils/formatters/formatUsdAmount.js";
124
127
  import { formatTinyNumber as Tr } from "./utils/formatters/formatTinyNumber.js";
@@ -150,11 +153,7 @@ import { createFilterByIntents as et } from "./utils/tokens/filterByIntents.js";
150
153
  import { createFilterBySearch as qr } from "./utils/tokens/filterBySearchString.js";
151
154
  import { createFilterBySelectedChain as Ur } from "./utils/tokens/filterBySelectedChain.js";
152
155
  import "@material-symbols-svg/react-rounded/icons/search";
153
- import "bs58";
154
- import "viem/chains";
155
- import "browser-or-node";
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
159
  import { CheckCircleFillW700 as Pr } from "@material-symbols-svg/react-rounded/icons/check-circle";
@@ -1070,9 +1069,9 @@ const ds = (e) => {
1070
1069
  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
1070
  }, bs = Tn(({ debug: e }) => {
1072
1071
  e && E.debug(
1073
- "[WIDGET] Debug mode is enabled (package version: 3.18.2)"
1072
+ "[WIDGET] Debug mode is enabled (package version: 3.18.3)"
1074
1073
  ), ys(), Ns({ debug: e }), Ss({ debug: e });
1075
- }), vl = ({ listenTo: e, debug: t = !1 }) => {
1074
+ }), Dl = ({ listenTo: e, debug: t = !1 }) => {
1076
1075
  R(() => {
1077
1076
  bs({ debug: t });
1078
1077
  }, [t]);
@@ -1129,7 +1128,7 @@ class g extends qt {
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({
1131
+ const vl = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e && !!e._is_widget_error, Q = J.getStore(), Rs = mn({
1133
1132
  usdTradeDelta: (e) => Gn(e(Q.context)),
1134
1133
  isDirectNearTokenWithdrawal: (e) => Yn(e(Q.context)),
1135
1134
  isDirectNonNearWithdrawal: (e) => jn(e(Q.context)),
@@ -1143,7 +1142,7 @@ const xl = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e
1143
1142
  state: e.state,
1144
1143
  ctx: e.context
1145
1144
  };
1146
- }, Ol = (e) => {
1145
+ }, xl = (e) => {
1147
1146
  const t = me(Q);
1148
1147
  if (!x(t.context, [e]))
1149
1148
  throw new M(
@@ -1929,7 +1928,128 @@ const Os = ({
1929
1928
  return t.walletAddress ? /* @__PURE__ */ o(Qs, { ...e }) : /* @__PURE__ */ o(Ws, { onClick: s.onWalletSignin });
1930
1929
  };
1931
1930
  $s.Error = Vs;
1932
- const Ks = ({ className: e }) => {
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
+ ], Ks = () => {
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
+ }, Hs = ({
1955
+ variant: e,
1956
+ search: t,
1957
+ selectedChain: s,
1958
+ chainsFilter: r,
1959
+ walletSupportedChains: n
1960
+ }) => {
1961
+ ds(e);
1962
+ const { tokens: a } = V(e), { mergedBalance: c } = Te(), { intentBalances: l } = pe(), { uniqueIntentsTokens: d } = Ks(), u = Br(
1963
+ c,
1964
+ n,
1965
+ t
1966
+ ), i = a.filter(qr({ search: t })).filter(
1967
+ Ur({
1968
+ selectedChain: s,
1969
+ chainsFilter: r,
1970
+ walletSupportedChains: n,
1971
+ intentBalances: l,
1972
+ uniqueIntentTokenIds: d.map((f) => f.assetId)
1973
+ })
1974
+ );
1975
+ return {
1976
+ all: i.sort(u),
1977
+ intents: i.filter(et({ isIntent: !0 })).sort(u),
1978
+ wallet: i.filter(et({ isIntent: !1 })).sort(u)
1979
+ };
1980
+ }, Gs = (e, t) => {
1981
+ const s = t.assetId.substring(t.assetId.indexOf(":") + 1), r = (a) => {
1982
+ const c = (u) => u.replace(/(\.\d*?[1-9])0+$/, "$1").replace(/\.0+$/, ""), l = c(t.amount), d = c(
1983
+ a.amount.toLocaleString("en-US", {
1984
+ useGrouping: !1,
1985
+ maximumFractionDigits: 20
1986
+ })
1987
+ );
1988
+ return l.startsWith(d) || d.startsWith(l);
1989
+ }, n = (a) => new Date(a.created_at) >= new Date(t.initiatedAtDate);
1990
+ return (e.result.deposits || []).find(
1991
+ (a) => a.chain === t.chainId && a.account_id === t.intentsAccountId && a.address === t.depositAddress && a.near_token_id === s && n(a) && r(a)
1992
+ );
1993
+ }, js = {
1994
+ CREDITED: ee.status.PROCESSING,
1995
+ PENDING: ee.status.PROCESSING,
1996
+ COMPLETED: ee.status.SUCCESS,
1997
+ FAILED: ee.status.FAILED
1998
+ }, Ol = ({ depositAddress: e }) => {
1999
+ const { ctx: t } = _(), { intentsAccountType: s } = b(), [r, n] = te(null), a = ne({
2000
+ addressType: s,
2001
+ walletAddress: t.walletAddress
2002
+ });
2003
+ return { pollDepositStatus: async ({
2004
+ blockchain: l,
2005
+ amount: d,
2006
+ assetId: u
2007
+ }) => {
2008
+ if (!a)
2009
+ throw new M("Unknown intents account for POA deposit check");
2010
+ let i = Tt[l];
2011
+ if (!i)
2012
+ if (H(l))
2013
+ i = ht;
2014
+ else
2015
+ throw new M(
2016
+ `Unknown chain for POA deposit check ${l}`
2017
+ );
2018
+ const f = r ?? (/* @__PURE__ */ new Date()).toUTCString();
2019
+ r || n(f);
2020
+ const p = await kt.post("", {
2021
+ id: 1,
2022
+ jsonrpc: "2.0",
2023
+ method: "recent_deposits",
2024
+ params: [
2025
+ {
2026
+ account_id: a,
2027
+ chain: i
2028
+ }
2029
+ ]
2030
+ }), I = Gs(p.data, {
2031
+ intentsAccountId: a,
2032
+ initiatedAtDate: f,
2033
+ depositAddress: e,
2034
+ chainId: i,
2035
+ assetId: u,
2036
+ amount: d
2037
+ });
2038
+ return I ? {
2039
+ status: js[I.status],
2040
+ swapDetails: {
2041
+ intentHashes: [""],
2042
+ destinationChainTxHashes: [{ hash: I.tx_hash ?? "" }]
2043
+ }
2044
+ } : {
2045
+ status: ee.status.PENDING_DEPOSIT,
2046
+ swapDetails: {
2047
+ destinationChainTxHashes: [{ hash: "" }],
2048
+ intentHashes: [""]
2049
+ }
2050
+ };
2051
+ } };
2052
+ }, zs = ({ className: e }) => {
1933
2053
  const { t } = $(), { slippageTolerance: s } = b(), { ctx: r } = _(), n = r.sourceToken && r.targetToken && r.sourceToken.price / r.targetToken.price;
1934
2054
  return r.sourceToken ? /* @__PURE__ */ o(
1935
2055
  pr,
@@ -1971,9 +2091,9 @@ const Ks = ({ className: e }) => {
1971
2091
  ] })
1972
2092
  }
1973
2093
  ) : /* @__PURE__ */ o(bt, {});
1974
- }, Fl = Object.assign(Ks, {
2094
+ }, Fl = Object.assign(zs, {
1975
2095
  Skeleton: bt
1976
- }), Hs = ({
2096
+ }), Ys = ({
1977
2097
  token: e,
1978
2098
  balance: t,
1979
2099
  isNotSufficient: s = !1,
@@ -2086,7 +2206,7 @@ const Ks = ({ className: e }) => {
2086
2206
  ] }),
2087
2207
  /* @__PURE__ */ h("div", { className: "gap-sw-sm flex items-center", children: [
2088
2208
  e && !!f.walletAddress && c && /* @__PURE__ */ o(
2089
- Hs,
2209
+ Ys,
2090
2210
  {
2091
2211
  token: e,
2092
2212
  balance: t,
@@ -2186,7 +2306,7 @@ const Ks = ({ className: e }) => {
2186
2306
  const n = r.length === 1 ? s[0] : null;
2187
2307
  n && t({ type: "on_select_token", token: n });
2188
2308
  }, [s]);
2189
- }, Gs = ({
2309
+ }, Xs = ({
2190
2310
  onMsg: e,
2191
2311
  isChanging: t = !0,
2192
2312
  showBalance: s = !0,
@@ -2217,7 +2337,7 @@ const Ks = ({ className: e }) => {
2217
2337
  onMsg: e
2218
2338
  }
2219
2339
  ) : /* @__PURE__ */ o(We, { heading: r, onMsg: e });
2220
- }, js = ({
2340
+ }, Zs = ({
2221
2341
  isChanging: e = !1,
2222
2342
  onMsg: t,
2223
2343
  heading: s
@@ -2240,10 +2360,10 @@ const Ks = ({ className: e }) => {
2240
2360
  onMsg: t
2241
2361
  }
2242
2362
  ) : /* @__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, {
2363
+ }, Js = ({ 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(Js, {
2244
2364
  Skeleton: Sr,
2245
- Source: Gs,
2246
- Target: js
2365
+ Source: Xs,
2366
+ Target: Zs
2247
2367
  }), Wt = ({
2248
2368
  token: e,
2249
2369
  balance: t,
@@ -2304,56 +2424,7 @@ const Ks = ({ className: e }) => {
2304
2424
  ]
2305
2425
  }
2306
2426
  ) });
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 = ({
2427
+ }, ea = ({
2357
2428
  variant: e,
2358
2429
  search: t,
2359
2430
  className: s,
@@ -2364,7 +2435,7 @@ const Ks = ({ className: e }) => {
2364
2435
  chainIsNotSupported: l,
2365
2436
  onMsg: d
2366
2437
  }) => {
2367
- const { t: u } = $(), { ctx: i } = _(), { walletSupportedChains: f, appName: p } = b(), { mergedBalance: I } = Te(), m = Xs({
2438
+ const { t: u } = $(), { ctx: i } = _(), { walletSupportedChains: f, appName: p } = b(), { mergedBalance: I } = Te(), m = Hs({
2368
2439
  variant: e,
2369
2440
  search: t,
2370
2441
  chainsFilter: a,
@@ -2507,82 +2578,10 @@ const Ks = ({ className: e }) => {
2507
2578
  }
2508
2579
  );
2509
2580
  }
2510
- }, Bl = Object.assign(Zs, {
2581
+ }, Bl = Object.assign(ea, {
2511
2582
  Placeholder: be,
2512
2583
  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) => {
2584
+ }), ie = (e, t, s) => {
2586
2585
  let r = document.body;
2587
2586
  s instanceof HTMLElement && (r = s), r.style.setProperty(`--c-sw-${e}`, t);
2588
2587
  }, ta = (e, t, s) => {
@@ -2788,7 +2787,7 @@ const Ks = ({ className: e }) => {
2788
2787
  )
2789
2788
  ] })
2790
2789
  ] });
2791
- }, Ul = Object.assign(aa, {
2790
+ }, ql = Object.assign(aa, {
2792
2791
  Error: oa
2793
2792
  }), ia = (e) => null, la = (e) => (t) => {
2794
2793
  if (t instanceof M)
@@ -2839,7 +2838,7 @@ const Ks = ({ className: e }) => {
2839
2838
  return me(e).config;
2840
2839
  }, ma = (e) => {
2841
2840
  Ve.config = ke(e);
2842
- }, Pl = ({
2841
+ }, Ul = ({
2843
2842
  children: e,
2844
2843
  config: t,
2845
2844
  balanceViaRpc: s = !0,
@@ -2881,7 +2880,7 @@ const Ks = ({ className: e }) => {
2881
2880
  };
2882
2881
  export {
2883
2882
  Cs as $,
2884
- ql as A,
2883
+ Ol as A,
2885
2884
  ls as B,
2886
2885
  ra as C,
2887
2886
  ts as D,
@@ -2900,35 +2899,35 @@ export {
2900
2899
  U as Q,
2901
2900
  ws as R,
2902
2901
  $s as S,
2903
- zs as T,
2902
+ Js as T,
2904
2903
  ks as U,
2905
2904
  As as V,
2906
- Pl as W,
2905
+ Ul as W,
2907
2906
  Ss as X,
2908
2907
  Ns as Y,
2909
2908
  _s as Z,
2910
2909
  ys as _,
2911
- Ol as a,
2910
+ xl as a,
2912
2911
  Ds as a0,
2913
2912
  xs as a1,
2914
2913
  Os as a2,
2915
2914
  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,
2915
+ zs as a4,
2916
+ Ys as a5,
2917
+ Pe as a6,
2918
+ We as a7,
2919
+ Pt as a8,
2920
+ Xs as a9,
2921
+ Zs as aa,
2922
+ Wt as ab,
2923
+ ea as ac,
2925
2924
  sa as ad,
2926
2925
  aa as ae,
2927
2926
  oa as af,
2928
2927
  ca as ag,
2929
2928
  Ve as ah,
2930
2929
  _ as b,
2931
- vl as c,
2930
+ Dl as c,
2932
2931
  ds as d,
2933
2932
  os as e,
2934
2933
  pe as f,
@@ -2938,7 +2937,7 @@ export {
2938
2937
  vs as j,
2939
2938
  Te as k,
2940
2939
  Ps as l,
2941
- Xs as m,
2940
+ Hs as m,
2942
2941
  V as n,
2943
2942
  Fl as o,
2944
2943
  Ll as p,
@@ -2949,8 +2948,8 @@ export {
2949
2948
  Z as u,
2950
2949
  M as v,
2951
2950
  g as w,
2952
- xl as x,
2951
+ vl as x,
2953
2952
  b as y,
2954
- Ul as z
2953
+ ql as z
2955
2954
  };
2956
- //# sourceMappingURL=config-CgCb5P7j.js.map
2955
+ //# sourceMappingURL=config-BMvXuF1-.js.map