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