@rash2x/bridge-widget 0.6.51 → 0.6.53

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.
@@ -2770,8 +2770,6 @@ const WalletInlineButton = ({
2770
2770
  const connection = chainRegistry.getStrategyByType(walletType);
2771
2771
  const account = connection?.getAccount();
2772
2772
  const isConnected = connection?.isConnected();
2773
- const isConnecting = connection?.isConnecting();
2774
- const isInitialized = connection?.isInitialized() ?? true;
2775
2773
  const error = connection?.getError();
2776
2774
  const availableConnections = useMemo(
2777
2775
  () => connection?.getAvailableConnections() ?? [],
@@ -2794,14 +2792,11 @@ const WalletInlineButton = ({
2794
2792
  onOpen(addressType);
2795
2793
  }, [onOpen, addressType]);
2796
2794
  const buttonText = useMemo(() => {
2797
- if ((wallet === "metamask" || wallet === "tronlink") && !isInitialized)
2798
- return t2("common.initializing");
2799
- if (isConnecting) return t2("common.connecting");
2800
2795
  if (isConnected && account) return formatAddress(account);
2801
2796
  if (wallet === "ton") return t2("wallets.addTonWallet");
2802
2797
  if (wallet === "tronlink") return t2("wallets.addTronWallet");
2803
2798
  return t2("wallets.addEvmWallet");
2804
- }, [wallet, isInitialized, isConnecting, isConnected, account, t2]);
2799
+ }, [wallet, isConnected, account, t2]);
2805
2800
  const connectedIcon = useMemo(() => {
2806
2801
  if (!isConnected) return null;
2807
2802
  if (walletType === "tron" && activeTronConnection) {
@@ -2818,7 +2813,7 @@ const WalletInlineButton = ({
2818
2813
  }
2819
2814
  return prefixIcons[wallet];
2820
2815
  }, [activeTronConnection, evmConnectorId, isConnected, wallet, walletType]);
2821
- const isButtonDisabled = (wallet === "metamask" || wallet === "tronlink") && !isInitialized || isConnecting || addressType === "dst" && isCustomAddressEnabled;
2816
+ const isButtonDisabled = addressType === "dst" && isCustomAddressEnabled;
2822
2817
  return /* @__PURE__ */ jsxs("div", { className: "inline-flex flex-col items-start gap-1", children: [
2823
2818
  /* @__PURE__ */ jsxs(
2824
2819
  Button,
@@ -3147,12 +3142,6 @@ const TokenSymbol = ({
3147
3142
  const src2 = `${BASE_URL}/${normalizedSymbol}.svg`;
3148
3143
  return /* @__PURE__ */ jsx("img", { src: src2, alt: alt ?? symbol, className });
3149
3144
  };
3150
- function getSimpleFallback(chainKey) {
3151
- const key = chainKey.toLowerCase();
3152
- if (key === "ton") return 0.15;
3153
- if (key === "tron") return 10;
3154
- return 2e-3;
3155
- }
3156
3145
  function useGasEstimate(amountNum) {
3157
3146
  const { fromChain } = useChainsStore();
3158
3147
  const { selectedAssetSymbol } = useTokensStore();
@@ -3189,7 +3178,7 @@ function useGasEstimate(amountNum) {
3189
3178
  if (quoteFees && quoteSrcChainKey === chainKey) {
3190
3179
  const fees = quoteFees;
3191
3180
  const feesInNative = fees.filter(
3192
- (f4) => f4.chainKey === chainKey && f4.token === nativeCurrencyAddress
3181
+ (f4) => f4.chainKey === chainKey && f4.token === nativeCurrencyAddress && f4.type === "network"
3193
3182
  ).reduce(
3194
3183
  (sum, f4) => sum + BigInt(f4.amount || "0"),
3195
3184
  0n
@@ -3197,8 +3186,6 @@ function useGasEstimate(amountNum) {
3197
3186
  const decimals = nativeCurrencyDecimals || 18;
3198
3187
  requiredNative = Number(feesInNative) / Math.pow(10, decimals);
3199
3188
  quoteFeesAvailable = true;
3200
- } else {
3201
- requiredNative = getSimpleFallback(chainKey);
3202
3189
  }
3203
3190
  let hasEnoughGas = true;
3204
3191
  if (isNativeSelected) {
@@ -26249,7 +26236,7 @@ class WalletConnectModal {
26249
26236
  }
26250
26237
  async initUi() {
26251
26238
  if (typeof window !== "undefined") {
26252
- await import("./index-Dl3Nclhp.js");
26239
+ await import("./index-C_cDfEeV.js");
26253
26240
  const modal = document.createElement("wcm-modal");
26254
26241
  document.body.insertAdjacentElement("beforeend", modal);
26255
26242
  OptionsCtrl.setIsUiLoaded(true);
@@ -26297,7 +26284,7 @@ const TRON_MAINNET_CHAIN_ID = "tron:0x2b6653dc";
26297
26284
  const CONNECTION_TIMEOUT = 6e4;
26298
26285
  function useTronWalletConnect(projectId) {
26299
26286
  const { address, isConnected, isConnecting } = useTronWalletConnectStore();
26300
- const { setAddress, setIsConnecting, setActions, reset } = useTronWalletConnectStore();
26287
+ const { setAddress, setActions, reset } = useTronWalletConnectStore();
26301
26288
  const providerRef = useRef(null);
26302
26289
  const modalRef = useRef(null);
26303
26290
  const abortControllerRef = useRef(null);
@@ -26397,7 +26384,6 @@ function useTronWalletConnect(projectId) {
26397
26384
  }
26398
26385
  abortControllerRef.current = new AbortController();
26399
26386
  const abortController = abortControllerRef.current;
26400
- setIsConnecting(true);
26401
26387
  try {
26402
26388
  const connectionPromise = providerRef.current.connect({
26403
26389
  namespaces: {
@@ -26444,10 +26430,9 @@ function useTronWalletConnect(projectId) {
26444
26430
  }
26445
26431
  throw error;
26446
26432
  } finally {
26447
- setIsConnecting(false);
26448
26433
  abortControllerRef.current = null;
26449
26434
  }
26450
- }, [setAddress, setIsConnecting]);
26435
+ }, [setAddress]);
26451
26436
  const cancelConnection = useCallback(() => {
26452
26437
  if (abortControllerRef.current) {
26453
26438
  abortControllerRef.current.abort();
@@ -27024,4 +27009,4 @@ export {
27024
27009
  getQuoteFees as y,
27025
27010
  calculateMinReceived as z
27026
27011
  };
27027
- //# sourceMappingURL=index-CvJ9R4nQ.js.map
27012
+ //# sourceMappingURL=index-CePOaHyN.js.map