@aurora-is-near/intents-swap-widget 3.22.0 → 3.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{config-Opy5ppbU.js → config-0TjbjBo5.js} +183 -183
- package/dist/config-0TjbjBo5.js.map +1 -0
- package/dist/config.d.ts +1 -10
- package/dist/config.js +1 -1
- package/dist/errors.js +1 -1
- package/dist/ext/alchemy/index.js +1 -1
- package/dist/ext/index.js +1 -1
- package/dist/features/BalanceRpcLoader/TokenBalanceLoader.js +1 -1
- package/dist/features/BalanceRpcLoader/index.js +1 -1
- package/dist/features/BalanceRpcLoader/useTokenBalanceRpc.js +1 -1
- package/dist/features/ChainsDropdown/index.js +1 -1
- package/dist/features/ChainsSelector/index.js +1 -1
- package/dist/features/DepositMethodSwitcher.js +1 -1
- package/dist/features/ErrorBoundary.js +1 -1
- package/dist/features/ExternalDeposit.js +1 -1
- package/dist/features/SendAddress/index.js +1 -1
- package/dist/features/SendAddress/useNotification.js +1 -1
- package/dist/features/SubmitButton/index.js +1 -1
- package/dist/features/SuccessScreen/index.js +1 -1
- package/dist/features/SuccessScreen/useSummaryItemsCount.js +1 -1
- package/dist/features/SwapDirectionSwitcher.js +1 -1
- package/dist/features/SwapQuote/SwapQuote.js +1 -1
- package/dist/features/SwapQuote/index.js +1 -1
- package/dist/features/TokenInput/TokenInput.js +1 -1
- package/dist/features/TokenInput/TokenInputEmpty.js +1 -1
- package/dist/features/TokenInput/TokenInputSource.js +1 -1
- package/dist/features/TokenInput/TokenInputTarget.js +1 -1
- package/dist/features/TokenInput/WalletBalance.js +1 -1
- package/dist/features/TokenInput/hooks/index.js +1 -1
- package/dist/features/TokenInput/hooks/useTokenInputBalance.js +1 -1
- package/dist/features/TokenInput/index.js +1 -1
- package/dist/features/TokensList/TokenItem.js +1 -1
- package/dist/features/TokensList/TokensList.js +1 -1
- package/dist/features/TokensList/index.js +1 -1
- package/dist/features/TokensModal.js +1 -1
- package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js +1 -1
- package/dist/features/WalletCompatibilityCheck/index.js +1 -1
- package/dist/features/index.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useAllTokens.js +1 -1
- package/dist/hooks/useChains.js +1 -1
- package/dist/hooks/useCompatibilityCheck.js +1 -1
- package/dist/hooks/useDefaultToken.js +1 -1
- package/dist/hooks/useExternalDepositStatus/index.js +1 -1
- package/dist/hooks/useExternalDepositStatus/usePoaExternalDepositStatus.js +1 -1
- package/dist/hooks/useIntentsBalance.js +1 -1
- package/dist/hooks/useIsCompatibilityCheckRequired.js +1 -1
- package/dist/hooks/useMakeDepositAddress.js +1 -1
- package/dist/hooks/useMakeIntentsTransfer.js +1 -1
- package/dist/hooks/useMakeNEARFtTransferCall.js +1 -1
- package/dist/hooks/useMakeQuote.js +1 -1
- package/dist/hooks/useMakeQuoteTransfer.js +1 -1
- package/dist/hooks/useMakeTransfer.js +1 -1
- package/dist/hooks/useMergedBalance.js +1 -1
- package/dist/hooks/useSwitchChain.js +1 -1
- package/dist/hooks/useTheme.js +1 -1
- package/dist/hooks/useTokenInputPair.js +1 -1
- package/dist/hooks/useTokens.js +1 -1
- package/dist/hooks/useTokensFiltered.js +1 -1
- package/dist/hooks/useTokensIntentsUnique.js +1 -1
- package/dist/index.js +1 -1
- package/dist/machine/effects/index.js +1 -1
- package/dist/machine/effects/useAlchemyBalanceEffect.js +1 -1
- package/dist/machine/effects/useBalancesUpdateEffect.js +1 -1
- package/dist/machine/effects/useMakeQuoteEffect.js +1 -1
- package/dist/machine/effects/useSelectedTokensEffect.js +1 -1
- package/dist/machine/effects/useSetTokenBalanceEffect.js +1 -1
- package/dist/machine/effects/useSetTokenIntentsTargetEffect.js +1 -1
- package/dist/machine/effects/useWalletConnEffect.js +1 -1
- package/dist/machine/events/index.js +1 -1
- package/dist/machine/events/tokenSelect.js +1 -1
- package/dist/machine/events/validateInputAndMoveTo.js +1 -1
- package/dist/machine/events/validateInputs.js +1 -1
- package/dist/machine/index.js +1 -1
- package/dist/machine/snap.js +1 -1
- package/dist/machine/subscriptions/checkers/isSendAddressAsConnected.js +1 -1
- package/dist/machine/subscriptions/index.js +1 -1
- package/dist/theme/ThemeProvider.js +1 -1
- package/dist/types/chain.d.ts +4 -0
- package/dist/types/config.d.ts +2 -5
- package/dist/utils/intents/signers/near.js +1 -1
- package/dist/utils/intents/signers/privy.js +1 -1
- package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
- package/dist/widgets/Widget/WidgetContent.js +24 -21
- package/dist/widgets/Widget/WidgetContent.js.map +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +65 -63
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js.map +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositSkeleton.js +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js +59 -53
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js.map +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapSkeleton.js +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +79 -77
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js.map +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawSkeleton.js +1 -1
- package/package.json +1 -1
- package/src/config.tsx +0 -5
- package/src/machine/effects/useSelectedTokensEffect.ts +7 -4
- package/src/types/chain.ts +5 -0
- package/src/types/config.ts +3 -4
- package/src/widgets/Widget/WidgetContent.tsx +10 -2
- package/src/widgets/WidgetDeposit/WidgetDeposit.test.tsx +0 -4
- package/src/widgets/WidgetDeposit/WidgetDepositContent.tsx +7 -3
- package/src/widgets/WidgetSwap/WidgetSwapContent.tsx +19 -4
- package/src/widgets/WidgetWithdraw/WidgetWithdrawContent.tsx +5 -3
- 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
|
|
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
|
|
13
|
-
import { getSolanaTokenBalance as
|
|
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
|
|
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:
|
|
180
|
+
const { walletSupportedChains: r, tonCenterApiKey: n, alchemyApiKey: a } = y(), { walletAddress: l } = ft(s, t);
|
|
181
181
|
return ve({
|
|
182
182
|
retry: 2,
|
|
183
|
-
enabled: !!
|
|
183
|
+
enabled: !!l && Object.keys(e).includes(t.blockchain),
|
|
184
184
|
queryKey: ["tokenBalance", t.assetId, s],
|
|
185
185
|
queryFn: async () => {
|
|
186
|
-
if (!
|
|
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(
|
|
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
|
|
194
|
-
return
|
|
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
|
|
198
|
-
return
|
|
197
|
+
const c = e[t.blockchain] ?? [];
|
|
198
|
+
return c.length > 0 ? ns(t, l, c[0]) : null;
|
|
199
199
|
}
|
|
200
|
-
return t.blockchain === "ton" ?
|
|
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:
|
|
239
|
-
fetchTargetTokens:
|
|
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" &&
|
|
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
|
-
},
|
|
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
|
|
296
|
-
n[
|
|
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
|
-
],
|
|
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] ?? [],
|
|
313
|
-
return
|
|
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 } =
|
|
316
|
-
return L(() =>
|
|
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:
|
|
320
|
+
token: l,
|
|
321
321
|
connectedWallets: t,
|
|
322
|
-
onBalancesLoaded: (
|
|
322
|
+
onBalancesLoaded: (c) => n(t, c)
|
|
323
323
|
},
|
|
324
|
-
Y(
|
|
324
|
+
Y(l)
|
|
325
325
|
) : /* @__PURE__ */ o(
|
|
326
326
|
rt.Zero,
|
|
327
327
|
{
|
|
328
328
|
rpcs: e,
|
|
329
|
-
token:
|
|
330
|
-
onBalancesLoaded: (
|
|
329
|
+
token: l,
|
|
330
|
+
onBalancesLoaded: (c) => n(t, c)
|
|
331
331
|
},
|
|
332
|
-
Y(
|
|
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
|
|
341
|
-
return
|
|
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
|
|
353
|
-
new Set(a.map((
|
|
354
|
-
).filter((
|
|
355
|
-
return us(
|
|
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:
|
|
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: !!
|
|
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
|
-
|
|
378
|
-
}, [
|
|
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"]) && (
|
|
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((
|
|
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
|
-
}),
|
|
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(([
|
|
414
|
-
`intent-${
|
|
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:
|
|
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:
|
|
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
|
|
439
|
-
!e || !
|
|
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
|
|
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
|
|
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:
|
|
494
|
+
token: c
|
|
495
495
|
});
|
|
496
496
|
return;
|
|
497
497
|
}
|
|
498
498
|
const n = s.find(
|
|
499
|
-
(
|
|
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
|
-
(
|
|
507
|
-
),
|
|
508
|
-
(
|
|
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 ??
|
|
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:
|
|
536
|
-
} = y(),
|
|
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:
|
|
563
|
+
meta: { isDry: c, message: S }
|
|
564
564
|
});
|
|
565
565
|
}
|
|
566
566
|
const k = se({
|
|
567
567
|
addressType: s,
|
|
568
|
-
walletAddress:
|
|
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 = () =>
|
|
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:
|
|
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:
|
|
588
|
-
slippageTolerance:
|
|
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
|
|
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()),
|
|
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 =
|
|
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:
|
|
849
|
-
isDirectTokenOnNearDeposit:
|
|
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 || (
|
|
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 =
|
|
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:
|
|
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:
|
|
919
|
-
balances:
|
|
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
|
|
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:
|
|
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
|
-
|
|
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
|
-
}) :
|
|
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
|
|
1024
|
-
F(
|
|
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 ${
|
|
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.
|
|
1076
|
+
"[WIDGET] Debug mode is enabled (package version: 3.23.0)"
|
|
1073
1077
|
), Es(), ys({ debug: e }), _s({ debug: e });
|
|
1074
|
-
}),
|
|
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
|
|
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
|
-
},
|
|
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 (
|
|
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 (!
|
|
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:
|
|
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:
|
|
1246
|
-
msg:
|
|
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:
|
|
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:
|
|
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:
|
|
1306
|
+
receiver_id: l,
|
|
1303
1307
|
amount: n,
|
|
1304
|
-
msg:
|
|
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
|
-
}),
|
|
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 =
|
|
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:
|
|
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) :
|
|
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 ||
|
|
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
|
|
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:
|
|
1709
|
-
} = J(), { make:
|
|
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
|
|
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 ((
|
|
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),
|
|
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]),
|
|
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
|
-
|
|
1793
|
-
}, [
|
|
1796
|
+
l().then(a);
|
|
1797
|
+
}, [l]), {
|
|
1794
1798
|
isSwitchingChainRequired: n,
|
|
1795
|
-
switchChain:
|
|
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:
|
|
1879
|
-
isDirectNonNearWithdrawal:
|
|
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 && !
|
|
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
|
|
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" && !
|
|
1950
|
-
), s = t.map((n) => n.isIntent && n.symbol), r = e.filter((n) => n.isIntent && n.blockchain !== "near" && !s.includes(n.symbol) && !
|
|
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:
|
|
1964
|
-
|
|
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 =
|
|
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
|
|
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
|
|
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
|
-
},
|
|
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:
|
|
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[
|
|
2016
|
+
let i = Tt[c];
|
|
2013
2017
|
if (!i)
|
|
2014
|
-
if (G(
|
|
2018
|
+
if (G(c))
|
|
2015
2019
|
i = gt;
|
|
2016
2020
|
else
|
|
2017
2021
|
throw new M(
|
|
2018
|
-
`Unknown chain for POA deposit check ${
|
|
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
|
-
},
|
|
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:
|
|
2132
|
-
showQuickBalanceActions:
|
|
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 &&
|
|
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 &&
|
|
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
|
-
!
|
|
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
|
|
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:
|
|
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
|
|
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:
|
|
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 }),
|
|
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:
|
|
2380
|
+
onMsg: l
|
|
2377
2381
|
}) => {
|
|
2378
|
-
const { ctx:
|
|
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 &&
|
|
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 && !!
|
|
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:
|
|
2437
|
-
chainIsNotSupported:
|
|
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:
|
|
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:
|
|
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,
|
|
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:
|
|
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
|
-
},
|
|
2588
|
+
}, Pc = Object.assign(na, {
|
|
2585
2589
|
Placeholder: Ce,
|
|
2586
2590
|
Item: Vt
|
|
2587
|
-
}),
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
2614
|
-
errorColor:
|
|
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),
|
|
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
|
-
] }),
|
|
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
|
-
),
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
},
|
|
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
|
-
},
|
|
2807
|
-
Error:
|
|
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
|
-
},
|
|
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
|
|
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
|
|
2887
|
+
const c = Se({
|
|
2888
2888
|
...me,
|
|
2889
2889
|
...t
|
|
2890
2890
|
});
|
|
2891
|
-
Object.assign(
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
2933
|
+
Vc as W,
|
|
2934
2934
|
_s as X,
|
|
2935
2935
|
ys as Y,
|
|
2936
2936
|
bs as Z,
|
|
2937
2937
|
Es as _,
|
|
2938
|
-
|
|
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
|
-
|
|
2954
|
-
|
|
2953
|
+
ca as ae,
|
|
2954
|
+
la as af,
|
|
2955
2955
|
ma as ag,
|
|
2956
2956
|
Qe as ah,
|
|
2957
2957
|
_ as b,
|
|
2958
|
-
|
|
2958
|
+
Oc as c,
|
|
2959
2959
|
ms as d,
|
|
2960
|
-
|
|
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
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
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
|
-
|
|
2979
|
+
Fc as x,
|
|
2980
2980
|
y,
|
|
2981
|
-
|
|
2981
|
+
Wc as z
|
|
2982
2982
|
};
|
|
2983
|
-
//# sourceMappingURL=config-
|
|
2983
|
+
//# sourceMappingURL=config-0TjbjBo5.js.map
|