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