chore: remove deprecated VCU balance tracking

VCU is no longer used by Venice API - only DIEM and USD are relevant.

Co-authored-by: jonisjongithub <jonisjongithub@users.noreply.github.com>
Co-authored-by: Clawdbot <bot@clawd.bot>
This commit is contained in:
jonisjongithub 2026-01-28 00:00:58 -08:00
parent ccf41ec519
commit 82de7bdc21
2 changed files with 0 additions and 6 deletions

View File

@ -32,14 +32,12 @@ describe("venice-balance", () => {
const headers = new Headers(); const headers = new Headers();
headers.set("x-venice-balance-diem", "44.32116826"); headers.set("x-venice-balance-diem", "44.32116826");
headers.set("x-venice-balance-usd", "10.50"); headers.set("x-venice-balance-usd", "10.50");
headers.set("x-venice-balance-vcu", "1000");
const balance = extractVeniceBalance(headers); const balance = extractVeniceBalance(headers);
expect(balance).not.toBeNull(); expect(balance).not.toBeNull();
expect(balance?.diem).toBeCloseTo(44.32116826); expect(balance?.diem).toBeCloseTo(44.32116826);
expect(balance?.usd).toBeCloseTo(10.5); expect(balance?.usd).toBeCloseTo(10.5);
expect(balance?.vcu).toBeCloseTo(1000);
expect(balance?.lastChecked).toBeGreaterThan(0); expect(balance?.lastChecked).toBeGreaterThan(0);
}); });

View File

@ -4,7 +4,6 @@
* Extracts and tracks Venice API balance from response headers: * Extracts and tracks Venice API balance from response headers:
* - x-venice-balance-diem: DIEM token balance * - x-venice-balance-diem: DIEM token balance
* - x-venice-balance-usd: USD credit balance * - x-venice-balance-usd: USD credit balance
* - x-venice-balance-vcu: VCU balance
* *
* This module provides: * This module provides:
* - Balance extraction from response headers * - Balance extraction from response headers
@ -16,7 +15,6 @@
export interface VeniceBalance { export interface VeniceBalance {
diem?: number; diem?: number;
usd?: number; usd?: number;
vcu?: number;
lastChecked: number; lastChecked: number;
/** Provider identifier (for multi-key scenarios) */ /** Provider identifier (for multi-key scenarios) */
providerId?: string; providerId?: string;
@ -82,7 +80,6 @@ export function extractVeniceBalance(headers: Headers | Record<string, string>):
if (isNaN(diem)) return null; if (isNaN(diem)) return null;
const usdRaw = get("x-venice-balance-usd"); const usdRaw = get("x-venice-balance-usd");
const vcuRaw = get("x-venice-balance-vcu");
// Extract rate limit headers (tracks API key spending cap) // Extract rate limit headers (tracks API key spending cap)
const limitRequestsRaw = get("x-ratelimit-limit-requests"); const limitRequestsRaw = get("x-ratelimit-limit-requests");
@ -104,7 +101,6 @@ export function extractVeniceBalance(headers: Headers | Record<string, string>):
return { return {
diem, diem,
usd: usdRaw ? parseFloat(usdRaw) : undefined, usd: usdRaw ? parseFloat(usdRaw) : undefined,
vcu: vcuRaw ? parseFloat(vcuRaw) : undefined,
rateLimit, rateLimit,
lastChecked: Date.now(), lastChecked: Date.now(),
}; };