@t2000/cli 1.27.1 → 1.27.2

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.
@@ -79,6 +79,7 @@ import {
79
79
  deserializeCetusRoute,
80
80
  displayHandle,
81
81
  exportPrivateKey,
82
+ extractAllUserLegs,
82
83
  extractTransferDetails,
83
84
  extractTxCommands,
84
85
  extractTxSender,
@@ -138,7 +139,7 @@ import {
138
139
  validateLabel,
139
140
  verifyCetusRouteCoinMatch,
140
141
  walletExists
141
- } from "./chunk-V5GSOFGJ.js";
142
+ } from "./chunk-Y2HI3L2W.js";
142
143
  import "./chunk-NXTB2IJH.js";
143
144
  import "./chunk-OCLKPYUU.js";
144
145
  import "./chunk-6JATGRLJ.js";
@@ -227,6 +228,7 @@ export {
227
228
  deserializeCetusRoute,
228
229
  displayHandle,
229
230
  exportPrivateKey,
231
+ extractAllUserLegs,
230
232
  extractTransferDetails,
231
233
  extractTxCommands,
232
234
  extractTxSender,
@@ -287,4 +289,4 @@ export {
287
289
  verifyCetusRouteCoinMatch,
288
290
  walletExists
289
291
  };
290
- //# sourceMappingURL=dist-KIMZRUQE.js.map
292
+ //# sourceMappingURL=dist-NTKXLT3L.js.map
@@ -132799,6 +132799,26 @@ function extractTransferDetails(changes, sender) {
132799
132799
  function bigintAbs(n) {
132800
132800
  return n < 0n ? -n : n;
132801
132801
  }
132802
+ function extractAllUserLegs(changes, sender) {
132803
+ if (!changes || changes.length === 0) return [];
132804
+ const legs = [];
132805
+ for (const c of changes) {
132806
+ if (resolveOwner(c.owner) !== sender) continue;
132807
+ const raw = BigInt(c.amount);
132808
+ if (raw === 0n) continue;
132809
+ const decimals2 = getDecimalsForCoinType(c.coinType);
132810
+ const absAmount = bigintAbs(raw);
132811
+ legs.push({
132812
+ coinType: c.coinType,
132813
+ asset: resolveSymbol(c.coinType),
132814
+ decimals: decimals2,
132815
+ amount: Number(absAmount) / 10 ** decimals2,
132816
+ rawAmount: raw.toString(),
132817
+ direction: raw < 0n ? "out" : "in"
132818
+ });
132819
+ }
132820
+ return legs;
132821
+ }
132802
132822
  async function queryHistory(client, address2, limit = 20) {
132803
132823
  const txns = await client.queryTransactionBlocks({
132804
132824
  filter: { FromAddress: address2 },
@@ -132824,6 +132844,7 @@ function parseTxRecord(tx, address2) {
132824
132844
  const gasCost = gasUsed ? (Number(gasUsed.computationCost) + Number(gasUsed.storageCost) - Number(gasUsed.storageRebate)) / 1e9 : void 0;
132825
132845
  const { moveCallTargets, commandTypes } = extractCommands(tx.transaction);
132826
132846
  const balanceChanges = tx.balanceChanges ?? [];
132847
+ const legs = extractAllUserLegs(balanceChanges, address2);
132827
132848
  const { amount: amount2, asset, recipient, direction } = extractTransferDetails(balanceChanges, address2);
132828
132849
  const { action, label } = classifyTransaction(
132829
132850
  moveCallTargets,
@@ -132835,6 +132856,7 @@ function parseTxRecord(tx, address2) {
132835
132856
  digest: tx.digest,
132836
132857
  action,
132837
132858
  label,
132859
+ legs,
132838
132860
  amount: amount2,
132839
132861
  asset,
132840
132862
  recipient,
@@ -139829,7 +139851,7 @@ ${context}
139829
139851
  })
139830
139852
  );
139831
139853
  }
139832
- var PKG_VERSION = "1.27.1";
139854
+ var PKG_VERSION = "1.27.2";
139833
139855
  console.log = (...args) => console.error("[log]", ...args);
139834
139856
  console.warn = (...args) => console.error("[warn]", ...args);
139835
139857
  async function startMcpServer(opts) {
@@ -139919,4 +139941,4 @@ axios/dist/node/axios.cjs:
139919
139941
  @scure/bip39/index.js:
139920
139942
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
139921
139943
  */
139922
- //# sourceMappingURL=dist-TUAS5C2A.js.map
139944
+ //# sourceMappingURL=dist-VMYL2LVD.js.map