@t2000/sdk 5.4.0 → 5.5.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.
@@ -641,14 +641,33 @@ interface SuiHolding {
641
641
  /** USD value of the SUI holding. */
642
642
  usdValue: number;
643
643
  }
644
+ /**
645
+ * A non-stable, non-SUI coin held in the wallet (e.g. a token swapped into).
646
+ * `usdValue` is `null` — the SDK only prices stables ($1) + SUI (Cetus oracle);
647
+ * arbitrary tokens have no price feed (no BlockVision), so we surface the
648
+ * amount honestly rather than guessing a USD value.
649
+ */
650
+ interface TokenHolding {
651
+ coinType: string;
652
+ symbol: string;
653
+ amount: number;
654
+ usdValue: number | null;
655
+ }
644
656
  interface BalanceResponse {
645
657
  /** Spendable stablecoins keyed by symbol (USDC, USDsui) — gasless to send/pay. */
646
658
  stables: Record<string, number>;
647
659
  /** Sum of spendable stables in USD. Used for send/pay pre-checks. */
648
660
  available: number;
649
- /** SUI holding — used for swaps (and any non-gasless gas). Not a "reserve". */
661
+ /** SUI holding — gas for swaps + any non-gasless op. Not a "reserve". */
650
662
  sui: SuiHolding;
651
- /** Total wallet value in USD (available + sui.usdValue). */
663
+ /** Other held coins (anything not a stable or SUI) — amount-only, `usdValue: null`. */
664
+ tokens: TokenHolding[];
665
+ /**
666
+ * Total wallet value in USD — **priced holdings only** (stables + SUI). Tokens
667
+ * with `usdValue: null` are listed in `tokens` but NOT summed here, so the
668
+ * total never overstates by guessing a price. `tokens.length > 0` signals
669
+ * there's more in the wallet than the USD total reflects.
670
+ */
652
671
  totalUsd: number;
653
672
  }
654
673
  interface SendResult {
@@ -641,14 +641,33 @@ interface SuiHolding {
641
641
  /** USD value of the SUI holding. */
642
642
  usdValue: number;
643
643
  }
644
+ /**
645
+ * A non-stable, non-SUI coin held in the wallet (e.g. a token swapped into).
646
+ * `usdValue` is `null` — the SDK only prices stables ($1) + SUI (Cetus oracle);
647
+ * arbitrary tokens have no price feed (no BlockVision), so we surface the
648
+ * amount honestly rather than guessing a USD value.
649
+ */
650
+ interface TokenHolding {
651
+ coinType: string;
652
+ symbol: string;
653
+ amount: number;
654
+ usdValue: number | null;
655
+ }
644
656
  interface BalanceResponse {
645
657
  /** Spendable stablecoins keyed by symbol (USDC, USDsui) — gasless to send/pay. */
646
658
  stables: Record<string, number>;
647
659
  /** Sum of spendable stables in USD. Used for send/pay pre-checks. */
648
660
  available: number;
649
- /** SUI holding — used for swaps (and any non-gasless gas). Not a "reserve". */
661
+ /** SUI holding — gas for swaps + any non-gasless op. Not a "reserve". */
650
662
  sui: SuiHolding;
651
- /** Total wallet value in USD (available + sui.usdValue). */
663
+ /** Other held coins (anything not a stable or SUI) — amount-only, `usdValue: null`. */
664
+ tokens: TokenHolding[];
665
+ /**
666
+ * Total wallet value in USD — **priced holdings only** (stables + SUI). Tokens
667
+ * with `usdValue: null` are listed in `tokens` but NOT summed here, so the
668
+ * total never overstates by guessing a price. `tokens.length > 0` signals
669
+ * there's more in the wallet than the USD total reflects.
670
+ */
652
671
  totalUsd: number;
653
672
  }
654
673
  interface SendResult {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t2000/sdk",
3
- "version": "5.4.0",
3
+ "version": "5.5.0",
4
4
  "description": "TypeScript SDK for Agent Wallets on Sui — gasless USDC + USDsui transfers, Cetus swap routing, NAVI lending (programmatic), MPP paid API access, zkLogin compatible.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",