@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.
@@ -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([["total", 0]]),
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 byTypeOriginal = /* @__PURE__ */ new Map();
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
- const human = fromLD(amount, decimals);
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 = byTypeOriginal.get(type);
834
+ const existing = byTypeHuman.get(type);
833
835
  if (existing) {
834
- existing.amount = (BigInt(existing.amount) + BigInt(amount)).toString();
836
+ existing.amount += human;
835
837
  } else {
836
- byTypeOriginal.set(type, {
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-C2SYTXUj.js");
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-DSkz0QIZ.js.map
26672
+ //# sourceMappingURL=index-Tq5ST0yd.js.map