@t2000/cli 1.23.0 → 1.24.0

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,15 +52,18 @@ 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,
63
65
  buildClaimRewardsTx,
66
+ buildHarvestRewardsTx,
64
67
  buildRevokeLeafTx,
65
68
  buildSendTx,
66
69
  buildStakeVSuiTx,
@@ -128,7 +131,7 @@ import {
128
131
  validateAddress,
129
132
  validateLabel,
130
133
  walletExists
131
- } from "./chunk-JKL4VB6Z.js";
134
+ } from "./chunk-JDOIQPNR.js";
132
135
  import "./chunk-Z74HUTKM.js";
133
136
  import "./chunk-V7PXDEKG.js";
134
137
  import "./chunk-UY3WLP52.js";
@@ -187,15 +190,18 @@ export {
187
190
  WBTC_TYPE,
188
191
  WRITE_APPENDER_REGISTRY,
189
192
  ZkLoginSigner,
193
+ addClaimRewardsToTx,
190
194
  addFeeTransfer,
191
195
  addSendToTx,
192
196
  addStakeVSuiToTx,
193
197
  addSwapToTx,
194
198
  addUnstakeVSuiToTx,
199
+ aggregateClaimableRewards,
195
200
  allDescriptors,
196
201
  assertAllowedAsset,
197
202
  buildAddLeafTx,
198
203
  buildClaimRewardsTx,
204
+ buildHarvestRewardsTx,
199
205
  buildRevokeLeafTx,
200
206
  buildSendTx,
201
207
  buildStakeVSuiTx,
@@ -264,4 +270,4 @@ export {
264
270
  validateLabel,
265
271
  walletExists
266
272
  };
267
- //# sourceMappingURL=dist-4IHD5DO3.js.map
273
+ //# sourceMappingURL=dist-K2PP6BRN.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);
@@ -138422,6 +138379,9 @@ var T2000 = class _T2000 extends import_index2.default {
138422
138379
  };
138423
138380
  init_errors7();
138424
138381
  init_coinSelection();
138382
+ init_errors7();
138383
+ init_token_registry();
138384
+ init_cetus_swap();
138425
138385
  init_cetus_swap();
138426
138386
  init_volo();
138427
138387
  init_coinSelection();
@@ -139709,7 +139669,7 @@ ${context}
139709
139669
  })
139710
139670
  );
139711
139671
  }
139712
- var PKG_VERSION = "1.23.0";
139672
+ var PKG_VERSION = "1.24.0";
139713
139673
  console.log = (...args) => console.error("[log]", ...args);
139714
139674
  console.warn = (...args) => console.error("[warn]", ...args);
139715
139675
  async function startMcpServer(opts) {
@@ -139799,4 +139759,4 @@ axios/dist/node/axios.cjs:
139799
139759
  @scure/bip39/index.js:
139800
139760
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
139801
139761
  */
139802
- //# sourceMappingURL=dist-4BEH22UU.js.map
139762
+ //# sourceMappingURL=dist-KHZBBHJF.js.map