perp-cli 0.4.11 → 0.4.12

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.
@@ -140,30 +140,15 @@ export class LighterSpotAdapter {
140
140
  ?? res.accounts?.[0];
141
141
  if (!acct)
142
142
  return [];
143
- // Perp USDC balance (collateral / available for perp trading)
144
- balances.push({
145
- token: "USDC",
146
- total: String(acct.collateral ?? 0),
147
- available: String(acct.available_balance ?? 0),
148
- held: String(Math.max(0, Number(acct.collateral ?? 0) - Number(acct.available_balance ?? 0))),
149
- });
150
- // Spot token balances from the assets array
143
+ // Spot token balances from the assets array only.
144
+ // Perp USDC (collateral) is already reported by getBalance() — don't duplicate here.
151
145
  if (acct.assets && acct.assets.length > 0) {
152
146
  for (const asset of acct.assets) {
153
147
  const bal = parseFloat(asset.balance || "0");
154
148
  const locked = parseFloat(asset.locked_balance || "0");
155
- if (asset.symbol === "USDC") {
156
- // Add spot USDC as separate entry so caller can distinguish
157
- balances.push({
158
- token: "USDC_SPOT",
159
- total: asset.balance,
160
- available: String(bal - locked),
161
- held: asset.locked_balance,
162
- });
163
- }
164
- else if (bal > 0) {
149
+ if (bal > 0) {
165
150
  balances.push({
166
- token: asset.symbol,
151
+ token: asset.symbol === "USDC" ? "USDC_SPOT" : asset.symbol,
167
152
  total: asset.balance,
168
153
  available: String(bal - locked),
169
154
  held: asset.locked_balance,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perp-cli",
3
- "version": "0.4.11",
3
+ "version": "0.4.12",
4
4
  "description": "Multi-DEX Perpetual Futures CLI - Pacifica, Hyperliquid, Lighter",
5
5
  "bin": {
6
6
  "perp": "dist/index.js",