@aurora-is-near/intents-swap-widget 3.22.0 → 3.24.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 (110) hide show
  1. package/dist/{config-Opy5ppbU.js → config-Bg5hUlJL.js} +183 -183
  2. package/dist/config-Bg5hUlJL.js.map +1 -0
  3. package/dist/config.d.ts +1 -10
  4. package/dist/config.js +1 -1
  5. package/dist/errors.js +1 -1
  6. package/dist/ext/alchemy/index.js +1 -1
  7. package/dist/ext/index.js +1 -1
  8. package/dist/features/BalanceRpcLoader/TokenBalanceLoader.js +1 -1
  9. package/dist/features/BalanceRpcLoader/index.js +1 -1
  10. package/dist/features/BalanceRpcLoader/useTokenBalanceRpc.js +1 -1
  11. package/dist/features/ChainsDropdown/index.js +1 -1
  12. package/dist/features/ChainsSelector/index.js +1 -1
  13. package/dist/features/DepositMethodSwitcher.js +1 -1
  14. package/dist/features/ErrorBoundary.js +1 -1
  15. package/dist/features/ExternalDeposit.js +1 -1
  16. package/dist/features/SendAddress/index.js +1 -1
  17. package/dist/features/SendAddress/useNotification.js +1 -1
  18. package/dist/features/SubmitButton/index.js +1 -1
  19. package/dist/features/SuccessScreen/index.js +1 -1
  20. package/dist/features/SuccessScreen/useSummaryItemsCount.js +1 -1
  21. package/dist/features/SwapDirectionSwitcher.js +1 -1
  22. package/dist/features/SwapQuote/SwapQuote.js +1 -1
  23. package/dist/features/SwapQuote/index.js +1 -1
  24. package/dist/features/TokenInput/TokenInput.js +1 -1
  25. package/dist/features/TokenInput/TokenInputEmpty.js +1 -1
  26. package/dist/features/TokenInput/TokenInputSource.js +1 -1
  27. package/dist/features/TokenInput/TokenInputTarget.js +1 -1
  28. package/dist/features/TokenInput/WalletBalance.js +1 -1
  29. package/dist/features/TokenInput/hooks/index.js +1 -1
  30. package/dist/features/TokenInput/hooks/useTokenInputBalance.js +1 -1
  31. package/dist/features/TokenInput/index.js +1 -1
  32. package/dist/features/TokensList/TokenItem.js +1 -1
  33. package/dist/features/TokensList/TokensList.js +1 -1
  34. package/dist/features/TokensList/index.js +1 -1
  35. package/dist/features/TokensModal.js +1 -1
  36. package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js +1 -1
  37. package/dist/features/WalletCompatibilityCheck/index.js +1 -1
  38. package/dist/features/index.js +1 -1
  39. package/dist/hooks/index.js +1 -1
  40. package/dist/hooks/useAllTokens.js +1 -1
  41. package/dist/hooks/useChains.js +1 -1
  42. package/dist/hooks/useCompatibilityCheck.js +1 -1
  43. package/dist/hooks/useDefaultToken.js +1 -1
  44. package/dist/hooks/useExternalDepositStatus/index.js +1 -1
  45. package/dist/hooks/useExternalDepositStatus/usePoaExternalDepositStatus.js +1 -1
  46. package/dist/hooks/useIntentsBalance.js +1 -1
  47. package/dist/hooks/useIsCompatibilityCheckRequired.js +1 -1
  48. package/dist/hooks/useMakeDepositAddress.js +1 -1
  49. package/dist/hooks/useMakeIntentsTransfer.js +1 -1
  50. package/dist/hooks/useMakeNEARFtTransferCall.js +1 -1
  51. package/dist/hooks/useMakeQuote.js +1 -1
  52. package/dist/hooks/useMakeQuoteTransfer.js +1 -1
  53. package/dist/hooks/useMakeTransfer.js +1 -1
  54. package/dist/hooks/useMergedBalance.js +1 -1
  55. package/dist/hooks/useSwitchChain.js +1 -1
  56. package/dist/hooks/useTheme.js +1 -1
  57. package/dist/hooks/useTokenInputPair.js +1 -1
  58. package/dist/hooks/useTokens.js +1 -1
  59. package/dist/hooks/useTokensFiltered.js +1 -1
  60. package/dist/hooks/useTokensIntentsUnique.js +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/machine/effects/index.js +1 -1
  63. package/dist/machine/effects/useAlchemyBalanceEffect.js +1 -1
  64. package/dist/machine/effects/useBalancesUpdateEffect.js +1 -1
  65. package/dist/machine/effects/useMakeQuoteEffect.js +1 -1
  66. package/dist/machine/effects/useSelectedTokensEffect.js +1 -1
  67. package/dist/machine/effects/useSetTokenBalanceEffect.js +1 -1
  68. package/dist/machine/effects/useSetTokenIntentsTargetEffect.js +1 -1
  69. package/dist/machine/effects/useWalletConnEffect.js +1 -1
  70. package/dist/machine/events/index.js +1 -1
  71. package/dist/machine/events/tokenSelect.js +1 -1
  72. package/dist/machine/events/validateInputAndMoveTo.js +1 -1
  73. package/dist/machine/events/validateInputs.js +1 -1
  74. package/dist/machine/index.js +1 -1
  75. package/dist/machine/snap.js +1 -1
  76. package/dist/machine/subscriptions/checkers/isSendAddressAsConnected.js +1 -1
  77. package/dist/machine/subscriptions/index.js +1 -1
  78. package/dist/theme/ThemeProvider.js +1 -1
  79. package/dist/types/chain.d.ts +4 -0
  80. package/dist/types/config.d.ts +2 -5
  81. package/dist/types/widget.d.ts +1 -0
  82. package/dist/types/widget.js +2 -0
  83. package/dist/types/widget.js.map +1 -0
  84. package/dist/utils/intents/signers/near.js +1 -1
  85. package/dist/utils/intents/signers/privy.js +1 -1
  86. package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
  87. package/dist/widgets/Widget/WidgetContent.d.ts +6 -4
  88. package/dist/widgets/Widget/WidgetContent.js +30 -24
  89. package/dist/widgets/Widget/WidgetContent.js.map +1 -1
  90. package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +65 -63
  91. package/dist/widgets/WidgetDeposit/WidgetDepositContent.js.map +1 -1
  92. package/dist/widgets/WidgetDeposit/WidgetDepositSkeleton.js +1 -1
  93. package/dist/widgets/WidgetSwap/WidgetSwapContent.js +59 -53
  94. package/dist/widgets/WidgetSwap/WidgetSwapContent.js.map +1 -1
  95. package/dist/widgets/WidgetSwap/WidgetSwapSkeleton.js +1 -1
  96. package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +79 -77
  97. package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js.map +1 -1
  98. package/dist/widgets/WidgetWithdraw/WidgetWithdrawSkeleton.js +1 -1
  99. package/package.json +1 -1
  100. package/src/config.tsx +0 -5
  101. package/src/machine/effects/useSelectedTokensEffect.ts +7 -4
  102. package/src/types/chain.ts +5 -0
  103. package/src/types/config.ts +3 -4
  104. package/src/types/widget.ts +1 -0
  105. package/src/widgets/Widget/WidgetContent.tsx +19 -7
  106. package/src/widgets/WidgetDeposit/WidgetDeposit.test.tsx +0 -4
  107. package/src/widgets/WidgetDeposit/WidgetDepositContent.tsx +7 -3
  108. package/src/widgets/WidgetSwap/WidgetSwapContent.tsx +19 -4
  109. package/src/widgets/WidgetWithdraw/WidgetWithdrawContent.tsx +5 -3
  110. package/dist/config-Opy5ppbU.js.map +0 -1
@@ -4,13 +4,13 @@ import jt from "i18next";
4
4
  import { deepClone as Se } from "valtio/utils";
5
5
  import { snapshot as Re, useSnapshot as fe, proxy as ut } from "valtio";
6
6
  import { HelmetProvider as zt, Helmet as Yt } from "react-helmet-async";
7
- import { memo as Xt, useEffect as C, useMemo as L, useRef as Z, useCallback as ce, useState as re, useId as Zt, createContext as mt, useContext as Jt } from "react";
7
+ import { memo as Xt, useEffect as C, useMemo as L, useRef as Z, useCallback as le, useState as re, useId as Zt, createContext as mt, useContext as Jt } from "react";
8
8
  import { useQuery as ve, useInfiniteQuery as en, useQueryClient as tn, QueryClient as nn, QueryClientProvider as rn } from "@tanstack/react-query";
9
9
  import { Trans as sn, I18nextProvider as an } from "react-i18next";
10
10
  import { useTypedTranslation as K, initLocalisation as on } from "./localisation.js";
11
11
  import { logger as E } from "./logger.js";
12
- import { getTonTokenBalance as ln } from "./utils/ton/getTonTokenBalance.js";
13
- import { getSolanaTokenBalance as cn } from "./utils/solana/getSolanaTokenBalance.js";
12
+ import { getTonTokenBalance as cn } from "./utils/ton/getTonTokenBalance.js";
13
+ import { getSolanaTokenBalance as ln } from "./utils/solana/getSolanaTokenBalance.js";
14
14
  import { useWalletAddressForToken as ft } from "./hooks/useWalletAddressForToken.js";
15
15
  import "@headlessui/react";
16
16
  import "@material-symbols-svg/react-rounded/icons/chevron-left";
@@ -104,7 +104,7 @@ import { INTENTS_CONTRACT as Ee } from "./constants/intents.js";
104
104
  import { isEvmBaseToken as bt } from "./utils/evm/isEvmBaseToken.js";
105
105
  import { useMakeEvmTransfer as rr } from "./hooks/useMakeEvmTransfer.js";
106
106
  import { useMakeSolanaTransfer as sr } from "./hooks/useMakeSolanaTransfer.js";
107
- import { createIntentSignerNEP413 as ar, IntentsSDK as or, createNearWithdrawalRoute as ir, createInternalTransferRoute as lr, MinWithdrawalAmountError as cr, FeeExceedsAmountError as dr } from "@defuse-protocol/intents-sdk";
107
+ import { createIntentSignerNEP413 as ar, IntentsSDK as or, createNearWithdrawalRoute as ir, createInternalTransferRoute as cr, MinWithdrawalAmountError as lr, FeeExceedsAmountError as dr } from "@defuse-protocol/intents-sdk";
108
108
  import { generateRandomBytes as ur } from "./utils/near/getRandomBytes.js";
109
109
  import { IntentSignerSolana as mr } from "./utils/intents/signers/solana.js";
110
110
  import { localStorageTyped as Ze } from "./utils/localstorage.js";
@@ -177,27 +177,27 @@ import { getNativeNearBalance as es } from "./utils/near/getNativeNearBalance.js
177
177
  import { getNearTokenBalance as ts } from "./utils/near/getNearTokenBalance.js";
178
178
  import { getEvmTokenBalance as ns } from "./utils/evm/getEvmTokenBalance.js";
179
179
  function rs({ rpcs: e, token: t, connectedWallets: s }) {
180
- const { walletSupportedChains: r, tonCenterApiKey: n, alchemyApiKey: a } = y(), { walletAddress: c } = ft(s, t);
180
+ const { walletSupportedChains: r, tonCenterApiKey: n, alchemyApiKey: a } = y(), { walletAddress: l } = ft(s, t);
181
181
  return ve({
182
182
  retry: 2,
183
- enabled: !!c && Object.keys(e).includes(t.blockchain),
183
+ enabled: !!l && Object.keys(e).includes(t.blockchain),
184
184
  queryKey: ["tokenBalance", t.assetId, s],
185
185
  queryFn: async () => {
186
- if (!c)
186
+ if (!l)
187
187
  return null;
188
188
  if (t.blockchain === "near" && r.includes(t.blockchain))
189
- return !e.near || e.near.length === 0 ? null : t.assetId === j ? es(c, e.near) : ts(t, c, e.near);
189
+ return !e.near || e.near.length === 0 ? null : t.assetId === j ? es(l, e.near) : ts(t, l, e.near);
190
190
  if (!r.includes("eth") && G(t.blockchain))
191
191
  return null;
192
192
  if (G(t.blockchain) && bt(t)) {
193
- const l = e[t.blockchain] ?? [];
194
- return l.length > 0 ? Jr(c, l[0]) : null;
193
+ const c = e[t.blockchain] ?? [];
194
+ return c.length > 0 ? Jr(l, c[0]) : null;
195
195
  }
196
196
  if (Zr(t) || G(t.blockchain)) {
197
- const l = e[t.blockchain] ?? [];
198
- return l.length > 0 ? ns(t, c, l[0]) : null;
197
+ const c = e[t.blockchain] ?? [];
198
+ return c.length > 0 ? ns(t, l, c[0]) : null;
199
199
  }
200
- return t.blockchain === "ton" ? ln(t, c, n) : t.blockchain === "sol" && r.includes(t.blockchain) ? cn(t, c, a) : (E.warn(
200
+ return t.blockchain === "ton" ? cn(t, l, n) : t.blockchain === "sol" && r.includes(t.blockchain) ? ln(t, l, a) : (E.warn(
201
201
  `Failed to fetch token balance for ${t.symbol} on ${t.blockchain}`
202
202
  ), null);
203
203
  }
@@ -235,11 +235,11 @@ const rt = Object.assign(xt, {
235
235
  allowedSourceTokensList: r,
236
236
  allowedTargetTokensList: n,
237
237
  filterTokens: a,
238
- fetchSourceTokens: c,
239
- fetchTargetTokens: l
238
+ fetchSourceTokens: l,
239
+ fetchTargetTokens: c
240
240
  } = y(), { data: d, ...u } = ve({
241
241
  queryKey: ["tokens", e].filter(Boolean),
242
- queryFn: async () => e === "source" && c ? c() : e === "target" && l ? l() : dn.getTokens()
242
+ queryFn: async () => e === "source" && l ? l() : e === "target" && c ? c() : dn.getTokens()
243
243
  }), i = L(() => {
244
244
  if (!d)
245
245
  return [];
@@ -283,7 +283,7 @@ const rt = Object.assign(xt, {
283
283
  ...u,
284
284
  tokens: i
285
285
  };
286
- }, ls = () => {
286
+ }, cs = () => {
287
287
  const { tokens: e } = V(), { tokens: t } = V("source"), { tokens: s } = V("target");
288
288
  return { tokens: L(() => {
289
289
  const n = {};
@@ -292,8 +292,8 @@ const rt = Object.assign(xt, {
292
292
  ...t || [],
293
293
  ...s || []
294
294
  ].forEach((a) => {
295
- const c = `${a.assetId}-${a.isIntent}`;
296
- n[c] = a;
295
+ const l = `${a.assetId}-${a.isIntent}`;
296
+ n[l] = a;
297
297
  }), Object.values(n);
298
298
  }, [e, t, s]) };
299
299
  }, Ie = [
@@ -301,7 +301,7 @@ const rt = Object.assign(xt, {
301
301
  { near: ["USDT", "USDC", "AURORA"] },
302
302
  { arb: ["ARB", "ETH", "USDT", "USDC"] },
303
303
  { btc: ["BTC"] }
304
- ], cs = (e) => [...e].sort((t, s) => {
304
+ ], ls = (e) => [...e].sort((t, s) => {
305
305
  const r = Ie.findIndex(
306
306
  (d) => Object.keys(d)[0] === t.blockchain
307
307
  ), n = Ie.findIndex(
@@ -309,27 +309,27 @@ const rt = Object.assign(xt, {
309
309
  );
310
310
  if (r !== n)
311
311
  return r === -1 ? 1 : n === -1 ? -1 : r - n;
312
- const a = Ie[r]?.[t.blockchain] ?? [], c = a.indexOf(t.symbol), l = a.indexOf(s.symbol);
313
- return c === -1 && l === -1 ? 0 : c === -1 ? 1 : l === -1 ? -1 : c - l;
312
+ const a = Ie[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;
314
314
  }), ds = ({ rpcs: e, connectedWallets: t }) => {
315
- const { tokens: s } = ls(), { walletSupportedChains: r } = y(), { setWalletBalance: n } = xe(t);
316
- return L(() => cs(s), [s]).map((c) => r.includes(c.blockchain) ? /* @__PURE__ */ o(
315
+ const { tokens: s } = cs(), { walletSupportedChains: r } = y(), { setWalletBalance: n } = xe(t);
316
+ return L(() => ls(s), [s]).map((l) => r.includes(l.blockchain) ? /* @__PURE__ */ o(
317
317
  rt,
318
318
  {
319
319
  rpcs: e,
320
- token: c,
320
+ token: l,
321
321
  connectedWallets: t,
322
- onBalancesLoaded: (l) => n(t, l)
322
+ onBalancesLoaded: (c) => n(t, c)
323
323
  },
324
- Y(c)
324
+ Y(l)
325
325
  ) : /* @__PURE__ */ o(
326
326
  rt.Zero,
327
327
  {
328
328
  rpcs: e,
329
- token: c,
330
- onBalancesLoaded: (l) => n(t, l)
329
+ token: l,
330
+ onBalancesLoaded: (c) => n(t, c)
331
331
  },
332
- Y(c)
332
+ Y(l)
333
333
  ));
334
334
  };
335
335
  function us(e, t) {
@@ -337,8 +337,8 @@ function us(e, t) {
337
337
  /* @__PURE__ */ new Set([...t ?? [], ...ht])
338
338
  ), r = new Map(s.map((n, a) => [n, a]));
339
339
  return [...e].sort((n, a) => {
340
- const c = r.has(n.id) ? r.get(n.id) : 1 / 0, l = r.has(a.id) ? r.get(a.id) : 1 / 0;
341
- 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" });
342
342
  });
343
343
  }
344
344
  const ms = (e) => {
@@ -349,19 +349,19 @@ const ms = (e) => {
349
349
  allowedTargetChainsList: n
350
350
  } = y(), { tokens: a } = V();
351
351
  return L(() => {
352
- const c = Array.from(
353
- new Set(a.map((l) => pt[l.blockchain]))
354
- ).filter((l) => !(s && !s.includes(l.id) || e === "source" && r && !r.includes(l.id) || e === "target" && n && !n.includes(l.id)));
355
- return us(c, t);
352
+ const l = Array.from(
353
+ new Set(a.map((c) => pt[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 us(l, t);
356
356
  }, [a, t, s]);
357
357
  }, st = 3, Ot = ({
358
358
  connectedWallets: e,
359
359
  alchemyApiKey: t,
360
360
  ...s
361
361
  }) => {
362
- const { ctx: r } = _(), { tokens: n } = V(), { walletSupportedChains: a } = y(), { setWalletBalance: c } = xe(e), l = s.isEnabled && !!Object.values(e).length && a.length > 0, d = en({
362
+ const { ctx: r } = _(), { tokens: n } = V(), { walletSupportedChains: a } = y(), { setWalletBalance: l } = xe(e), c = s.isEnabled && !!Object.values(e).length && a.length > 0, d = en({
363
363
  initialPageParam: null,
364
- enabled: !!l && !!t,
364
+ enabled: !!c && !!t,
365
365
  queryKey: ["walletTokensBalance", e],
366
366
  queryFn: async ({ pageParam: i }) => wn({ alchemyApiKey: t })({
367
367
  pageParam: i ? `${i}` : null,
@@ -374,8 +374,8 @@ const ms = (e) => {
374
374
  }
375
375
  });
376
376
  C(() => {
377
- l && d.data && d.hasNextPage && d.data.pages.length < st && !d.isFetchingNextPage && d.fetchNextPage();
378
- }, [l, d]);
377
+ c && d.data && d.hasNextPage && d.data.pages.length < st && !d.isFetchingNextPage && d.fetchNextPage();
378
+ }, [c, d]);
379
379
  const u = L(() => {
380
380
  if (!d.data?.pages)
381
381
  return {};
@@ -388,7 +388,7 @@ const ms = (e) => {
388
388
  }), i;
389
389
  }, [d.data, n]);
390
390
  return C(() => {
391
- O(r, ["initial_wallet"]) && (c(e, u), r.sourceToken && Object.keys(u).includes(r.sourceToken.assetId) && h("tokenSetBalance", u[r.sourceToken.assetId]));
391
+ O(r, ["initial_wallet"]) && (l(e, u), r.sourceToken && Object.keys(u).includes(r.sourceToken.assetId) && h("tokenSetBalance", u[r.sourceToken.assetId]));
392
392
  }, [u]), {
393
393
  status: d.status,
394
394
  refetch: d.refetch,
@@ -397,21 +397,21 @@ const ms = (e) => {
397
397
  }, he = () => {
398
398
  const { intentsAccountType: e } = y(), {
399
399
  ctx: { walletAddress: t }
400
- } = _(), { tokens: s } = V(), r = s.filter((l) => l.isIntent).map((l) => l.assetId), n = se({
400
+ } = _(), { tokens: s } = V(), r = s.filter((c) => c.isIntent).map((c) => c.assetId), n = se({
401
401
  walletAddress: t,
402
402
  addressType: e
403
403
  }), a = ve({
404
404
  enabled: !!t && !!n && s.length > 0,
405
405
  queryKey: ["intentsBalances", n],
406
406
  queryFn: async () => n ? await Sn(n, r) : {}
407
- }), c = L(() => {
407
+ }), l = L(() => {
408
408
  switch (a.status) {
409
409
  case "error":
410
410
  return E.error("Unable to load intents balances:", a.error), {};
411
411
  case "success":
412
412
  return Object.fromEntries(
413
- Object.entries(a.data).map(([l, d]) => [
414
- `intent-${l}`,
413
+ Object.entries(a.data).map(([c, d]) => [
414
+ `intent-${c}`,
415
415
  d
416
416
  ])
417
417
  );
@@ -423,22 +423,22 @@ const ms = (e) => {
423
423
  }, [a]) ?? {};
424
424
  return {
425
425
  ...a,
426
- intentBalances: c
426
+ intentBalances: l
427
427
  };
428
428
  }, fs = ({
429
429
  isEnabled: e,
430
430
  alchemyApiKey: t
431
431
  }) => {
432
- const { connectedWallets: s } = y(), { ctx: r } = _(), n = tn(), { refetch: a } = he(), { refetch: c } = Ot({
432
+ const { connectedWallets: s } = y(), { ctx: r } = _(), n = tn(), { refetch: a } = he(), { refetch: l } = Ot({
433
433
  isEnabled: e,
434
434
  connectedWallets: s,
435
435
  alchemyApiKey: t ?? ""
436
436
  });
437
437
  C(() => {
438
- const l = O(r, ["transfer_success"]);
439
- !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) => {
440
440
  setTimeout(d, 1e4);
441
- }), await c()), await n.invalidateQueries({ queryKey: ["tokenBalance"] })))();
441
+ }), await l()), await n.invalidateQueries({ queryKey: ["tokenBalance"] })))();
442
442
  }, [r.state, e, t]);
443
443
  }, Te = () => {
444
444
  const { connectedWallets: e } = y(), { intentBalances: t } = he(), { walletBalance: s } = xe(e);
@@ -486,30 +486,30 @@ const ms = (e) => {
486
486
  }
487
487
  const { sourceToken: r } = t;
488
488
  if (t.sourceToken.assetId in at) {
489
- const l = s.find(
489
+ const c = s.find(
490
490
  (d) => d.isIntent && d.assetId === at[r.assetId]
491
491
  );
492
492
  h("tokenSelect", {
493
493
  variant: "target",
494
- token: l
494
+ token: c
495
495
  });
496
496
  return;
497
497
  }
498
498
  const n = s.find(
499
- (l) => l.isIntent && l.symbol === r.symbol && l.blockchain === "near"
499
+ (c) => c.isIntent && c.symbol === r.symbol && c.blockchain === "near"
500
500
  );
501
501
  if (n) {
502
502
  h("tokenSelect", { variant: "target", token: n });
503
503
  return;
504
504
  }
505
505
  const a = s.find(
506
- (l) => l.isIntent && l.assetId === r.assetId
507
- ), c = s.find(
508
- (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"
509
509
  );
510
510
  h("tokenSelect", {
511
511
  variant: "target",
512
- token: a ?? c
512
+ token: a ?? l
513
513
  });
514
514
  }, [s, t.sourceToken]);
515
515
  }, Ts = ({ isEnabled: e }) => {
@@ -532,8 +532,8 @@ const ms = (e) => {
532
532
  appName: r,
533
533
  appFees: n,
534
534
  fetchQuote: a,
535
- slippageTolerance: c
536
- } = y(), l = Fe(e), d = Z(null), u = Z(new AbortController()), i = L(() => async (p, w) => {
535
+ slippageTolerance: l
536
+ } = y(), c = Fe(e), d = Z(null), u = Z(new AbortController()), i = L(() => async (p, w) => {
537
537
  const { signal: f } = u.current;
538
538
  return a ? a(p, {
539
539
  ...w,
@@ -560,16 +560,16 @@ const ms = (e) => {
560
560
  const S = `Unable to run quote in current state ${e.state}`;
561
561
  throw E.error(`[WIDGET] ${S}`), new q({
562
562
  code: "QUOTE_INVALID_INITIAL",
563
- meta: { isDry: l, message: S }
563
+ meta: { isDry: c, message: S }
564
564
  });
565
565
  }
566
566
  const k = se({
567
567
  addressType: s,
568
- walletAddress: l ? (
568
+ walletAddress: c ? (
569
569
  // address on the target chain should be a dry quote recipient
570
570
  ze(e.targetToken.blockchain)
571
571
  ) : e.walletAddress ?? ""
572
- }), b = k && (e.sourceToken.isIntent || !t.includes(e.sourceToken.blockchain)), B = () => l ? ze(
572
+ }), b = k && (e.sourceToken.isIntent || !t.includes(e.sourceToken.blockchain)), B = () => c ? ze(
573
573
  e.sourceToken.blockchain,
574
574
  e.sourceToken.isIntent
575
575
  ) : b ? k : e.walletAddress ?? "";
@@ -577,15 +577,15 @@ const ms = (e) => {
577
577
  const S = "No corresponding intents account to run a quote";
578
578
  throw E.error(`[WIDGET] ${S}`), new q({
579
579
  code: "QUOTE_INVALID_INITIAL",
580
- meta: { isDry: l, message: S }
580
+ meta: { isDry: c, message: S }
581
581
  });
582
582
  }
583
583
  d.current && (u.current.abort("Abort previous quote (auto)"), u.current = new AbortController());
584
584
  let D;
585
585
  const R = {
586
586
  // Settings
587
- dry: l,
588
- slippageTolerance: c,
587
+ dry: c,
588
+ slippageTolerance: l,
589
589
  deadline: new Date(Date.now() + 3600 * 1e3).toISOString(),
590
590
  // 1 hour
591
591
  swapType: w === "exact_out" ? W.swapType.EXACT_OUTPUT : W.swapType.EXACT_INPUT,
@@ -650,7 +650,7 @@ const ms = (e) => {
650
650
  }
651
651
  });
652
652
  }
653
- return l ? {
653
+ return c ? {
654
654
  dry: !0,
655
655
  ...D,
656
656
  deadline: void 0,
@@ -670,7 +670,7 @@ const ms = (e) => {
670
670
  const { ctx: e } = _(), { intentsAccountType: t } = y(), { isNativeNearDeposit: s } = J(), r = se({
671
671
  addressType: t,
672
672
  walletAddress: e.walletAddress ?? ""
673
- }), n = Z(null), a = Z(new AbortController()), c = L(() => async (d) => At.post(
673
+ }), n = Z(null), a = Z(new AbortController()), l = L(() => async (d) => At.post(
674
674
  "",
675
675
  {
676
676
  id: 1,
@@ -744,7 +744,7 @@ const ms = (e) => {
744
744
  meta: { isDry: !1, message: "Chain is not supported by POA" }
745
745
  });
746
746
  try {
747
- return n.current = c({
747
+ return n.current = l({
748
748
  chain: u,
749
749
  accountId: r
750
750
  }), {
@@ -845,19 +845,19 @@ const ms = (e) => {
845
845
  }) => {
846
846
  const { ctx: n } = _(), {
847
847
  isNativeNearDeposit: a,
848
- isDirectNonNearWithdrawal: c,
849
- isDirectTokenOnNearDeposit: l,
848
+ isDirectNonNearWithdrawal: l,
849
+ isDirectTokenOnNearDeposit: c,
850
850
  isDirectNearTokenWithdrawal: d,
851
851
  isDirectTokenOnNearTransfer: u,
852
852
  isSameAssetDiffChainWithdrawal: i
853
- } = J(), m = Fe(n), p = e && !n.areInputsValidating && (i || (l || a) && n.isDepositFromExternalWallet || !d && !c && !l && !u), { make: w, cancel: f } = Is(), { make: g, cancel: k } = ws(), b = Z(null), B = () => {
853
+ } = J(), m = Fe(n), p = e && !n.areInputsValidating && (i || (c || a) && n.isDepositFromExternalWallet || !d && !l && !c && !u), { make: w, cancel: f } = Is(), { make: g, cancel: k } = ws(), b = Z(null), B = () => {
854
854
  f(), k();
855
855
  };
856
856
  C(() => {
857
857
  const R = O(n, ["input_valid_dry"]), S = O(n, ["input_valid_external"]), U = O(n, ["input_valid_internal"]);
858
858
  (m && !R || !m && n.targetToken?.isIntent && !U || !m && !n.targetToken?.isIntent && !S || n.areInputsValidating) && B();
859
859
  }, [B, m, n]);
860
- const D = ce(
860
+ const D = le(
861
861
  async (R) => {
862
862
  try {
863
863
  let S;
@@ -913,15 +913,19 @@ const ms = (e) => {
913
913
  skipIntents: t = !1,
914
914
  target: s = "none"
915
915
  }) => {
916
- const { tokens: r } = V(), { ctx: n, state: a } = _(), { intentBalances: c } = he(), { walletSupportedChains: l, chainsFilter: d, intentsAccountType: u } = y(), i = Cn({
916
+ const { tokens: r } = V(), { ctx: n, state: a } = _(), { intentBalances: l } = he(), {
917
+ walletSupportedChains: c,
918
+ enableAccountAbstraction: d,
919
+ intentsAccountType: u
920
+ } = y(), i = Cn({
917
921
  tokens: r,
918
- walletSupportedChains: l,
919
- balances: c,
922
+ walletSupportedChains: c,
923
+ balances: l,
920
924
  across: "intents"
921
925
  }), [m, p] = L(() => !n.walletAddress && !t ? [
922
926
  { token: En({ tokens: r }), status: "loaded" },
923
927
  { token: void 0, status: "loaded" }
924
- ] : d.source.intents !== "none" && !t ? i ? [
928
+ ] : d && !t ? i ? [
925
929
  { token: i, status: "loaded" },
926
930
  { token: void 0, status: "loaded" }
927
931
  ] : [
@@ -930,7 +934,7 @@ const ms = (e) => {
930
934
  ] : [
931
935
  { token: bn({
932
936
  tokens: r,
933
- walletSupportedChains: l
937
+ walletSupportedChains: c
934
938
  }), status: "loaded" },
935
939
  { token: void 0, status: "loaded" }
936
940
  ], [
@@ -939,7 +943,7 @@ const ms = (e) => {
939
943
  d,
940
944
  n.walletAddress,
941
945
  i,
942
- l,
946
+ c,
943
947
  a
944
948
  ]);
945
949
  C(() => {
@@ -988,7 +992,7 @@ const ms = (e) => {
988
992
  m.token || (!t && i ? h("tokenSelect", {
989
993
  variant: "source",
990
994
  token: i
991
- }) : l.length && u ? w(u, g) : n.walletAddress && _t(n.walletAddress) ? w("sol", g) : n.walletAddress && yt(n.walletAddress) ? w("evm", g) : n.walletAddress && Nt(n.walletAddress) ? w("near", g) : h("tokenSelect", {
995
+ }) : c.length && u ? w(u, g) : n.walletAddress && _t(n.walletAddress) ? w("sol", g) : n.walletAddress && yt(n.walletAddress) ? w("evm", g) : n.walletAddress && Nt(n.walletAddress) ? w("near", g) : h("tokenSelect", {
992
996
  variant: "source",
993
997
  token: g
994
998
  }));
@@ -1020,11 +1024,11 @@ const ms = (e) => {
1020
1024
  const { isChanged: n, isDry: a } = vn(t, r);
1021
1025
  if (n) {
1022
1026
  if (On(t)) {
1023
- const c = a ? "initial_dry" : "initial_wallet";
1024
- F(c, {
1027
+ const l = a ? "initial_dry" : "initial_wallet";
1028
+ F(l, {
1025
1029
  onMoved: () => {
1026
1030
  e && E.debug(
1027
- `[WIDGET] Inputs changed. State moved to ${c}`
1031
+ `[WIDGET] Inputs changed. State moved to ${l}`
1028
1032
  );
1029
1033
  }
1030
1034
  });
@@ -1069,9 +1073,9 @@ const ms = (e) => {
1069
1073
  x("quoteSetStatus", Mn), x("walletAddressSet", Hn), x("transferSetStatus", jn), x("tokenSelectRotate", be), x("tokenSetBalance", Gn), x("tokenSetAmount", Vn), x("depositTypeSet", Qn), x("setInputsValidating", Kn), x("externalDepositTxSet", $n), x("tokenSelect", bs), x("addressSet", Wn), x("errorSet", Un), x("quoteSet", Pn), x("reset", qn), x("validateDryInputs", Ft), x("validateExternalInputs", Lt), x("validateInternalInputs", Bt);
1070
1074
  }, Cs = gn(({ debug: e }) => {
1071
1075
  e && E.debug(
1072
- "[WIDGET] Debug mode is enabled (package version: 3.22.0)"
1076
+ "[WIDGET] Debug mode is enabled (package version: 3.24.0)"
1073
1077
  ), Es(), ys({ debug: e }), _s({ debug: e });
1074
- }), Ol = ({ listenTo: e, debug: t = !1 }) => {
1078
+ }), Oc = ({ listenTo: e, debug: t = !1 }) => {
1075
1079
  C(() => {
1076
1080
  Cs({ debug: t });
1077
1081
  }, [t]);
@@ -1128,7 +1132,7 @@ class I extends Ut {
1128
1132
  super(t), this.name = "TransferError";
1129
1133
  }
1130
1134
  }
1131
- const Fl = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e && !!e._is_widget_error, $ = ee.getStore(), vs = pn({
1135
+ const Fc = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e && !!e._is_widget_error, $ = ee.getStore(), vs = pn({
1132
1136
  usdTradeDelta: (e) => zn(e($.context)),
1133
1137
  isDirectNearTokenWithdrawal: (e) => Zn(e($.context)),
1134
1138
  isDirectNonNearWithdrawal: (e) => Yn(e($.context)),
@@ -1142,7 +1146,7 @@ const Fl = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e
1142
1146
  state: e.state,
1143
1147
  ctx: e.context
1144
1148
  };
1145
- }, Ll = (e) => {
1149
+ }, Lc = (e) => {
1146
1150
  const t = fe($);
1147
1151
  if (!O(t.context, [e]))
1148
1152
  throw new M(
@@ -1172,7 +1176,7 @@ const Fl = (e) => typeof e == "object" && e !== null && "_is_widget_error" in e
1172
1176
  function xs(e) {
1173
1177
  const { ctx: t } = _(), { isNativeNearDeposit: s } = J(), r = t.sourceToken?.contractAddress, n = t.quote?.amountIn ?? t.sourceTokenAmount;
1174
1178
  return {
1175
- make: async (c, l) => {
1179
+ make: async (l, c) => {
1176
1180
  if (!e)
1177
1181
  throw new I({
1178
1182
  code: "TRANSFER_INVALID_INITIAL",
@@ -1183,7 +1187,7 @@ function xs(e) {
1183
1187
  code: "TRANSFER_INVALID_INITIAL",
1184
1188
  meta: { message: "No token selected to transfer." }
1185
1189
  });
1186
- if (!c)
1190
+ if (!l)
1187
1191
  throw new I({
1188
1192
  code: "TRANSFER_INVALID_INITIAL",
1189
1193
  meta: { message: "No recipient address to transfer." }
@@ -1199,7 +1203,7 @@ function xs(e) {
1199
1203
  transactions: [
1200
1204
  {
1201
1205
  signerId: t.walletAddress,
1202
- receiverId: c,
1206
+ receiverId: l,
1203
1207
  actions: [
1204
1208
  {
1205
1209
  type: "Transfer",
@@ -1242,8 +1246,8 @@ function xs(e) {
1242
1246
  gas: Xe,
1243
1247
  args: {
1244
1248
  amount: n,
1245
- receiver_id: c,
1246
- msg: l ?? ""
1249
+ receiver_id: l,
1250
+ msg: c ?? ""
1247
1251
  }
1248
1252
  }
1249
1253
  });
@@ -1283,14 +1287,14 @@ function xs(e) {
1283
1287
  }),
1284
1288
  Ds({
1285
1289
  contractId: r,
1286
- accountId: c
1290
+ accountId: l
1287
1291
  })
1288
1292
  ]), p = i - m;
1289
1293
  p > 0n && u.push({
1290
1294
  type: "FunctionCall",
1291
1295
  params: {
1292
1296
  methodName: "storage_deposit",
1293
- args: { account_id: c },
1297
+ args: { account_id: l },
1294
1298
  gas: Ye,
1295
1299
  deposit: p.toString()
1296
1300
  }
@@ -1299,9 +1303,9 @@ function xs(e) {
1299
1303
  params: {
1300
1304
  methodName: "ft_transfer_call",
1301
1305
  args: {
1302
- receiver_id: c,
1306
+ receiver_id: l,
1303
1307
  amount: n,
1304
- msg: l ?? ""
1308
+ msg: c ?? ""
1305
1309
  },
1306
1310
  gas: Xe,
1307
1311
  deposit: "1"
@@ -1343,7 +1347,7 @@ const Os = ({
1343
1347
  }), { make: a } = sr({
1344
1348
  provider: t?.sol,
1345
1349
  alchemyApiKey: r
1346
- }), c = (d) => {
1350
+ }), l = (d) => {
1347
1351
  if (e)
1348
1352
  return e;
1349
1353
  if (yt(d))
@@ -1387,7 +1391,7 @@ const Os = ({
1387
1391
  tokenAddress: s.sourceToken.assetId === j ? j : s.sourceToken.contractAddress,
1388
1392
  sourceAssetId: s.sourceToken.assetId,
1389
1393
  targetAssetId: s.targetToken.assetId
1390
- }, u = c(d.address);
1394
+ }, u = l(d.address);
1391
1395
  try {
1392
1396
  const i = await u(d);
1393
1397
  if (!i) {
@@ -1564,7 +1568,7 @@ const Ls = ({
1564
1568
  const { ctx: t } = _(), { appName: s, intentsAccountType: r } = y(), {
1565
1569
  isNativeNearDeposit: n,
1566
1570
  isDirectNearTokenWithdrawal: a,
1567
- isDirectNonNearWithdrawal: c
1571
+ isDirectNonNearWithdrawal: l
1568
1572
  } = J();
1569
1573
  return { make: async ({
1570
1574
  message: d,
@@ -1634,13 +1638,13 @@ const Ls = ({
1634
1638
  const m = new or({ referral: It(s) });
1635
1639
  m.setIntentSigner(i);
1636
1640
  let p;
1637
- n ? p = void 0 : a ? p = ir(d ?? void 0) : c ? p = void 0 : p = lr();
1641
+ n ? p = void 0 : a ? p = ir(d ?? void 0) : l ? p = void 0 : p = cr();
1638
1642
  const w = {
1639
1643
  assetId: t.sourceToken.assetId,
1640
1644
  amount: BigInt(t.sourceTokenAmount),
1641
1645
  destinationAddress: Bs(
1642
1646
  t,
1643
- a || c
1647
+ a || l
1644
1648
  ),
1645
1649
  destinationMemo: void 0,
1646
1650
  feeInclusive: !0,
@@ -1669,7 +1673,7 @@ const Ls = ({
1669
1673
  ) : ""
1670
1674
  };
1671
1675
  } catch (f) {
1672
- if (E.error("[TRANSFER ERROR]", f), f instanceof cr)
1676
+ if (E.error("[TRANSFER ERROR]", f), f instanceof lr)
1673
1677
  throw new I({
1674
1678
  code: "MIN_WITHDRAWAL_AMOUNT_ERROR",
1675
1679
  meta: {
@@ -1705,8 +1709,8 @@ const Ls = ({
1705
1709
  const { ctx: r } = _(), {
1706
1710
  isDirectTokenOnNearDeposit: n,
1707
1711
  isDirectTokenOnNearTransfer: a,
1708
- isNativeNearDeposit: c
1709
- } = J(), { make: l } = Us({ providers: t }), { make: d } = Os({
1712
+ isNativeNearDeposit: l
1713
+ } = J(), { make: c } = Us({ providers: t }), { make: d } = Os({
1710
1714
  makeTransfer: s,
1711
1715
  providers: t
1712
1716
  }), { make: u } = xs(
@@ -1721,7 +1725,7 @@ const Ls = ({
1721
1725
  status: "pending",
1722
1726
  reason: "WAITING_CONFIRMATION"
1723
1727
  }), r.sourceToken?.isIntent)
1724
- m = await l({
1728
+ m = await c({
1725
1729
  message: e,
1726
1730
  onPending: (p) => {
1727
1731
  h("transferSetStatus", {
@@ -1730,7 +1734,7 @@ const Ls = ({
1730
1734
  });
1731
1735
  }
1732
1736
  });
1733
- else if ((c || n) && !r.isDepositFromExternalWallet)
1737
+ else if ((l || n) && !r.isDepositFromExternalWallet)
1734
1738
  m = await u(
1735
1739
  r.sendAddress ?? Ee,
1736
1740
  e
@@ -1764,7 +1768,7 @@ const Ls = ({
1764
1768
  });
1765
1769
  return parseInt(t, 16);
1766
1770
  }, Vs = ({ providers: e }) => {
1767
- const { ctx: t } = _(), [s, r] = re(!1), [n, a] = re(!1), c = ce(async () => {
1771
+ const { ctx: t } = _(), [s, r] = re(!1), [n, a] = re(!1), l = le(async () => {
1768
1772
  const d = typeof e?.evm == "function" ? await e.evm() : e?.evm;
1769
1773
  if (!t.sourceToken || !d)
1770
1774
  return !1;
@@ -1773,7 +1777,7 @@ const Ls = ({
1773
1777
  return !1;
1774
1778
  const i = Ne[t.sourceToken.blockchain];
1775
1779
  return !i || !u ? !1 : u !== i;
1776
- }, [t.sourceToken, e]), l = ce(async () => {
1780
+ }, [t.sourceToken, e]), c = le(async () => {
1777
1781
  const d = typeof e?.evm == "function" ? await e.evm() : e?.evm;
1778
1782
  if (!t.sourceToken || !d || !G(t.sourceToken.blockchain))
1779
1783
  return !1;
@@ -1789,10 +1793,10 @@ const Ls = ({
1789
1793
  }
1790
1794
  }, [t.sourceToken, e]);
1791
1795
  return C(() => {
1792
- c().then(a);
1793
- }, [c]), {
1796
+ l().then(a);
1797
+ }, [l]), {
1794
1798
  isSwitchingChainRequired: n,
1795
- switchChain: l,
1799
+ switchChain: c,
1796
1800
  isSwitchingChain: s
1797
1801
  };
1798
1802
  }, N = {
@@ -1875,8 +1879,8 @@ const Ls = ({
1875
1879
  return We(e) ?? null;
1876
1880
  }, $s = (e) => {
1877
1881
  const { providers: t, makeTransfer: s, onSuccess: r } = e, { ctx: n } = _(), { t: a } = K(), {
1878
- isNativeNearDeposit: c,
1879
- isDirectNonNearWithdrawal: l,
1882
+ isNativeNearDeposit: l,
1883
+ isDirectNonNearWithdrawal: c,
1880
1884
  isDirectTokenOnNearDeposit: d,
1881
1885
  isDirectNearTokenWithdrawal: u
1882
1886
  } = J(), { make: i } = Ps({ providers: t, makeTransfer: s }), { isSwitchingChainRequired: m, switchChain: p, isSwitchingChain: w } = Vs({ providers: t }), f = We(n), g = async () => {
@@ -1919,7 +1923,7 @@ const Ls = ({
1919
1923
  );
1920
1924
  }
1921
1925
  })() })
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 && !l && !d && !u && !c ? /* @__PURE__ */ o(A, { state: "disabled", ...N, children: e.label }) : /* @__PURE__ */ o(A, { ...N, onClick: g, children: e.label });
1926
+ ] }) : 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 && !u && !l ? /* @__PURE__ */ o(A, { state: "disabled", ...N, children: e.label }) : /* @__PURE__ */ o(A, { ...N, onClick: g, children: e.label });
1923
1927
  }, Ks = (e) => {
1924
1928
  const { t } = K(), { ctx: s } = _(), r = We(s);
1925
1929
  return s.isDepositFromExternalWallet ? ae(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($s, { ...e });
@@ -1928,7 +1932,7 @@ const Ls = ({
1928
1932
  return t.walletAddress ? /* @__PURE__ */ o(Ks, { ...e }) : /* @__PURE__ */ o(Ms, { onClick: s.onWalletSignin });
1929
1933
  };
1930
1934
  Hs.Error = Qs;
1931
- const lt = [
1935
+ const ct = [
1932
1936
  "nep141:eth-0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf.omft.near",
1933
1937
  // cbBTC (eth)
1934
1938
  "nep141:base-0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf.omft.near",
@@ -1946,8 +1950,8 @@ const lt = [
1946
1950
  return {
1947
1951
  uniqueIntentsTokens: L(() => {
1948
1952
  const t = e.filter(
1949
- (n) => n.isIntent && n.blockchain === "near" && !lt.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) && !lt.includes(n.assetId));
1953
+ (n) => n.isIntent && n.blockchain === "near" && !ct.includes(n.assetId)
1954
+ ), s = t.map((n) => n.isIntent && n.symbol), r = e.filter((n) => n.isIntent && n.blockchain !== "near" && !s.includes(n.symbol) && !ct.includes(n.assetId));
1951
1955
  return [...t, ...r];
1952
1956
  }, [e])
1953
1957
  };
@@ -1960,12 +1964,12 @@ const lt = [
1960
1964
  priorityAssets: a
1961
1965
  }) => {
1962
1966
  ms(e);
1963
- const { tokens: c } = V(e), { mergedBalance: l } = Te(), { intentBalances: d } = he(), { uniqueIntentsTokens: u } = Gs(), i = Ur(
1964
- l,
1967
+ const { tokens: l } = V(e), { mergedBalance: c } = Te(), { intentBalances: d } = he(), { uniqueIntentsTokens: u } = Gs(), i = Ur(
1968
+ c,
1965
1969
  n,
1966
1970
  t,
1967
1971
  a
1968
- ), m = c.filter(Pr({ search: t })).filter(
1972
+ ), m = l.filter(Pr({ search: t })).filter(
1969
1973
  Wr({
1970
1974
  selectedChain: s,
1971
1975
  chainsFilter: r,
@@ -1981,13 +1985,13 @@ const lt = [
1981
1985
  };
1982
1986
  }, zs = (e, t) => {
1983
1987
  const s = t.assetId.substring(t.assetId.indexOf(":") + 1), r = (a) => {
1984
- const c = (u) => u.replace(/(\.\d*?[1-9])0+$/, "$1").replace(/\.0+$/, ""), l = c(t.amount), d = c(
1988
+ const l = (u) => u.replace(/(\.\d*?[1-9])0+$/, "$1").replace(/\.0+$/, ""), c = l(t.amount), d = l(
1985
1989
  a.amount.toLocaleString("en-US", {
1986
1990
  useGrouping: !1,
1987
1991
  maximumFractionDigits: 20
1988
1992
  })
1989
1993
  );
1990
- return l.startsWith(d) || d.startsWith(l);
1994
+ return c.startsWith(d) || d.startsWith(c);
1991
1995
  }, n = (a) => new Date(a.created_at) >= new Date(t.initiatedAtDate);
1992
1996
  return (e.result.deposits || []).find(
1993
1997
  (a) => a.chain === t.chainId && a.account_id === t.intentsAccountId && a.address === t.depositAddress && a.near_token_id === s && n(a) && r(a)
@@ -1997,25 +2001,25 @@ const lt = [
1997
2001
  PENDING: te.status.PROCESSING,
1998
2002
  COMPLETED: te.status.SUCCESS,
1999
2003
  FAILED: te.status.FAILED
2000
- }, Bl = ({ depositAddress: e }) => {
2004
+ }, Bc = ({ depositAddress: e }) => {
2001
2005
  const { ctx: t } = _(), { intentsAccountType: s } = y(), [r, n] = re(null), a = se({
2002
2006
  addressType: s,
2003
2007
  walletAddress: t.walletAddress
2004
2008
  });
2005
2009
  return { pollDepositStatus: async ({
2006
- blockchain: l,
2010
+ blockchain: c,
2007
2011
  amount: d,
2008
2012
  assetId: u
2009
2013
  }) => {
2010
2014
  if (!a)
2011
2015
  throw new M("Unknown intents account for POA deposit check");
2012
- let i = Tt[l];
2016
+ let i = Tt[c];
2013
2017
  if (!i)
2014
- if (G(l))
2018
+ if (G(c))
2015
2019
  i = gt;
2016
2020
  else
2017
2021
  throw new M(
2018
- `Unknown chain for POA deposit check ${l}`
2022
+ `Unknown chain for POA deposit check ${c}`
2019
2023
  );
2020
2024
  const m = r ?? (/* @__PURE__ */ new Date()).toUTCString();
2021
2025
  r || n(m);
@@ -2093,7 +2097,7 @@ const lt = [
2093
2097
  ] })
2094
2098
  }
2095
2099
  ) : /* @__PURE__ */ o(Et, {});
2096
- }, ql = Object.assign(Xs, {
2100
+ }, qc = Object.assign(Xs, {
2097
2101
  Skeleton: Et
2098
2102
  }), Zs = ({
2099
2103
  token: e,
@@ -2128,8 +2132,8 @@ const lt = [
2128
2132
  quoteUsdDelta: r,
2129
2133
  quoteUsdValue: n,
2130
2134
  state: a = "default",
2131
- showBalance: c = !0,
2132
- showQuickBalanceActions: l = !0,
2135
+ showBalance: l = !0,
2136
+ showQuickBalanceActions: c = !0,
2133
2137
  heading: d,
2134
2138
  onMsg: u
2135
2139
  }) => {
@@ -2207,7 +2211,7 @@ const lt = [
2207
2211
  ) : null
2208
2212
  ] }),
2209
2213
  /* @__PURE__ */ T("div", { className: "gap-sw-sm flex items-center", children: [
2210
- e && !!m.walletAddress && c && /* @__PURE__ */ o(
2214
+ e && !!m.walletAddress && l && /* @__PURE__ */ o(
2211
2215
  Zs,
2212
2216
  {
2213
2217
  token: e,
@@ -2216,7 +2220,7 @@ const lt = [
2216
2220
  onClick: () => g(1)
2217
2221
  }
2218
2222
  ),
2219
- !!t && c && l && /* @__PURE__ */ T(Gt, { children: [
2223
+ !!t && l && c && /* @__PURE__ */ T(Gt, { children: [
2220
2224
  /* @__PURE__ */ o(
2221
2225
  tt,
2222
2226
  {
@@ -2234,7 +2238,7 @@ const lt = [
2234
2238
  }
2235
2239
  )
2236
2240
  ] }),
2237
- !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") }) })
2241
+ !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") }) })
2238
2242
  ] })
2239
2243
  ] })
2240
2244
  ] });
@@ -2316,7 +2320,7 @@ const lt = [
2316
2320
  }) => {
2317
2321
  const { ctx: n } = _(), a = Pt(n.sourceToken);
2318
2322
  Wt("source", e);
2319
- const c = L(() => {
2323
+ const l = L(() => {
2320
2324
  if (!t && n.quoteStatus === "pending")
2321
2325
  return "disabled";
2322
2326
  if (!n.error)
@@ -2331,7 +2335,7 @@ const lt = [
2331
2335
  {
2332
2336
  heading: r,
2333
2337
  token: n.sourceToken,
2334
- state: c,
2338
+ state: l,
2335
2339
  balance: a,
2336
2340
  showBalance: s,
2337
2341
  showQuickBalanceActions: !0,
@@ -2346,7 +2350,7 @@ const lt = [
2346
2350
  }) => {
2347
2351
  const { ctx: r } = _(), { usdTradeDelta: n } = J(), a = Pt(r.targetToken);
2348
2352
  Wt("target", t);
2349
- const c = L(() => !e && r.quoteStatus === "pending" ? "disabled" : "default", [e, r.quoteStatus]);
2353
+ const l = L(() => !e && r.quoteStatus === "pending" ? "disabled" : "default", [e, r.quoteStatus]);
2350
2354
  return r.targetToken ? /* @__PURE__ */ o(
2351
2355
  Ve,
2352
2356
  {
@@ -2356,13 +2360,13 @@ const lt = [
2356
2360
  quoteUsdDelta: n?.percentage,
2357
2361
  quoteUsdValue: r.quote && parseFloat(r.quote.amountOutUsd),
2358
2362
  value: X(r.targetTokenAmount, r.targetToken?.decimals),
2359
- state: c,
2363
+ state: l,
2360
2364
  showQuickBalanceActions: !1,
2361
2365
  showBalance: !0,
2362
2366
  onMsg: t
2363
2367
  }
2364
2368
  ) : /* @__PURE__ */ o(Me, { heading: s, onMsg: t });
2365
- }, ta = ({ token: e, heading: t, ...s }) => e ? /* @__PURE__ */ o(Ve, { ...s, token: e, heading: t }) : /* @__PURE__ */ o(Me, { onMsg: s.onMsg, heading: t }), Ul = Object.assign(ta, {
2369
+ }, ta = ({ token: e, heading: t, ...s }) => e ? /* @__PURE__ */ o(Ve, { ...s, token: e, heading: t }) : /* @__PURE__ */ o(Me, { onMsg: s.onMsg, heading: t }), Uc = Object.assign(ta, {
2366
2370
  Skeleton: _r,
2367
2371
  Source: Js,
2368
2372
  Target: ea
@@ -2373,9 +2377,9 @@ const lt = [
2373
2377
  isNotSelectable: r,
2374
2378
  isFocused: n,
2375
2379
  className: a,
2376
- onMsg: c
2380
+ onMsg: l
2377
2381
  }) => {
2378
- const { ctx: l } = _(), { walletSupportedChains: d, appName: u } = y(), i = yr(t, e), m = d.includes(e.blockchain) || e.isIntent, p = t !== "0" && t !== 0 && t !== void 0;
2382
+ const { ctx: c } = _(), { walletSupportedChains: d, appName: u } = y(), i = yr(t, e), m = d.includes(e.blockchain) || e.isIntent, p = t !== "0" && t !== 0 && t !== void 0;
2379
2383
  return /* @__PURE__ */ o("li", { className: "list-none group", children: /* @__PURE__ */ T(
2380
2384
  "div",
2381
2385
  {
@@ -2388,7 +2392,7 @@ const lt = [
2388
2392
  },
2389
2393
  a
2390
2394
  ),
2391
- onClick: () => !r && c({ type: "on_select_token", token: e }),
2395
+ onClick: () => !r && l({ type: "on_select_token", token: e }),
2392
2396
  children: [
2393
2397
  /* @__PURE__ */ o(
2394
2398
  Rt,
@@ -2413,7 +2417,7 @@ const lt = [
2413
2417
  /* @__PURE__ */ o("span", { className: "text-sw-label-sm text-sw-gray-300", children: `on ${e.chainName}` })
2414
2418
  ] })
2415
2419
  ] }),
2416
- m && !!l.walletAddress && s && /* @__PURE__ */ T("div", { className: "gap-sw-xs flex flex-col items-end", children: [
2420
+ m && !!c.walletAddress && s && /* @__PURE__ */ T("div", { className: "gap-sw-xs flex flex-col items-end", children: [
2417
2421
  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(
2418
2422
  Ue,
2419
2423
  {
@@ -2433,15 +2437,15 @@ const lt = [
2433
2437
  groupTokens: r,
2434
2438
  showBalances: n,
2435
2439
  chainsFilter: a,
2436
- selectedChain: c,
2437
- chainIsNotSupported: l,
2440
+ selectedChain: l,
2441
+ chainIsNotSupported: c,
2438
2442
  onMsg: d
2439
2443
  }) => {
2440
2444
  const { t: u } = K(), { ctx: i } = _(), { walletSupportedChains: m, appName: p, priorityAssets: w = [] } = y(), { mergedBalance: f } = Te(), g = js({
2441
2445
  variant: e,
2442
2446
  search: t,
2443
2447
  chainsFilter: a,
2444
- selectedChain: c,
2448
+ selectedChain: l,
2445
2449
  walletSupportedChains: m,
2446
2450
  priorityAssets: w
2447
2451
  }), k = i.walletAddress ? r : !1, b = Br(g.all, t), B = Z(null), [D, R] = re(-1), S = L(
@@ -2454,12 +2458,12 @@ const lt = [
2454
2458
  ] : [],
2455
2459
  ...g.wallet.length > 0 ? [
2456
2460
  {
2457
- label: l ? null : "Connected wallet",
2461
+ label: c ? null : "Connected wallet",
2458
2462
  count: g.wallet.length
2459
2463
  },
2460
2464
  { tokens: g.wallet }
2461
2465
  ] : []
2462
- ].filter(Boolean), [g.wallet, g.intents, l]), Q = k ? U : S, oe = Lr(Q), Qt = Or(Q), $e = Dr(Q), $t = ce(() => {
2466
+ ].filter(Boolean), [g.wallet, g.intents, c]), Q = k ? U : S, oe = Lr(Q), Qt = Or(Q), $e = Dr(Q), $t = le(() => {
2463
2467
  R(-1);
2464
2468
  }, []);
2465
2469
  switch (Er({
@@ -2554,7 +2558,7 @@ const lt = [
2554
2558
  showBalance: n,
2555
2559
  balance: f[je],
2556
2560
  isFocused: D === Kt + Ht,
2557
- isNotSelectable: l && !!i.walletAddress,
2561
+ isNotSelectable: c && !!i.walletAddress,
2558
2562
  onMsg: d
2559
2563
  },
2560
2564
  je
@@ -2581,14 +2585,14 @@ const lt = [
2581
2585
  }
2582
2586
  );
2583
2587
  }
2584
- }, Pl = Object.assign(na, {
2588
+ }, Pc = Object.assign(na, {
2585
2589
  Placeholder: Ce,
2586
2590
  Item: Vt
2587
- }), le = (e, t, s) => {
2591
+ }), ce = (e, t, s) => {
2588
2592
  let r = document.body;
2589
2593
  s instanceof HTMLElement && (r = s), r.style.setProperty(e, t);
2590
2594
  }, ne = (e, t, s) => {
2591
- le(`--c-sw-${e}`, t, s);
2595
+ ce(`--c-sw-${e}`, t, s);
2592
2596
  }, ra = (e, t, s) => {
2593
2597
  Object.entries(e).forEach(([r, n]) => {
2594
2598
  ne(`${t}-${r}`, n, s);
@@ -2603,20 +2607,20 @@ const lt = [
2603
2607
  md: { sm: 6, md: 10, lg: 16 },
2604
2608
  lg: { sm: 8, md: 24, lg: 24 }
2605
2609
  };
2606
- le("--r-sw-sm", `${s[e].sm}px`, t), le("--r-sw-md", `${s[e].md}px`, t), le("--r-sw-lg", `${s[e].lg}px`, t);
2610
+ ce("--r-sw-sm", `${s[e].sm}px`, t), ce("--r-sw-md", `${s[e].md}px`, t), ce("--r-sw-lg", `${s[e].lg}px`, t);
2607
2611
  }, aa = (e, t) => {
2608
2612
  const {
2609
2613
  primaryColor: s,
2610
2614
  surfaceColor: r,
2611
2615
  containerColor: n,
2612
2616
  successColor: a,
2613
- warningColor: c,
2614
- errorColor: l,
2617
+ warningColor: l,
2618
+ errorColor: c,
2615
2619
  colorScheme: d = "dark",
2616
2620
  borderRadius: u = "md",
2617
2621
  stylePreset: i = "clean"
2618
2622
  } = t;
2619
- s && (ke("accent", 500, e, s, d), i === "bold" && ke("gray", 50, e, s, d)), r && i === "clean" && ke("gray", 950, e, r, d), n && ne("container", n, e), a && ne("status-success", a, e), c && ne("status-warning", c, e), l && ne("status-error", l, e), u && sa(u, e);
2623
+ s && (ke("accent", 500, e, s, d), i === "bold" && ke("gray", 50, e, s, d)), r && i === "clean" && ke("gray", 950, e, r, d), n && ne("container", n, e), a && ne("status-success", a, e), l && ne("status-warning", l, e), c && ne("status-error", c, e), u && sa(u, e);
2620
2624
  }, oa = mt(void 0), ia = ({ children: e, theme: t }) => {
2621
2625
  const { themeParentElementSelector: s } = y(), r = L(() => t, [t]);
2622
2626
  return C(() => {
@@ -2631,7 +2635,7 @@ const lt = [
2631
2635
  }) => /* @__PURE__ */ T("li", { className: "flex items-center gap-sw-md", children: [
2632
2636
  t && /* @__PURE__ */ o(t, { size: 20, className: "text-sw-gray-300" }),
2633
2637
  /* @__PURE__ */ o("span", { className: "text-sw-label-md text-sw-gray-50", children: e })
2634
- ] }), ct = ({
2638
+ ] }), lt = ({
2635
2639
  label: e,
2636
2640
  icon: t,
2637
2641
  className: s
@@ -2647,7 +2651,7 @@ const lt = [
2647
2651
  /* @__PURE__ */ o("span", { className: "text-sw-label-md", children: e })
2648
2652
  ]
2649
2653
  }
2650
- ), la = ({ isSigned: e, isSigning: t, onMsg: s }) => {
2654
+ ), ca = ({ isSigned: e, isSigning: t, onMsg: s }) => {
2651
2655
  const { t: r } = K(), n = () => s({ type: "on_close" });
2652
2656
  vt("Escape", n);
2653
2657
  const a = jr({
@@ -2712,7 +2716,7 @@ const lt = [
2712
2716
  ] }),
2713
2717
  e ? /* @__PURE__ */ T("div", { className: "flex flex-col gap-sw-xl mt-sw-lg w-full", children: [
2714
2718
  /* @__PURE__ */ o(
2715
- ct,
2719
+ lt,
2716
2720
  {
2717
2721
  label: r(
2718
2722
  "walletCompatibility.modal.button.verified",
@@ -2723,7 +2727,7 @@ const lt = [
2723
2727
  }
2724
2728
  ),
2725
2729
  a.status === "RUNNING" && /* @__PURE__ */ o(
2726
- ct,
2730
+ lt,
2727
2731
  {
2728
2732
  className: "text-sw-gray-400",
2729
2733
  label: r("walletCompatibility.modal.button.closeTimer", {
@@ -2757,7 +2761,7 @@ const lt = [
2757
2761
  )
2758
2762
  ] })
2759
2763
  ] });
2760
- }, ca = ({ onMsg: e }) => {
2764
+ }, la = ({ onMsg: e }) => {
2761
2765
  const { t } = K(), s = () => e({ type: "on_close" });
2762
2766
  return vt("Escape", s), /* @__PURE__ */ T(pe, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
2763
2767
  /* @__PURE__ */ o(
@@ -2803,8 +2807,8 @@ const lt = [
2803
2807
  )
2804
2808
  ] })
2805
2809
  ] });
2806
- }, Wl = Object.assign(la, {
2807
- Error: ca
2810
+ }, Wc = Object.assign(ca, {
2811
+ Error: la
2808
2812
  }), da = (e) => null, ua = (e) => (t) => {
2809
2813
  if (t instanceof M)
2810
2814
  throw t;
@@ -2841,10 +2845,6 @@ const lt = [
2841
2845
  showIntentTokens: !0,
2842
2846
  chainsOrder: ht,
2843
2847
  filterTokens: (e) => !pa.includes(e.symbol.toLocaleLowerCase()),
2844
- chainsFilter: {
2845
- source: { external: "wallet-supported", intents: "none" },
2846
- target: { external: "all", intents: "none" }
2847
- },
2848
2848
  topChainShortcuts: (e) => {
2849
2849
  switch (e) {
2850
2850
  case "evm":
@@ -2866,7 +2866,7 @@ const lt = [
2866
2866
  return fe(e).config;
2867
2867
  }, ha = (e) => {
2868
2868
  Qe.config = Se(e);
2869
- }, Vl = ({
2869
+ }, Vc = ({
2870
2870
  children: e,
2871
2871
  config: t,
2872
2872
  balanceViaRpc: s = !0,
@@ -2875,7 +2875,7 @@ const lt = [
2875
2875
  rpcs: n,
2876
2876
  theme: a
2877
2877
  }) => {
2878
- const c = Z(
2878
+ const l = Z(
2879
2879
  ut({
2880
2880
  config: Se({
2881
2881
  ...me,
@@ -2884,12 +2884,12 @@ const lt = [
2884
2884
  })
2885
2885
  );
2886
2886
  return C(() => {
2887
- const l = Se({
2887
+ const c = Se({
2888
2888
  ...me,
2889
2889
  ...t
2890
2890
  });
2891
- Object.assign(c.current.config, l), ha(l);
2892
- }, [t]), on(r ?? {}), Yr("headlessui-portal-root", "sw"), /* @__PURE__ */ o(rn, { client: fa, children: /* @__PURE__ */ o(an, { i18n: jt, children: /* @__PURE__ */ T(Mt.Provider, { value: c.current, children: [
2891
+ Object.assign(l.current.config, c), ha(c);
2892
+ }, [t]), on(r ?? {}), Yr("headlessui-portal-root", "sw"), /* @__PURE__ */ o(rn, { client: fa, children: /* @__PURE__ */ o(an, { i18n: jt, children: /* @__PURE__ */ T(Mt.Provider, { value: l.current, children: [
2893
2893
  /* @__PURE__ */ T(zt, { children: [
2894
2894
  /* @__PURE__ */ T(Yt, { children: [
2895
2895
  /* @__PURE__ */ o("link", { rel: "preconnect", href: "https://rsms.me/" }),
@@ -2908,7 +2908,7 @@ const lt = [
2908
2908
  };
2909
2909
  export {
2910
2910
  Ds as $,
2911
- Bl as A,
2911
+ Bc as A,
2912
2912
  ds as B,
2913
2913
  oa as C,
2914
2914
  rs as D,
@@ -2930,12 +2930,12 @@ export {
2930
2930
  ta as T,
2931
2931
  Ss as U,
2932
2932
  Ns as V,
2933
- Vl as W,
2933
+ Vc as W,
2934
2934
  _s as X,
2935
2935
  ys as Y,
2936
2936
  bs as Z,
2937
2937
  Es as _,
2938
- Ll as a,
2938
+ Lc as a,
2939
2939
  xs as a0,
2940
2940
  Fs as a1,
2941
2941
  Ls as a2,
@@ -2950,14 +2950,14 @@ export {
2950
2950
  Vt as ab,
2951
2951
  na as ac,
2952
2952
  ia as ad,
2953
- la as ae,
2954
- ca as af,
2953
+ ca as ae,
2954
+ la as af,
2955
2955
  ma as ag,
2956
2956
  Qe as ah,
2957
2957
  _ as b,
2958
- Ol as c,
2958
+ Oc as c,
2959
2959
  ms as d,
2960
- ls as e,
2960
+ cs as e,
2961
2961
  he as f,
2962
2962
  Us as g,
2963
2963
  Is as h,
@@ -2967,17 +2967,17 @@ export {
2967
2967
  Vs as l,
2968
2968
  js as m,
2969
2969
  V as n,
2970
- ql as o,
2971
- Ul as p,
2972
- Pl as q,
2970
+ qc as o,
2971
+ Uc as p,
2972
+ Pc as q,
2973
2973
  Cs as r,
2974
2974
  Pt as s,
2975
2975
  Ot as t,
2976
2976
  J as u,
2977
2977
  M as v,
2978
2978
  I as w,
2979
- Fl as x,
2979
+ Fc as x,
2980
2980
  y,
2981
- Wl as z
2981
+ Wc as z
2982
2982
  };
2983
- //# sourceMappingURL=config-Opy5ppbU.js.map
2983
+ //# sourceMappingURL=config-Bg5hUlJL.js.map