Skip to content

Commit bef7d0d

Browse files
MajorTalclaude
andcommitted
Register both Base mainnet and Sepolia in x402 client, bump to v1.13.5
paid-fetch.mjs now registers eip155:8453 (mainnet) alongside eip155:84532 (Sepolia) so payments settle on whichever network the server offers. This enables CDP Bazaar indexing via mainnet settlements. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c59b9bf commit bef7d0d

4 files changed

Lines changed: 13 additions & 8 deletions

File tree

cli/lib/paid-fetch.mjs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
22
* Shared x402 payment wrapper for CLI commands that need paid fetch.
33
* Uses viem for allowance signing + @x402/fetch for payment wrapping.
4+
* Registers both Base mainnet (eip155:8453) and Base Sepolia (eip155:84532)
5+
* so the x402 client matches whichever network the server offers.
46
*/
57

68
import { readAllowance, ALLOWANCE_FILE } from "./config.mjs";
@@ -14,14 +16,17 @@ export async function setupPaidFetch() {
1416
const allowance = readAllowance();
1517
const { privateKeyToAccount } = await import("viem/accounts");
1618
const { createPublicClient, http } = await import("viem");
17-
const { baseSepolia } = await import("viem/chains");
19+
const { base, baseSepolia } = await import("viem/chains");
1820
const { x402Client, wrapFetchWithPayment } = await import("@x402/fetch");
1921
const { ExactEvmScheme } = await import("@x402/evm/exact/client");
2022
const { toClientEvmSigner } = await import("@x402/evm");
2123
const account = privateKeyToAccount(allowance.privateKey);
22-
const publicClient = createPublicClient({ chain: baseSepolia, transport: http() });
23-
const signer = toClientEvmSigner(account, publicClient);
24+
25+
const mainnetClient = createPublicClient({ chain: base, transport: http() });
26+
const sepoliaClient = createPublicClient({ chain: baseSepolia, transport: http() });
27+
2428
const client = new x402Client();
25-
client.register("eip155:84532", new ExactEvmScheme(signer));
29+
client.register("eip155:8453", new ExactEvmScheme(toClientEvmSigner(account, mainnetClient)));
30+
client.register("eip155:84532", new ExactEvmScheme(toClientEvmSigner(account, sepoliaClient)));
2631
return wrapFetchWithPayment(fetch, client);
2732
}

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "run402",
3-
"version": "1.13.4",
3+
"version": "1.13.5",
44
"description": "CLI for Run402 — provision Postgres databases, deploy static sites, generate images, and manage wallets via x402 micropayments.",
55
"type": "module",
66
"bin": {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "run402-mcp",
3-
"version": "1.13.4",
3+
"version": "1.13.5",
44
"description": "MCP server for Run402 — AI-native Postgres databases with REST API, auth, storage, and row-level security. Pay with x402 USDC micropayments.",
55
"type": "module",
66
"main": "dist/index.js",

0 commit comments

Comments
 (0)