openzoo 0.7.0 → 0.7.2
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 +27 -2
- package/lib/proxy.js +9 -1
- package/package.json +1 -1
package/lib/config.js
CHANGED
|
@@ -48,7 +48,9 @@ export const EVM_FUNDING_ASSETS = {
|
|
|
48
48
|
robinhood: [
|
|
49
49
|
{ symbol: 'USDG', address: '0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168', decimals: 6, usd: 1 },
|
|
50
50
|
{ symbol: 'ODDBALLER', address: '0x923eb7BD5B84a1a114CB57212cE2F2e87AE60E2A', decimals: 18, usd: null },
|
|
51
|
-
|
|
51
|
+
// note rides into the banner CA block: IOU is accepted by design, but its
|
|
52
|
+
// 402 row fails closed whenever DexScreener has no pool to price it from.
|
|
53
|
+
{ symbol: 'IOU', address: '0xf391999FACbEE613D4024191Dd31060540BF0bEd', decimals: 18, usd: null, note: 'accepted — quoting paused while its price feed is down' },
|
|
52
54
|
{ symbol: 'ROBINHOODS', address: '0xC42cF61C16aaC797b991cf9C1ac8Ae70bA74A286', decimals: 18, usd: null },
|
|
53
55
|
],
|
|
54
56
|
};
|
|
@@ -86,7 +88,7 @@ export const RAIL_FUNDING = {
|
|
|
86
88
|
base: { label: 'Base', assets: ['USDC'] },
|
|
87
89
|
robinhood: {
|
|
88
90
|
label: 'Robinhood Chain',
|
|
89
|
-
assets: ['USDG', 'ODDBALLER', 'ROBINHOODS'],
|
|
91
|
+
assets: ['USDG', 'ODDBALLER', 'IOU', 'ROBINHOODS'],
|
|
90
92
|
note: 'plus a sliver of RH ETH for the conversion gas',
|
|
91
93
|
},
|
|
92
94
|
};
|
|
@@ -106,6 +108,29 @@ export function railFundingHint(liveRailNames) {
|
|
|
106
108
|
.join(' · ');
|
|
107
109
|
}
|
|
108
110
|
|
|
111
|
+
/**
|
|
112
|
+
* The contract addresses behind the funding hint, one row per live rail —
|
|
113
|
+
* "fund with USDC" is useless without the CA when every chain has a dozen
|
|
114
|
+
* impersonator mints named USDC. Same catalogs the balance command reads
|
|
115
|
+
* (FUNDING_ASSETS / EVM_FUNDING_ASSETS), so hint and addresses cannot drift.
|
|
116
|
+
*/
|
|
117
|
+
export function railFundingAddresses(liveRailNames) {
|
|
118
|
+
const rows = [];
|
|
119
|
+
for (const rail of liveRailNames || []) {
|
|
120
|
+
const spec = RAIL_FUNDING[rail];
|
|
121
|
+
if (!spec?.assets.length) continue;
|
|
122
|
+
const catalog = rail === 'solana'
|
|
123
|
+
? FUNDING_ASSETS.map((a) => ({ symbol: a.symbol, address: a.mint }))
|
|
124
|
+
: (EVM_FUNDING_ASSETS[rail] || []);
|
|
125
|
+
const assets = spec.assets
|
|
126
|
+
.map((sym) => catalog.find((a) => a.symbol === sym))
|
|
127
|
+
.filter(Boolean)
|
|
128
|
+
.map((a) => ({ symbol: a.symbol, address: a.address, note: a.note }));
|
|
129
|
+
if (assets.length) rows.push({ label: spec.label, assets });
|
|
130
|
+
}
|
|
131
|
+
return rows;
|
|
132
|
+
}
|
|
133
|
+
|
|
109
134
|
/**
|
|
110
135
|
* Rails the zoo is quoting right now that this shim cannot pay from a plain
|
|
111
136
|
* 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}${a.note ? ` (${a.note})` : ''}`);
|
|
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.2",
|
|
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",
|