openzoo 0.50.84 → 0.50.86

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.
package/lib/models.js CHANGED
@@ -398,8 +398,13 @@ export function augmentModelList(payload, { aliases: withAliases = true } = {})
398
398
  }
399
399
  }
400
400
 
401
- // Auto is no longer published: routing lives on the backend, and a shim
402
- // that advertises openzoo/auto would have to route it.
401
+ // CONTRACT (clarified 2026-09-02, prompted by a downstream reviewer reading
402
+ // the old comment here as "auto is gone"): the SHIM no longer mints an auto
403
+ // row of its own — routing lives on the backend — but the backend's catalog
404
+ // still carries `openzoo/auto` / `openzoo-auto` / `auto`, they pass through
405
+ // `data` untouched, and the gateway routes them on the wire. Measured on
406
+ // 0.50.84: /v1/models lists all three, and a paid `model:"auto"` completion
407
+ // returns 200. Integrators may rely on auto being published and routed.
403
408
  return { ...payload, object: payload?.object || 'list', data: [...data, ...aliases, ...bare, ...family] };
404
409
  }
405
410
 
package/lib/x402.js CHANGED
@@ -120,12 +120,22 @@ export function paymentHeaders(header) {
120
120
  return { 'PAYMENT-SIGNATURE': header, 'X-PAYMENT': header };
121
121
  }
122
122
 
123
- const EVM_NAME_CHAINS = { base: 8453, 'base-sepolia': 84532 };
123
+ const EVM_NAME_CHAINS = { base: 8453, 'base-sepolia': 84532, polygon: 137, avalanche: 43114 };
124
+ /** x402 v1 network names → CAIP-2. A v1-style 402 says "solana"/"base"; our
125
+ * facilitator's /nonce and the gateway's verify speak CAIP-2. Either form is
126
+ * accepted here so a seller can switch its v1 body to v1 names without
127
+ * stranding this client. */
128
+ const V1_TO_CAIP2 = {
129
+ solana: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
130
+ 'solana-devnet': 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1',
131
+ base: 'eip155:8453', 'base-sepolia': 'eip155:84532', polygon: 'eip155:137', avalanche: 'eip155:43114',
132
+ };
133
+ export function toCaip2(network) { return V1_TO_CAIP2[network] || network || ''; }
124
134
 
125
135
  /** Which rail an accepts[] row settles on: 'solana' | 'base' | 'robinhood' | 'evm' | null. */
126
136
  export function railOf(accept) {
127
137
  const net = accept?.network || '';
128
- if (net.startsWith('solana:')) return 'solana';
138
+ if (net.startsWith('solana:') || net === 'solana' || net === 'solana-devnet') return 'solana';
129
139
  const m = /^eip155:(\d+)$/.exec(net);
130
140
  const chainId = m ? Number(m[1]) : EVM_NAME_CHAINS[net];
131
141
  if (chainId === 8453 || chainId === 84532) return 'base';
@@ -302,7 +312,11 @@ export function buildPayment({ accept, decimals, programId, recentBlockhash, key
302
312
  }));
303
313
  }
304
314
  tx.add(ComputeBudgetProgram.setComputeUnitLimit({ units: 200_000 }));
305
- tx.add(ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1 }));
315
+ // MEASURED 2026-08-29 17Z–08-30 02Z: 254 shim-signed settlements broadcast
316
+ // and never included in nine hours of congestion. 1 microLamport is "please
317
+ // ignore me"; the gateway's own builder pays 100k (~0.00002 SOL per call)
318
+ // and lands. Same number here.
319
+ tx.add(ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 100_000 }));
306
320
  tx.add(createTransferCheckedInstruction(
307
321
  source, mint, dest, keypair.publicKey, amount, decimals, [], programId,
308
322
  ));
@@ -385,7 +399,7 @@ export async function buildPaymentOnline(connection, keypair, accept) {
385
399
  // OPENZOO_NONCE=0 is the kill switch back to recent blockhashes.
386
400
  if (facilitator && process.env.OPENZOO_NONCE !== '0') {
387
401
  try {
388
- const r = await fetch(`${facilitator}/nonce?network=${encodeURIComponent(accept.network)}`, {
402
+ const r = await fetch(`${facilitator}/nonce?network=${encodeURIComponent(toCaip2(accept.network))}`, {
389
403
  signal: AbortSignal.timeout(4000),
390
404
  });
391
405
  if (r.ok) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.50.84",
3
+ "version": "0.50.86",
4
4
  "description": "Local x402-paying proxy + MCP server for openzoo.fun — point any OpenAI-compatible harness (Cursor, Claude Code, aider, SDKs) at localhost and it pays per call from a local burner wallet. Solana and Base rails live; Robinhood experimental.",
5
5
  "license": "MIT",
6
6
  "type": "module",