@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
|
@@ -806,15 +806,17 @@ function lookupTokenMeta(tokens, chains, chainKey, tokenAddr) {
|
|
|
806
806
|
}
|
|
807
807
|
function computeFeesUsdFromArray(fees, tokens, chains) {
|
|
808
808
|
const emptyResult = {
|
|
809
|
-
usd: /* @__PURE__ */ new Map(
|
|
809
|
+
usd: /* @__PURE__ */ new Map(),
|
|
810
|
+
human: /* @__PURE__ */ new Map(),
|
|
810
811
|
original: void 0
|
|
811
812
|
};
|
|
812
813
|
if (!fees?.length) return emptyResult;
|
|
813
814
|
let totalUsd = 0;
|
|
814
815
|
const byTypeUsd = /* @__PURE__ */ new Map();
|
|
815
|
-
const
|
|
816
|
+
const byTypeHuman = /* @__PURE__ */ new Map();
|
|
816
817
|
for (const f4 of fees) {
|
|
817
818
|
let usd = Number(f4.usd ?? 0);
|
|
819
|
+
let human = 0;
|
|
818
820
|
const amount = String(f4.amount ?? "0");
|
|
819
821
|
if (!usd) {
|
|
820
822
|
const { decimals, priceUsd } = lookupTokenMeta(
|
|
@@ -823,18 +825,18 @@ function computeFeesUsdFromArray(fees, tokens, chains) {
|
|
|
823
825
|
f4.chainKey,
|
|
824
826
|
f4.token
|
|
825
827
|
);
|
|
826
|
-
|
|
828
|
+
human = fromLD(amount, decimals);
|
|
827
829
|
usd = (priceUsd ?? 0) * human;
|
|
828
830
|
}
|
|
829
831
|
totalUsd += usd;
|
|
830
832
|
const type = (f4.type ?? "other").toLowerCase();
|
|
831
833
|
byTypeUsd.set(type, (byTypeUsd.get(type) ?? 0) + usd);
|
|
832
|
-
const existing =
|
|
834
|
+
const existing = byTypeHuman.get(type);
|
|
833
835
|
if (existing) {
|
|
834
|
-
existing.amount
|
|
836
|
+
existing.amount += human;
|
|
835
837
|
} else {
|
|
836
|
-
|
|
837
|
-
amount,
|
|
838
|
+
byTypeHuman.set(type, {
|
|
839
|
+
amount: human,
|
|
838
840
|
token: f4.token,
|
|
839
841
|
chainKey: f4.chainKey
|
|
840
842
|
});
|
|
@@ -843,6 +845,7 @@ function computeFeesUsdFromArray(fees, tokens, chains) {
|
|
|
843
845
|
byTypeUsd.set("total", totalUsd);
|
|
844
846
|
return {
|
|
845
847
|
usd: byTypeUsd,
|
|
848
|
+
human: byTypeHuman,
|
|
846
849
|
original: fees
|
|
847
850
|
};
|
|
848
851
|
}
|
|
@@ -25915,7 +25918,7 @@ class WalletConnectModal {
|
|
|
25915
25918
|
}
|
|
25916
25919
|
async initUi() {
|
|
25917
25920
|
if (typeof window !== "undefined") {
|
|
25918
|
-
await import("./index-
|
|
25921
|
+
await import("./index-Cef9fWsE.js");
|
|
25919
25922
|
const modal = document.createElement("wcm-modal");
|
|
25920
25923
|
document.body.insertAdjacentElement("beforeend", modal);
|
|
25921
25924
|
OptionsCtrl.setIsUiLoaded(true);
|
|
@@ -26666,4 +26669,4 @@ export {
|
|
|
26666
26669
|
getQuoteFees as y,
|
|
26667
26670
|
calculateMinReceived as z
|
|
26668
26671
|
};
|
|
26669
|
-
//# sourceMappingURL=index-
|
|
26672
|
+
//# sourceMappingURL=index-Tq5ST0yd.js.map
|