@rash2x/bridge-widget 0.6.88 → 0.6.90
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-jBqeTBVq.cjs → index-BjjPcq1z.cjs} +39 -9
- package/dist/index-BjjPcq1z.cjs.map +1 -0
- package/dist/{index-B_r-bHH6.cjs → index-Bozd3nbH.cjs} +2 -2
- package/dist/{index-B_r-bHH6.cjs.map → index-Bozd3nbH.cjs.map} +1 -1
- package/dist/{index-BTzxeBPr.js → index-DB-i0bUA.js} +39 -9
- package/dist/index-DB-i0bUA.js.map +1 -0
- package/dist/{index-BMZV69Vp.js → index-oe2eTWDB.js} +2 -2
- package/dist/{index-BMZV69Vp.js.map → index-oe2eTWDB.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BTzxeBPr.js.map +0 -1
- package/dist/index-jBqeTBVq.cjs.map +0 -1
package/dist/evaa-bridge.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-BjjPcq1z.cjs");
|
|
4
4
|
exports.DEFAULT_SLIPPAGE_BPS = index.DEFAULT_SLIPPAGE_BPS;
|
|
5
5
|
exports.EvaaBridge = index.EvaaBridge;
|
|
6
6
|
exports.RoutePriority = index.RoutePriority;
|
package/dist/evaa-bridge.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L, d, f, e, D, Q, H, z, W, U, w, s, v, r, p, q, G, Z, a5, $, a2, x, A, y, a0, B, _, a3, a4, S, a1, P, I, V, Y, a6, a7, J, K, X, F, N, t, o, i, u, l, m, j, n, h, k } from "./index-
|
|
1
|
+
import { L, d, f, e, D, Q, H, z, W, U, w, s, v, r, p, q, G, Z, a5, $, a2, x, A, y, a0, B, _, a3, a4, S, a1, P, I, V, Y, a6, a7, J, K, X, F, N, t, o, i, u, l, m, j, n, h, k } from "./index-DB-i0bUA.js";
|
|
2
2
|
export {
|
|
3
3
|
L as DEFAULT_SLIPPAGE_BPS,
|
|
4
4
|
d as EvaaBridge,
|
|
@@ -2226,6 +2226,11 @@ const isZeroAddr = (a2) => (
|
|
|
2226
2226
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2227
2227
|
!!a2 && /^0x0{40}$/i.test(a2) || /^0x[eE]{4}e{36}$/i.test(a2)
|
|
2228
2228
|
);
|
|
2229
|
+
function getDefaultDecimals(chainKey) {
|
|
2230
|
+
if (chainKey === "ton") return 9;
|
|
2231
|
+
if (chainKey === "tron") return 6;
|
|
2232
|
+
return 18;
|
|
2233
|
+
}
|
|
2229
2234
|
function addrForApi(chainKey, addr) {
|
|
2230
2235
|
if (chainKey === "ton") return tonNorm(addr);
|
|
2231
2236
|
return addr;
|
|
@@ -2245,9 +2250,10 @@ function isNativeAddrEqual(chain2, tokenAddr) {
|
|
|
2245
2250
|
}
|
|
2246
2251
|
function findNativeMeta(tokens, chain2) {
|
|
2247
2252
|
if (!chain2) return { decimals: 18, priceUsd: void 0 };
|
|
2253
|
+
const nativeDecimals = chain2.nativeCurrency.decimals;
|
|
2248
2254
|
const sym = normSym(chain2.nativeCurrency?.symbol);
|
|
2249
2255
|
if (!sym) {
|
|
2250
|
-
return { decimals:
|
|
2256
|
+
return { decimals: nativeDecimals, priceUsd: void 0 };
|
|
2251
2257
|
}
|
|
2252
2258
|
const sameChain = tokens?.find(
|
|
2253
2259
|
(t2) => t2.chainKey === chain2.chainKey && normSym(t2.symbol) === sym
|
|
@@ -2257,7 +2263,7 @@ function findNativeMeta(tokens, chain2) {
|
|
|
2257
2263
|
const anyChain = tokens?.find((t2) => normSym(t2.symbol) === sym);
|
|
2258
2264
|
if (anyChain)
|
|
2259
2265
|
return { decimals: anyChain.decimals, priceUsd: anyChain.price?.usd };
|
|
2260
|
-
return { decimals:
|
|
2266
|
+
return { decimals: nativeDecimals, priceUsd: void 0 };
|
|
2261
2267
|
}
|
|
2262
2268
|
function lookupTokenMeta(tokens, chains, chainKey, tokenAddr) {
|
|
2263
2269
|
if (!chainKey) return { decimals: 18, priceUsd: void 0 };
|
|
@@ -2275,7 +2281,10 @@ function lookupTokenMeta(tokens, chains, chainKey, tokenAddr) {
|
|
|
2275
2281
|
if (isNativeAddrEqual(chain2, tokenAddr)) {
|
|
2276
2282
|
return findNativeMeta(tokens, chain2);
|
|
2277
2283
|
}
|
|
2278
|
-
return {
|
|
2284
|
+
return {
|
|
2285
|
+
decimals: chain2?.nativeCurrency?.decimals ?? getDefaultDecimals(chainKey),
|
|
2286
|
+
priceUsd: void 0
|
|
2287
|
+
};
|
|
2279
2288
|
}
|
|
2280
2289
|
function computeFeesUsdFromArray(fees, tokens, chains) {
|
|
2281
2290
|
const emptyResult = {
|
|
@@ -2913,7 +2922,7 @@ const InfoIcon = (props) => {
|
|
|
2913
2922
|
};
|
|
2914
2923
|
const Tip = (props) => {
|
|
2915
2924
|
const { children, text } = props;
|
|
2916
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
|
|
2925
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { disableHoverableContent: true, children: [
|
|
2917
2926
|
/* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { className: "w-4 h-4 rounded-full bg-muted text-muted-foreground", children }),
|
|
2918
2927
|
/* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipContent, { className: "max-w-64", children: text })
|
|
2919
2928
|
] });
|
|
@@ -3961,6 +3970,30 @@ function useSilentValidations(amountString) {
|
|
|
3961
3970
|
status,
|
|
3962
3971
|
error
|
|
3963
3972
|
]);
|
|
3973
|
+
react.useEffect(() => {
|
|
3974
|
+
if (validationResult.isValidForTransfer) return;
|
|
3975
|
+
console.info("[SilentValidations] invalid", {
|
|
3976
|
+
amountString,
|
|
3977
|
+
hasTooManyDecimals: validationResult.hasTooManyDecimals,
|
|
3978
|
+
hasUnsupportedTokenPair: validationResult.hasUnsupportedTokenPair,
|
|
3979
|
+
hasInsufficientLiquidity: validationResult.hasInsufficientLiquidity,
|
|
3980
|
+
status,
|
|
3981
|
+
hasQuote: Boolean(quote),
|
|
3982
|
+
error,
|
|
3983
|
+
fromChainKey: fromChain?.chainKey,
|
|
3984
|
+
toChainKey: toChain?.chainKey,
|
|
3985
|
+
selectedAssetSymbol
|
|
3986
|
+
});
|
|
3987
|
+
}, [
|
|
3988
|
+
validationResult,
|
|
3989
|
+
amountString,
|
|
3990
|
+
status,
|
|
3991
|
+
quote,
|
|
3992
|
+
error,
|
|
3993
|
+
fromChain?.chainKey,
|
|
3994
|
+
toChain?.chainKey,
|
|
3995
|
+
selectedAssetSymbol
|
|
3996
|
+
]);
|
|
3964
3997
|
return validationResult;
|
|
3965
3998
|
}
|
|
3966
3999
|
function useTelegramRestriction() {
|
|
@@ -25728,7 +25761,7 @@ class WalletConnectModal {
|
|
|
25728
25761
|
}
|
|
25729
25762
|
async initUi() {
|
|
25730
25763
|
if (typeof window !== "undefined") {
|
|
25731
|
-
await Promise.resolve().then(() => require("./index-
|
|
25764
|
+
await Promise.resolve().then(() => require("./index-Bozd3nbH.cjs"));
|
|
25732
25765
|
const modal = document.createElement("wcm-modal");
|
|
25733
25766
|
document.body.insertAdjacentElement("beforeend", modal);
|
|
25734
25767
|
OptionsCtrl.setIsUiLoaded(true);
|
|
@@ -26174,9 +26207,6 @@ const EvaaBridgeWithProviders = (props) => {
|
|
|
26174
26207
|
const { disconnect: evmDisconnect } = wagmi.useDisconnect();
|
|
26175
26208
|
const { data: walletClient } = wagmi.useWalletClient();
|
|
26176
26209
|
const publicClient = wagmi.usePublicClient();
|
|
26177
|
-
console.log("tonApiKey", props.tonApiKey);
|
|
26178
|
-
console.log("tronApiKey", props.tronApiKey);
|
|
26179
|
-
console.log("walletConnectProjectId", props.walletConnectProjectId);
|
|
26180
26210
|
const {
|
|
26181
26211
|
address: tronAddress,
|
|
26182
26212
|
connected: tronConnected,
|
|
@@ -26485,4 +26515,4 @@ exports.useSettingsStore = useSettingsStore;
|
|
|
26485
26515
|
exports.useSwapModel = useSwapModel;
|
|
26486
26516
|
exports.useTokensStore = useTokensStore;
|
|
26487
26517
|
exports.useTransactionStore = useTransactionStore;
|
|
26488
|
-
//# sourceMappingURL=index-
|
|
26518
|
+
//# sourceMappingURL=index-BjjPcq1z.cjs.map
|