openzoo 0.7.0 → 0.7.1
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/config.js +23 -0
- package/lib/proxy.js +9 -1
- package/package.json +1 -1
package/lib/config.js
CHANGED
|
@@ -106,6 +106,29 @@ export function railFundingHint(liveRailNames) {
|
|
|
106
106
|
.join(' · ');
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* The contract addresses behind the funding hint, one row per live rail —
|
|
111
|
+
* "fund with USDC" is useless without the CA when every chain has a dozen
|
|
112
|
+
* impersonator mints named USDC. Same catalogs the balance command reads
|
|
113
|
+
* (FUNDING_ASSETS / EVM_FUNDING_ASSETS), so hint and addresses cannot drift.
|
|
114
|
+
*/
|
|
115
|
+
export function railFundingAddresses(liveRailNames) {
|
|
116
|
+
const rows = [];
|
|
117
|
+
for (const rail of liveRailNames || []) {
|
|
118
|
+
const spec = RAIL_FUNDING[rail];
|
|
119
|
+
if (!spec?.assets.length) continue;
|
|
120
|
+
const catalog = rail === 'solana'
|
|
121
|
+
? FUNDING_ASSETS.map((a) => ({ symbol: a.symbol, address: a.mint }))
|
|
122
|
+
: (EVM_FUNDING_ASSETS[rail] || []);
|
|
123
|
+
const assets = spec.assets
|
|
124
|
+
.map((sym) => catalog.find((a) => a.symbol === sym))
|
|
125
|
+
.filter(Boolean)
|
|
126
|
+
.map((a) => ({ symbol: a.symbol, address: a.address }));
|
|
127
|
+
if (assets.length) rows.push({ label: spec.label, assets });
|
|
128
|
+
}
|
|
129
|
+
return rows;
|
|
130
|
+
}
|
|
131
|
+
|
|
109
132
|
/**
|
|
110
133
|
* Rails the zoo is quoting right now that this shim cannot pay from a plain
|
|
111
134
|
* funded balance — named so a live rail never silently disappears from the
|
package/lib/proxy.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import http from 'node:http';
|
|
2
2
|
import { Readable } from 'node:stream';
|
|
3
3
|
import {
|
|
4
|
-
config, FUNDING_ASSETS, fundingLine, liveRails, railFundingHint, unfundableRails, RAIL_FUNDING,
|
|
4
|
+
config, FUNDING_ASSETS, fundingLine, liveRails, railFundingHint, railFundingAddresses, unfundableRails, RAIL_FUNDING,
|
|
5
5
|
} from './config.js';
|
|
6
6
|
import { PayClient, QuoteTooHighError, UnderfundedError } from './pay.js';
|
|
7
7
|
import { tokenBalance } from './x402.js';
|
|
@@ -227,6 +227,14 @@ export async function startProxy({ silent = false, requireToken = null, sessionM
|
|
|
227
227
|
// zoo can add a chain without this package shipping again.
|
|
228
228
|
const hint = railFundingHint(rails.live);
|
|
229
229
|
if (hint) console.log(`fund with: ${hint}`);
|
|
230
|
+
// The exact contracts those symbols mean — every chain has impersonator
|
|
231
|
+
// mints, so a symbol without its CA is an invitation to fund the wrong one.
|
|
232
|
+
for (const row of railFundingAddresses(rails.live)) {
|
|
233
|
+
row.assets.forEach((a, i) => {
|
|
234
|
+
const label = i === 0 ? row.label : '';
|
|
235
|
+
console.log(` ${label.padEnd(16)} ${a.symbol.padEnd(11)} ${a.address}`);
|
|
236
|
+
});
|
|
237
|
+
}
|
|
230
238
|
const unfundable = unfundableRails(rails.live);
|
|
231
239
|
if (unfundable.length) {
|
|
232
240
|
const fundable = rails.live.filter((r) => RAIL_FUNDING[r]?.assets.length).map((r) => RAIL_FUNDING[r].label);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
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",
|