@rash2x/bridge-widget 0.6.28 → 0.6.30

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.
@@ -455,6 +455,7 @@ function resolveTokenOnChain(tokens, assetSymbol, chainKey) {
455
455
  }
456
456
  const initialState = {
457
457
  tokens: void 0,
458
+ allTokens: void 0,
458
459
  selectedToken: void 0,
459
460
  selectedAssetSymbol: void 0
460
461
  };
@@ -463,6 +464,9 @@ const useTokensStore = zustand.create((set2) => ({
463
464
  setTokens: (data) => {
464
465
  set2({ tokens: data, assetMatrix: buildAssetMatrix(data) });
465
466
  },
467
+ setAllTokens: (data) => {
468
+ set2({ allTokens: data });
469
+ },
466
470
  setSelectedToken: (data) => {
467
471
  set2({ selectedToken: data });
468
472
  },
@@ -1303,6 +1307,19 @@ function getRouteDisplayName(route) {
1303
1307
  if (routeLower.includes("v2")) return "Stargate V2";
1304
1308
  return route.split(/[/\-_]/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
1305
1309
  }
1310
+ const toSharedDecimals = (amount, fromDecimals, toDecimals) => {
1311
+ const value = BigInt(amount);
1312
+ const diff = BigInt(toDecimals) - BigInt(fromDecimals);
1313
+ if (diff === 0n) return value.toString();
1314
+ if (diff > 0n) return (value * 10n ** diff).toString();
1315
+ const divisor = 10n ** -diff;
1316
+ if (value % divisor !== 0n) {
1317
+ throw new Error(
1318
+ `Cannot convert amount ${amount} from ${fromDecimals} to ${toDecimals} decimals. Got dust: ${value % divisor}`
1319
+ );
1320
+ }
1321
+ return (value / divisor).toString();
1322
+ };
1306
1323
  function useBridgeQuote() {
1307
1324
  const { assetMatrix, selectedAssetSymbol } = useTokensStore();
1308
1325
  const { fromChain, toChain, chains } = useChainsStore();
@@ -1381,14 +1398,19 @@ function useBridgeQuote() {
1381
1398
  const dstAddrApi = addrForApi(toChain.chainKey, dstAddress);
1382
1399
  const dstNativeAmount = getDstNativeAmount(toChain.chainKey);
1383
1400
  const slippageDecimal = getSlippageDecimal();
1384
- const approximateMinLD = BigInt(srcAmountLD) * BigInt(9500) / BigInt(1e4);
1401
+ const dstAmountLD = toSharedDecimals(
1402
+ srcAmountLD,
1403
+ srcTokenOnFrom.decimals,
1404
+ dstTokenOnTo.decimals
1405
+ );
1406
+ const dstAmountMinLD = (BigInt(dstAmountLD) * BigInt(9500) / BigInt(1e4)).toString();
1385
1407
  const quoteRoute = await getQuotesByPriority({
1386
1408
  srcChainKey: fromChain.chainKey,
1387
1409
  dstChainKey: toChain.chainKey,
1388
1410
  srcToken: srcTokenOnFrom.address,
1389
1411
  dstToken: dstTokenOnTo.address,
1390
1412
  srcAmountLD,
1391
- dstAmountMinLD: approximateMinLD.toString(),
1413
+ dstAmountMinLD,
1392
1414
  srcAddress: srcAddrApi,
1393
1415
  dstAddress: dstAddrApi,
1394
1416
  dstNativeAmount,
@@ -2891,7 +2913,6 @@ const SwapSection = ({
2891
2913
  return formatUsd(amt * priceUsd);
2892
2914
  }, [amount, priceUsd]);
2893
2915
  const isUsdLoading = Boolean(amount && parseFloat(amount) > 0 && !priceUsd);
2894
- const isInsufficientBalance = !!(amount && balance.balance && parseFloat(amount) > balance.balance);
2895
2916
  const onChangeChain = react.useCallback(
2896
2917
  (c2) => {
2897
2918
  onSelect?.(c2);
@@ -2904,6 +2925,9 @@ const SwapSection = ({
2904
2925
  onAmountChange(balance.balance.toString());
2905
2926
  }
2906
2927
  }, [balance.balance, onAmountChange]);
2928
+ const isInsufficientBalance = react.useMemo(() => {
2929
+ return !!(isSource && amount && balance.balance && parseFloat(amount) > balance.balance);
2930
+ }, [amount, balance.balance, isSource]);
2907
2931
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2908
2932
  /* @__PURE__ */ jsxRuntime.jsxs(
2909
2933
  "div",
@@ -2960,7 +2984,7 @@ const SwapSection = ({
2960
2984
  addressType: isSource ? "src" : "dst"
2961
2985
  }
2962
2986
  ),
2963
- amount && balance.balance && parseFloat(amount) > balance.balance ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "leading-5 text-sm font-medium text-destructive", children: t2("transaction.insufficientBalance") }) : isUsdLoading ? /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-12 rounded-md" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "leading-5 text-sm font-medium text-muted-foreground", children: computedFiat })
2987
+ isInsufficientBalance ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "leading-5 text-sm font-medium text-destructive", children: t2("transaction.insufficientBalance") }) : isUsdLoading ? /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-12 rounded-md" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "leading-5 text-sm font-medium text-muted-foreground", children: computedFiat })
2964
2988
  ] })
2965
2989
  ]
2966
2990
  }
@@ -3016,13 +3040,7 @@ const AnotherAddress = () => {
3016
3040
  if (customDstAddress !== trimmed) {
3017
3041
  setCustomDstAddress(trimmed);
3018
3042
  }
3019
- }, [
3020
- isEnabled2,
3021
- trimmed,
3022
- isValid,
3023
- setCustomDstAddress,
3024
- customDstAddress
3025
- ]);
3043
+ }, [isEnabled2, trimmed, isValid, setCustomDstAddress, customDstAddress]);
3026
3044
  const onPaste = async () => {
3027
3045
  try {
3028
3046
  const text = await navigator.clipboard.readText?.() ?? "";
@@ -3079,9 +3097,7 @@ const AnotherAddress = () => {
3079
3097
  ),
3080
3098
  value && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: invalid ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-destructive", children: t2("bridge.addressDoesntMatch", {
3081
3099
  network: toChain?.name ?? "selected"
3082
- }) }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-muted-foreground", children: t2("bridge.checkBeforeTransfer", {
3083
- defaultValue: "Check correctness before transfer"
3084
- }) }) })
3100
+ }) }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-muted-foreground", children: t2("bridge.checkBeforeTransfer") }) })
3085
3101
  ] }),
3086
3102
  !value ? /* @__PURE__ */ jsxRuntime.jsx(
3087
3103
  button.Button,
@@ -4413,9 +4429,9 @@ const ProgressStep = ({
4413
4429
  title: t2("transaction.steps.completed")
4414
4430
  }
4415
4431
  ];
4416
- return /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogContent, { showCloseButton: false, className: "overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex relative flex-col gap-6 flex-1 items-center justify-start text-center bg-background p-6", children: [
4432
+ return /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogContent, { showCloseButton: false, className: "overflow-hidden md:max-w-[420px] p-10", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex relative flex-col gap-6 flex-1 items-center justify-start text-center bg-background p-6", children: [
4417
4433
  icon,
4418
- /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogHeader, { className: "pr-0", children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t2("transaction.inProgress") }) }),
4434
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2 pb-2 text-center", children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t2("transaction.inProgress") }) }),
4419
4435
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
4420
4436
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-5 top-5 bottom-5 border-l border-dashed border-foreground/50" }),
4421
4437
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-6 relative z-10", children: steps.map((step) => /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4440,10 +4456,10 @@ const FailedStep = ({
4440
4456
  }) => {
4441
4457
  const { current, reset } = useTransactionStore();
4442
4458
  const { t: t2 } = useBridgeTranslation();
4443
- return /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { showCloseButton: true, className: "overflow-hidden", children: [
4459
+ return /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { showCloseButton: true, className: "overflow-hidden md:max-w-[420px] p-10", children: [
4444
4460
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col relative gap-4 flex-1 items-center justify-start text-center", children: [
4445
4461
  icon,
4446
- /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogHeader, { className: "pr-0", children: [
4462
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pb-2 text-center", children: [
4447
4463
  /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t2("transaction.failed") }),
4448
4464
  current?.errorCode && /* @__PURE__ */ jsxRuntime.jsx(reactDialog.DialogDescription, { children: t2(
4449
4465
  `errors.${current.errorCode}`,
@@ -4555,10 +4571,10 @@ const SuccessStep = ({
4555
4571
  openTransactionInExplorer(srcChainKey, srcTxHash);
4556
4572
  }
4557
4573
  };
4558
- return /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { showCloseButton: true, className: "overflow-hidden", children: [
4574
+ return /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { showCloseButton: true, className: "overflow-hidden md:max-w-[420px] p-10", children: [
4559
4575
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 flex-1 justify-start items-center text-center bg-background", children: [
4560
4576
  icon,
4561
- /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogHeader, { className: "pr-0", children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t2("transaction.success") }) }),
4577
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2 pb-2 text-center", children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t2("transaction.success") }) }),
4562
4578
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full space-y-2 mt-4 relative z-10 pb-14", children: [
4563
4579
  metadata?.srcAmountHuman && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
4564
4580
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: t2("transaction.bridged") }),
@@ -4631,9 +4647,9 @@ const ConfirmStep = ({
4631
4647
  }) => {
4632
4648
  const { t: t2 } = useBridgeTranslation();
4633
4649
  const { formatTime } = useCountdown(90);
4634
- return /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogContent, { showCloseButton: false, className: "overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col relative gap-4 flex-1 items-center justify-start text-center", children: [
4650
+ return /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogContent, { showCloseButton: false, className: "overflow-hidden md:max-w-[420px] p-10", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col relative gap-4 flex-1 items-center justify-start text-center", children: [
4635
4651
  icon,
4636
- /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogHeader, { className: "pr-0", children: [
4652
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pb-2 text-center", children: [
4637
4653
  /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t2("transaction.confirm") }),
4638
4654
  /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogDescription, { children: t2("transaction.signTransaction") })
4639
4655
  ] }),
@@ -4662,7 +4678,7 @@ const StatusStepsDialog = ({
4662
4678
  return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open: true, onOpenChange: () => reset(), children: step });
4663
4679
  };
4664
4680
  const useTokens = () => {
4665
- const { setTokens, setSelectedToken, setSelectedAssetSymbol } = useTokensStore();
4681
+ const { setTokens, setAllTokens, setSelectedToken, setSelectedAssetSymbol } = useTokensStore();
4666
4682
  const query = reactQuery.useQuery({
4667
4683
  queryKey: ["tokens"],
4668
4684
  queryFn: () => getTokens(),
@@ -4672,20 +4688,24 @@ const useTokens = () => {
4672
4688
  // 30 минут
4673
4689
  gcTime: 60 * 6e4,
4674
4690
  // 1 час хранения в кэше
4675
- refetchOnWindowFocus: false,
4676
- select: (list) => list.filter((t2) => t2.isBridgeable === true)
4691
+ refetchOnWindowFocus: false
4677
4692
  });
4678
4693
  react.useEffect(() => {
4679
4694
  if (query.isSuccess && query.data?.length) {
4680
- setTokens(query.data);
4681
- const firstAsset = listAssetsForSelect(query.data)[0];
4695
+ setAllTokens(query.data);
4696
+ const bridgeableTokens = query.data.filter(
4697
+ (t2) => t2.isBridgeable === true
4698
+ );
4699
+ setTokens(bridgeableTokens);
4700
+ const firstAsset = listAssetsForSelect(bridgeableTokens)[0];
4682
4701
  setSelectedAssetSymbol(firstAsset?.symbol);
4683
- setSelectedToken(query.data[0]);
4702
+ setSelectedToken(bridgeableTokens[0]);
4684
4703
  }
4685
4704
  }, [
4686
4705
  query.isSuccess,
4687
4706
  query.data,
4688
4707
  setTokens,
4708
+ setAllTokens,
4689
4709
  setSelectedToken,
4690
4710
  setSelectedAssetSymbol
4691
4711
  ]);
@@ -6566,7 +6586,7 @@ const routePresets = [
6566
6586
  const SettingsModal = ({ isOpen, onClose }) => {
6567
6587
  const { t: t2 } = useBridgeTranslation();
6568
6588
  const { toChain } = useChainsStore();
6569
- const { tokens } = useTokensStore();
6589
+ const { allTokens } = useTokensStore();
6570
6590
  const {
6571
6591
  slippageBps,
6572
6592
  routePriority,
@@ -6580,9 +6600,14 @@ const SettingsModal = ({ isOpen, onClose }) => {
6580
6600
  (preset) => parseFloat(preset.replace("%", "")) === slippageBps / 100
6581
6601
  );
6582
6602
  const dstNativeToken = toChain?.nativeCurrency;
6583
- const nativeTokenPrice = tokens?.find(
6584
- (t22) => t22.chainKey === toChain?.chainKey && t22.symbol?.toLowerCase() === dstNativeToken?.symbol?.toLowerCase()
6585
- )?.price?.usd || 0;
6603
+ const nativeTokenPrice = (() => {
6604
+ if (!allTokens || !dstNativeToken?.symbol || !toChain?.chainKey) return 0;
6605
+ const token = allTokens.find(
6606
+ (t22) => t22.chainKey === toChain.chainKey && t22.symbol?.toUpperCase() === dstNativeToken.symbol.toUpperCase()
6607
+ );
6608
+ const price = token?.price?.usd;
6609
+ return typeof price === "number" && isFinite(price) && price > 0 ? price : 0;
6610
+ })();
6586
6611
  const gasDisplayAmount = gasPresetToDisplayAmount(
6587
6612
  gasPreset,
6588
6613
  toChain?.chainKey,
@@ -6596,96 +6621,103 @@ const SettingsModal = ({ isOpen, onClose }) => {
6596
6621
  );
6597
6622
  const activeBtn = "bg-primary hover:bg-primary/80 text-primary-foreground transition-colors";
6598
6623
  const notActiveBtn = "bg-accent hover:bg-accent/80 text-accent-foreground transition-colors";
6599
- return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { onOpenAutoFocus: (e2) => e2.preventDefault(), className: "p-10 pt-7", children: [
6600
- /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogHeader, { className: "text-left", children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { className: "text-2xl leading-8", children: t2("settings.title") }) }),
6601
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5", children: [
6602
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5", children: [
6603
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
6604
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
6605
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t2("settings.gasOnDestination") }),
6606
- /* @__PURE__ */ jsxRuntime.jsx(Tip, { text: t2("settings.gasOnDestinationDescription"), children: /* @__PURE__ */ jsxRuntime.jsx(InfoIcon, { className: "w-4 h-4 text-muted-foreground" }) })
6607
- ] }),
6608
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground text-sm font-medium leading-4", children: formatUsd(gasUsdValue) })
6609
- ] }),
6610
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
6611
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center w-1/3 gap-2 shrink-0", children: [
6612
- /* @__PURE__ */ jsxRuntime.jsx(
6613
- TokenSymbol,
6614
- {
6615
- symbol: dstNativeToken?.symbol || "eth",
6616
- className: "h-4 w-4 rounded-full",
6617
- alt: dstNativeToken?.symbol || t2("common.nativeToken", { defaultValue: "Native Token" })
6618
- }
6619
- ),
6620
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg text-foreground leading-5 font-semibold h-5", children: gasDisplayAmount % 1 === 0 ? gasDisplayAmount.toFixed(0) : gasDisplayAmount.toFixed(
6621
- gasDisplayAmount < 1e-3 ? 6 : 3
6622
- ) }) })
6624
+ return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(
6625
+ dialog.DialogContent,
6626
+ {
6627
+ onOpenAutoFocus: (e2) => e2.preventDefault(),
6628
+ className: "p-10 pt-7",
6629
+ children: [
6630
+ /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogHeader, { className: "text-left", children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { className: "text-2xl leading-8", children: t2("settings.title") }) }),
6631
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5", children: [
6632
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5", children: [
6633
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
6634
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
6635
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t2("settings.gasOnDestination") }),
6636
+ /* @__PURE__ */ jsxRuntime.jsx(Tip, { text: t2("settings.gasOnDestinationDescription"), children: /* @__PURE__ */ jsxRuntime.jsx(InfoIcon, { className: "w-4 h-4 text-muted-foreground" }) })
6637
+ ] }),
6638
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground text-sm font-medium leading-4", children: formatUsd(gasUsdValue) })
6639
+ ] }),
6640
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
6641
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center w-1/3 gap-2 shrink-0", children: [
6642
+ /* @__PURE__ */ jsxRuntime.jsx(
6643
+ TokenSymbol,
6644
+ {
6645
+ symbol: dstNativeToken?.symbol || "eth",
6646
+ className: "h-4 w-4 rounded-full",
6647
+ alt: dstNativeToken?.symbol || t2("common.nativeToken", { defaultValue: "Native Token" })
6648
+ }
6649
+ ),
6650
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg text-foreground leading-5 font-semibold h-5", children: gasDisplayAmount % 1 === 0 ? gasDisplayAmount.toFixed(0) : gasDisplayAmount.toFixed(
6651
+ gasDisplayAmount < 1e-3 ? 6 : 3
6652
+ ) }) })
6653
+ ] }),
6654
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: gasPresets.map((g2) => /* @__PURE__ */ jsxRuntime.jsx(
6655
+ badge.Badge,
6656
+ {
6657
+ onClick: () => setGasPreset(g2),
6658
+ className: utils$1.cn(
6659
+ "cursor-pointer h-7 rounded px-2",
6660
+ gasPreset === g2 ? activeBtn : notActiveBtn
6661
+ ),
6662
+ children: t2(`settings.gasPresets.${g2}`)
6663
+ },
6664
+ g2
6665
+ )) })
6666
+ ] })
6623
6667
  ] }),
6624
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: gasPresets.map((g2) => /* @__PURE__ */ jsxRuntime.jsx(
6625
- badge.Badge,
6626
- {
6627
- onClick: () => setGasPreset(g2),
6628
- className: utils$1.cn(
6629
- "cursor-pointer h-7 rounded px-2",
6630
- gasPreset === g2 ? activeBtn : notActiveBtn
6631
- ),
6632
- children: t2(`settings.gasPresets.${g2}`)
6633
- },
6634
- g2
6635
- )) })
6636
- ] })
6637
- ] }),
6638
- /* @__PURE__ */ jsxRuntime.jsx("hr", {}),
6639
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5", children: [
6640
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
6641
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
6642
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t2("settings.slippageTolerance") }),
6643
- /* @__PURE__ */ jsxRuntime.jsx(Tip, { text: t2("settings.slippageToleranceDescription"), children: /* @__PURE__ */ jsxRuntime.jsx(InfoIcon, { className: "w-4 h-4 text-muted-foreground" }) })
6668
+ /* @__PURE__ */ jsxRuntime.jsx("hr", {}),
6669
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5", children: [
6670
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
6671
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
6672
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t2("settings.slippageTolerance") }),
6673
+ /* @__PURE__ */ jsxRuntime.jsx(Tip, { text: t2("settings.slippageToleranceDescription"), children: /* @__PURE__ */ jsxRuntime.jsx(InfoIcon, { className: "w-4 h-4 text-muted-foreground" }) })
6674
+ ] }),
6675
+ slippageBps >= 500 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-xs font-medium", children: t2("settings.highSlippageWarning", {
6676
+ defaultValue: "High slippage warning"
6677
+ }) })
6678
+ ] }),
6679
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-6", children: [
6680
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg text-foreground leading-5 font-semibold h-5", children: slippagePercent }) }),
6681
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: slippagePresets.map((p2) => /* @__PURE__ */ jsxRuntime.jsx(
6682
+ badge.Badge,
6683
+ {
6684
+ onClick: () => {
6685
+ const bps = parseFloat(p2.replace("%", "")) * 100;
6686
+ setSlippageBps(bps);
6687
+ },
6688
+ className: utils$1.cn(
6689
+ "cursor-pointer h-7 rounded px-2",
6690
+ activeSlippagePreset === p2 ? activeBtn : notActiveBtn
6691
+ ),
6692
+ children: p2
6693
+ },
6694
+ p2
6695
+ )) })
6696
+ ] })
6644
6697
  ] }),
6645
- slippageBps >= 500 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-xs font-medium", children: t2("settings.highSlippageWarning", {
6646
- defaultValue: "High slippage warning"
6647
- }) })
6648
- ] }),
6649
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-6", children: [
6650
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg text-foreground leading-5 font-semibold h-5", children: slippagePercent }) }),
6651
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: slippagePresets.map((p2) => /* @__PURE__ */ jsxRuntime.jsx(
6652
- badge.Badge,
6653
- {
6654
- onClick: () => {
6655
- const bps = parseFloat(p2.replace("%", "")) * 100;
6656
- setSlippageBps(bps);
6698
+ /* @__PURE__ */ jsxRuntime.jsx("hr", {}),
6699
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5", children: [
6700
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
6701
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t2("settings.routePriority") }),
6702
+ /* @__PURE__ */ jsxRuntime.jsx(Tip, { text: t2("settings.routePriorityDescription"), children: /* @__PURE__ */ jsxRuntime.jsx(InfoIcon, { className: "w-4 h-4 text-muted-foreground" }) })
6703
+ ] }) }),
6704
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end gap-2", children: routePresets.map((r2) => /* @__PURE__ */ jsxRuntime.jsx(
6705
+ badge.Badge,
6706
+ {
6707
+ onClick: () => setRoutePriority(r2),
6708
+ className: utils$1.cn(
6709
+ "cursor-pointer h-7 rounded px-2",
6710
+ routePriority === r2 ? activeBtn : notActiveBtn
6711
+ ),
6712
+ children: t2(`settings.routePresets.${r2}`)
6657
6713
  },
6658
- className: utils$1.cn(
6659
- "cursor-pointer h-7 rounded px-2",
6660
- activeSlippagePreset === p2 ? activeBtn : notActiveBtn
6661
- ),
6662
- children: p2
6663
- },
6664
- p2
6665
- )) })
6714
+ r2
6715
+ )) })
6716
+ ] })
6666
6717
  ] })
6667
- ] }),
6668
- /* @__PURE__ */ jsxRuntime.jsx("hr", {}),
6669
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5", children: [
6670
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
6671
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t2("settings.routePriority") }),
6672
- /* @__PURE__ */ jsxRuntime.jsx(Tip, { text: t2("settings.routePriorityDescription"), children: /* @__PURE__ */ jsxRuntime.jsx(InfoIcon, { className: "w-4 h-4 text-muted-foreground" }) })
6673
- ] }) }),
6674
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end gap-2", children: routePresets.map((r2) => /* @__PURE__ */ jsxRuntime.jsx(
6675
- badge.Badge,
6676
- {
6677
- onClick: () => setRoutePriority(r2),
6678
- className: utils$1.cn(
6679
- "cursor-pointer h-7 rounded px-2",
6680
- routePriority === r2 ? activeBtn : notActiveBtn
6681
- ),
6682
- children: t2(`settings.routePresets.${r2}`)
6683
- },
6684
- r2
6685
- )) })
6686
- ] })
6687
- ] })
6688
- ] }) });
6718
+ ]
6719
+ }
6720
+ ) });
6689
6721
  };
6690
6722
  const TokenRow = ({
6691
6723
  symbol,
@@ -26106,7 +26138,7 @@ class WalletConnectModal {
26106
26138
  }
26107
26139
  async initUi() {
26108
26140
  if (typeof window !== "undefined") {
26109
- await Promise.resolve().then(() => require("./index-D6vg_rMM.cjs"));
26141
+ await Promise.resolve().then(() => require("./index-B2NEOySL.cjs"));
26110
26142
  const modal = document.createElement("wcm-modal");
26111
26143
  document.body.insertAdjacentElement("beforeend", modal);
26112
26144
  OptionsCtrl.setIsUiLoaded(true);
@@ -26835,6 +26867,7 @@ exports.getTokens = getTokens;
26835
26867
  exports.getTonBalances = getTonBalances;
26836
26868
  exports.getTronBalances = getTronBalances;
26837
26869
  exports.isNativeAddrEqual = isNativeAddrEqual;
26870
+ exports.isNativeAddress = isNativeAddress;
26838
26871
  exports.isZeroAddr = isZeroAddr;
26839
26872
  exports.listAssetsForSelect = listAssetsForSelect;
26840
26873
  exports.lookupTokenMeta = lookupTokenMeta;
@@ -26855,4 +26888,4 @@ exports.useSettingsStore = useSettingsStore;
26855
26888
  exports.useSwapModel = useSwapModel;
26856
26889
  exports.useTokensStore = useTokensStore;
26857
26890
  exports.useTransactionStore = useTransactionStore;
26858
- //# sourceMappingURL=index-CjIST-mb.cjs.map
26891
+ //# sourceMappingURL=index-sizFMy3I.cjs.map