@t2000/cli 0.46.8 → 0.46.10

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.
@@ -109,7 +109,7 @@ import {
109
109
  usdcToRaw,
110
110
  validateAddress,
111
111
  walletExists
112
- } from "./chunk-EGIY4JBI.js";
112
+ } from "./chunk-PUT73QY7.js";
113
113
  import "./chunk-V7PXDEKG.js";
114
114
  import "./chunk-Q2LY5BHK.js";
115
115
  import "./chunk-3XUF7GM3.js";
@@ -225,4 +225,4 @@ export {
225
225
  validateAddress,
226
226
  walletExists
227
227
  };
228
- //# sourceMappingURL=dist-MFJH54HH.js.map
228
+ //# sourceMappingURL=dist-7KHAKQT2.js.map
@@ -134756,22 +134756,39 @@ async function addClaimRewardsToTx(tx, client, address2) {
134756
134756
  (r) => Number(r.userClaimableReward) > 0
134757
134757
  );
134758
134758
  if (claimable.length === 0) return [];
134759
- const claimed = await Ct(tx, claimable, {
134759
+ await Ct(tx, claimable, {
134760
134760
  env: "prod",
134761
134761
  customCoinReceive: { type: "transfer", transfer: address2 }
134762
134762
  });
134763
- return claimed.map((c) => ({
134764
- protocol: "navi",
134765
- asset: "",
134766
- coinType: "",
134767
- symbol: "REWARD",
134768
- amount: 0,
134769
- estimatedValueUsd: 0
134770
- }));
134763
+ return aggregateClaimableRewards(claimable);
134771
134764
  } catch {
134772
134765
  return [];
134773
134766
  }
134774
134767
  }
134768
+ function aggregateClaimableRewards(claimable) {
134769
+ const aggregated = /* @__PURE__ */ new Map();
134770
+ for (const c of claimable) {
134771
+ const coinType = c.rewardCoinType;
134772
+ if (!coinType) continue;
134773
+ const symbol2 = coinType.split("::").pop() ?? "REWARD";
134774
+ const amount2 = Number(c.userClaimableReward);
134775
+ if (!Number.isFinite(amount2) || amount2 <= 0) continue;
134776
+ const existing = aggregated.get(coinType);
134777
+ if (existing) {
134778
+ existing.amount += amount2;
134779
+ } else {
134780
+ aggregated.set(coinType, {
134781
+ protocol: "navi",
134782
+ asset: String(c.assetId ?? ""),
134783
+ coinType,
134784
+ symbol: symbol2,
134785
+ amount: amount2,
134786
+ estimatedValueUsd: 0
134787
+ });
134788
+ }
134789
+ }
134790
+ return Array.from(aggregated.values());
134791
+ }
134775
134792
  async function getEarnings(client, address2) {
134776
134793
  const hf = await getHealthFactor(client, address2);
134777
134794
  const rates = await getRates(client);
@@ -138060,7 +138077,7 @@ ${context}
138060
138077
  })
138061
138078
  );
138062
138079
  }
138063
- var PKG_VERSION = "0.46.8";
138080
+ var PKG_VERSION = "0.46.10";
138064
138081
  console.log = (...args) => console.error("[log]", ...args);
138065
138082
  console.warn = (...args) => console.error("[warn]", ...args);
138066
138083
  async function startMcpServer(opts) {
@@ -138150,4 +138167,4 @@ axios/dist/node/axios.cjs:
138150
138167
  *)
138151
138168
  *)
138152
138169
  */
138153
- //# sourceMappingURL=dist-7MV3I2I7.js.map
138170
+ //# sourceMappingURL=dist-C2DPFH2K.js.map