@rash2x/bridge-widget 0.6.11 → 0.6.12
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-RQ0L6QUd.cjs → index-BaoPDmAJ.cjs} +12 -9
- package/dist/index-BaoPDmAJ.cjs.map +1 -0
- package/dist/{index-C2SYTXUj.js → index-Cef9fWsE.js} +2 -2
- package/dist/{index-C2SYTXUj.js.map → index-Cef9fWsE.js.map} +1 -1
- package/dist/{index-CfetqPyg.cjs → index-OkGSl_M4.cjs} +2 -2
- package/dist/{index-CfetqPyg.cjs.map → index-OkGSl_M4.cjs.map} +1 -1
- package/dist/{index-DSkz0QIZ.js → index-Tq5ST0yd.js} +12 -9
- package/dist/index-Tq5ST0yd.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/package.json +1 -1
- package/dist/index-DSkz0QIZ.js.map +0 -1
- package/dist/index-RQ0L6QUd.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-BaoPDmAJ.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 { U, d, f, e, H, B, F, X, N, z, $, G, A, D, Z, w, s, v, r, p, q, L, a2, a9, a4, a6, x, I, y, a5, J, a3, a7, a8, Y, W, P, _, a1, aa, Q, S, a0, K, V, t, o, i, u, l, m, j, n, h, k } from "./index-
|
|
1
|
+
import { U, d, f, e, H, B, F, X, N, z, $, G, A, D, Z, w, s, v, r, p, q, L, a2, a9, a4, a6, x, I, y, a5, J, a3, a7, a8, Y, W, P, _, a1, aa, Q, S, a0, K, V, t, o, i, u, l, m, j, n, h, k } from "./index-Tq5ST0yd.js";
|
|
2
2
|
export {
|
|
3
3
|
U as DEFAULT_SLIPPAGE_BPS,
|
|
4
4
|
d as EvaaBridge,
|
|
@@ -807,15 +807,17 @@ function lookupTokenMeta(tokens, chains, chainKey, tokenAddr) {
|
|
|
807
807
|
}
|
|
808
808
|
function computeFeesUsdFromArray(fees, tokens, chains) {
|
|
809
809
|
const emptyResult = {
|
|
810
|
-
usd: /* @__PURE__ */ new Map(
|
|
810
|
+
usd: /* @__PURE__ */ new Map(),
|
|
811
|
+
human: /* @__PURE__ */ new Map(),
|
|
811
812
|
original: void 0
|
|
812
813
|
};
|
|
813
814
|
if (!fees?.length) return emptyResult;
|
|
814
815
|
let totalUsd = 0;
|
|
815
816
|
const byTypeUsd = /* @__PURE__ */ new Map();
|
|
816
|
-
const
|
|
817
|
+
const byTypeHuman = /* @__PURE__ */ new Map();
|
|
817
818
|
for (const f4 of fees) {
|
|
818
819
|
let usd = Number(f4.usd ?? 0);
|
|
820
|
+
let human = 0;
|
|
819
821
|
const amount = String(f4.amount ?? "0");
|
|
820
822
|
if (!usd) {
|
|
821
823
|
const { decimals, priceUsd } = lookupTokenMeta(
|
|
@@ -824,18 +826,18 @@ function computeFeesUsdFromArray(fees, tokens, chains) {
|
|
|
824
826
|
f4.chainKey,
|
|
825
827
|
f4.token
|
|
826
828
|
);
|
|
827
|
-
|
|
829
|
+
human = fromLD(amount, decimals);
|
|
828
830
|
usd = (priceUsd ?? 0) * human;
|
|
829
831
|
}
|
|
830
832
|
totalUsd += usd;
|
|
831
833
|
const type = (f4.type ?? "other").toLowerCase();
|
|
832
834
|
byTypeUsd.set(type, (byTypeUsd.get(type) ?? 0) + usd);
|
|
833
|
-
const existing =
|
|
835
|
+
const existing = byTypeHuman.get(type);
|
|
834
836
|
if (existing) {
|
|
835
|
-
existing.amount
|
|
837
|
+
existing.amount += human;
|
|
836
838
|
} else {
|
|
837
|
-
|
|
838
|
-
amount,
|
|
839
|
+
byTypeHuman.set(type, {
|
|
840
|
+
amount: human,
|
|
839
841
|
token: f4.token,
|
|
840
842
|
chainKey: f4.chainKey
|
|
841
843
|
});
|
|
@@ -844,6 +846,7 @@ function computeFeesUsdFromArray(fees, tokens, chains) {
|
|
|
844
846
|
byTypeUsd.set("total", totalUsd);
|
|
845
847
|
return {
|
|
846
848
|
usd: byTypeUsd,
|
|
849
|
+
human: byTypeHuman,
|
|
847
850
|
original: fees
|
|
848
851
|
};
|
|
849
852
|
}
|
|
@@ -25916,7 +25919,7 @@ class WalletConnectModal {
|
|
|
25916
25919
|
}
|
|
25917
25920
|
async initUi() {
|
|
25918
25921
|
if (typeof window !== "undefined") {
|
|
25919
|
-
await Promise.resolve().then(() => require("./index-
|
|
25922
|
+
await Promise.resolve().then(() => require("./index-OkGSl_M4.cjs"));
|
|
25920
25923
|
const modal = document.createElement("wcm-modal");
|
|
25921
25924
|
document.body.insertAdjacentElement("beforeend", modal);
|
|
25922
25925
|
OptionsCtrl.setIsUiLoaded(true);
|
|
@@ -26665,4 +26668,4 @@ exports.useSettingsStore = useSettingsStore;
|
|
|
26665
26668
|
exports.useSwapModel = useSwapModel;
|
|
26666
26669
|
exports.useTokensStore = useTokensStore;
|
|
26667
26670
|
exports.useTransactionStore = useTransactionStore;
|
|
26668
|
-
//# sourceMappingURL=index-
|
|
26671
|
+
//# sourceMappingURL=index-BaoPDmAJ.cjs.map
|