@t2000/cli 1.23.0 → 1.23.1

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.
@@ -52,11 +52,13 @@ import {
52
52
  WBTC_TYPE,
53
53
  WRITE_APPENDER_REGISTRY,
54
54
  ZkLoginSigner,
55
+ addClaimRewardsToTx,
55
56
  addFeeTransfer,
56
57
  addSendToTx,
57
58
  addStakeVSuiToTx,
58
59
  addSwapToTx,
59
60
  addUnstakeVSuiToTx,
61
+ aggregateClaimableRewards,
60
62
  allDescriptors,
61
63
  assertAllowedAsset,
62
64
  buildAddLeafTx,
@@ -128,7 +130,7 @@ import {
128
130
  validateAddress,
129
131
  validateLabel,
130
132
  walletExists
131
- } from "./chunk-JKL4VB6Z.js";
133
+ } from "./chunk-IR2QGWUU.js";
132
134
  import "./chunk-Z74HUTKM.js";
133
135
  import "./chunk-V7PXDEKG.js";
134
136
  import "./chunk-UY3WLP52.js";
@@ -187,11 +189,13 @@ export {
187
189
  WBTC_TYPE,
188
190
  WRITE_APPENDER_REGISTRY,
189
191
  ZkLoginSigner,
192
+ addClaimRewardsToTx,
190
193
  addFeeTransfer,
191
194
  addSendToTx,
192
195
  addStakeVSuiToTx,
193
196
  addSwapToTx,
194
197
  addUnstakeVSuiToTx,
198
+ aggregateClaimableRewards,
195
199
  allDescriptors,
196
200
  assertAllowedAsset,
197
201
  buildAddLeafTx,
@@ -264,4 +268,4 @@ export {
264
268
  validateLabel,
265
269
  walletExists
266
270
  };
267
- //# sourceMappingURL=dist-4IHD5DO3.js.map
271
+ //# sourceMappingURL=dist-K2TQP3EL.js.map
@@ -136083,35 +136083,6 @@ async function vt(e, n) {
136083
136083
  );
136084
136084
  return await De(e, t, n);
136085
136085
  }
136086
- function wt(e) {
136087
- const n = /* @__PURE__ */ new Map();
136088
- e.forEach((r) => {
136089
- const t = r.assetId, a = r.option, s = `${t}-${a}-${r.rewardCoinType}-${r.market}`;
136090
- n.has(s) ? n.get(s).total += r.userClaimableReward : n.set(s, {
136091
- assetId: t,
136092
- rewardType: a,
136093
- coinType: r.rewardCoinType,
136094
- total: Number(r.userClaimableReward),
136095
- market: r.market
136096
- });
136097
- });
136098
- const o = /* @__PURE__ */ new Map();
136099
- for (const { assetId: r, rewardType: t, coinType: a, total: s, market: i } of n.values()) {
136100
- const c = `${r}-${t}-${i}`;
136101
- o.has(c) || o.set(c, { assetId: r, rewardType: t, market: i, rewards: /* @__PURE__ */ new Map() });
136102
- const u2 = o.get(c);
136103
- u2.rewards.set(a, (u2.rewards.get(a) || 0) + s);
136104
- }
136105
- return Array.from(o.values()).map((r) => ({
136106
- assetId: r.assetId,
136107
- rewardType: r.rewardType,
136108
- market: r.market,
136109
- rewards: Array.from(r.rewards.entries()).map(([t, a]) => ({
136110
- coinType: t,
136111
- available: a.toFixed(6)
136112
- }))
136113
- }));
136114
- }
136115
136086
  async function Ct(e, n, o) {
136116
136087
  const r = await R2({
136117
136088
  ...o,
@@ -136287,6 +136258,7 @@ async function Ct(e, n, o) {
136287
136258
  return a;
136288
136259
  }
136289
136260
  init_errors7();
136261
+ init_token_registry();
136290
136262
  var MIN_HEALTH_FACTOR = 1.5;
136291
136263
  function sdkOptions(client) {
136292
136264
  return { env: "prod", client, cacheTime: 0, disableCache: true };
@@ -136661,24 +136633,8 @@ async function getPendingRewards2(client, address2) {
136661
136633
  );
136662
136634
  }
136663
136635
  if (!rewards || rewards.length === 0) return [];
136664
- const summary = wt(rewards);
136665
- const result = [];
136666
- for (const s of summary) {
136667
- for (const rw of s.rewards) {
136668
- const available = Number(rw.available);
136669
- if (available <= 0) continue;
136670
- const symbol2 = rw.coinType.split("::").pop() ?? "UNKNOWN";
136671
- result.push({
136672
- protocol: "navi",
136673
- asset: String(s.assetId),
136674
- coinType: rw.coinType,
136675
- symbol: symbol2,
136676
- amount: available,
136677
- estimatedValueUsd: 0
136678
- });
136679
- }
136680
- }
136681
- return result;
136636
+ const claimable = rewards.filter((r) => Number(r.userClaimableReward) > 0);
136637
+ return aggregateClaimableRewards(claimable);
136682
136638
  }
136683
136639
  async function addClaimRewardsToTx(tx, client, address2) {
136684
136640
  let rewards;
@@ -136722,7 +136678,8 @@ function aggregateClaimableRewards(claimable) {
136722
136678
  for (const c of claimable) {
136723
136679
  const coinType = c.rewardCoinType;
136724
136680
  if (!coinType) continue;
136725
- const symbol2 = coinType.split("::").pop() ?? "REWARD";
136681
+ const meta3 = getCoinMeta(coinType);
136682
+ const symbol2 = meta3?.symbol ?? coinType.split("::").pop() ?? "REWARD";
136726
136683
  const amount2 = Number(c.userClaimableReward);
136727
136684
  if (!Number.isFinite(amount2) || amount2 <= 0) continue;
136728
136685
  const existing = aggregated.get(coinType);
@@ -139709,7 +139666,7 @@ ${context}
139709
139666
  })
139710
139667
  );
139711
139668
  }
139712
- var PKG_VERSION = "1.23.0";
139669
+ var PKG_VERSION = "1.23.1";
139713
139670
  console.log = (...args) => console.error("[log]", ...args);
139714
139671
  console.warn = (...args) => console.error("[warn]", ...args);
139715
139672
  async function startMcpServer(opts) {
@@ -139799,4 +139756,4 @@ axios/dist/node/axios.cjs:
139799
139756
  @scure/bip39/index.js:
139800
139757
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
139801
139758
  */
139802
- //# sourceMappingURL=dist-4BEH22UU.js.map
139759
+ //# sourceMappingURL=dist-K4ONVV5A.js.map