openzoo 0.4.0 → 0.4.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/pay.js +7 -0
- package/lib/proxy.js +2 -1
- package/package.json +1 -1
package/lib/pay.js
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
receiptLine, decodeSettleHeader,
|
|
8
8
|
} from './x402.js';
|
|
9
9
|
import { buildEvmPayment } from './evm.js';
|
|
10
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
10
11
|
import {
|
|
11
12
|
resolvePool, poolState, depositForShares, buildWrapInstructions, sendWrap,
|
|
12
13
|
} from './wrap.js';
|
|
@@ -50,6 +51,12 @@ export class PayClient {
|
|
|
50
51
|
|
|
51
52
|
get address() { return this.keypair.publicKey.toBase58(); }
|
|
52
53
|
|
|
54
|
+
/** The EVM address the Base / Robinhood rails pay from — same wallet file. */
|
|
55
|
+
get evmAddress() {
|
|
56
|
+
if (!this.evmPrivateKey) return null;
|
|
57
|
+
try { return privateKeyToAccount(this.evmPrivateKey).address; } catch { return null; }
|
|
58
|
+
}
|
|
59
|
+
|
|
53
60
|
async buildPaymentFor(accept, onStage) {
|
|
54
61
|
const rail = railOf(accept);
|
|
55
62
|
if (rail === 'solana') {
|
package/lib/proxy.js
CHANGED
|
@@ -177,7 +177,8 @@ export async function startProxy({ silent = false } = {}) {
|
|
|
177
177
|
console.log(`listening on http://localhost:${config.port}/v1`);
|
|
178
178
|
console.log('');
|
|
179
179
|
if (client.walletCreated) console.log(`new burner wallet created at ${client.walletPath} (chmod 600)`);
|
|
180
|
-
console.log(`wallet (fund me): ${client.address}`);
|
|
180
|
+
console.log(`wallet (fund me) · solana: ${client.address}`);
|
|
181
|
+
if (client.evmAddress) console.log(`wallet (fund me) · evm (base / robinhood): ${client.evmAddress}`);
|
|
181
182
|
try {
|
|
182
183
|
const bals = await Promise.all(
|
|
183
184
|
FUNDING_ASSETS.map((a) => tokenBalance(client.connection, client.keypair.publicKey, a.mint)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.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 rail live; Base/Robinhood rails experimental.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|