x402-proxy 0.11.6 → 0.12.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/CHANGELOG.md CHANGED
@@ -7,6 +7,102 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.12.1] - 2026-06-11
11
+
12
+ ### Fixed
13
+
14
+ - Show Monad balance in the `status` screen and default `npx x402-proxy` view (0.12.0 added it only to `wallet info`)
15
+
16
+ ## [0.12.0] - 2026-06-11
17
+
18
+ ### Added
19
+
20
+ - Monad mainnet (`eip155:143`) support: `--network monad` selects Monad payment options, and the free public RPC (`https://rpc.monad.xyz`) is wired into `wallet info` for USDC/MON balances. Payments settle gaslessly via x402 `transferWithAuthorization` on Monad USDC (`0x754704Bc059F8C67012fEd69BC8A327a5aafb603`).
21
+
22
+ ## [0.11.6] - 2026-04-07
23
+
24
+ ### Fixed
25
+
26
+ - Fix HTTP 404 on OpenClaw inference proxy: upstream URL was missing `/v1` suffix, causing requests to hit `/api/v1/inference/chat/completions` instead of `/api/v1/inference/v1/chat/completions`
27
+ - Fix `fetchUpstreamModels` URL construction after upstream URL correction
28
+
29
+ ### Added
30
+
31
+ - 5 missing models in `MODEL_METADATA`: `z-ai/glm-5.1`, `x-ai/grok-4.20-multi-agent-beta`, `x-ai/grok-4.1-fast:online`, `x-ai/grok-4.20-beta:online`, `x-ai/grok-4.20-multi-agent-beta:online`
32
+ - Catalog auto-sync: `fetchUpstreamModels()` now called in catalog `run` to fetch live model list from upstream on gateway restart
33
+
34
+ ### Changed
35
+
36
+ - Downgrade plugin startup logs from `info` to `debug` to reduce log spam during `oc status`/`oc doctor`
37
+
38
+ ## [0.11.5] - 2026-04-07
39
+
40
+ ### Fixed
41
+
42
+ - Fix race condition in MPP MCP proxy: concurrent tool calls no longer overwrite each other's payment amounts (replaced shared mutable variable with AsyncLocalStorage per-call context)
43
+
44
+ ## [0.11.4] - 2026-04-03
45
+
46
+ ### Added
47
+
48
+ - Model catalog: Claude Opus 4.5, Claude Sonnet 4.5, Grok 4.1 Fast, MiniMax M2.7
49
+
50
+ ### Changed
51
+
52
+ - Refactor model defaults from array to record-based `MODEL_METADATA` lookup
53
+ - Provider auth now returns config patch when wallet already exists (fixes missing provider config on re-setup)
54
+ - Remove `autoEnableWhenConfiguredProviders` from plugin manifest (unnecessary for explicitly installed plugins)
55
+
56
+ ## [0.11.3] - 2026-04-03
57
+
58
+ ### Changed
59
+
60
+ - README rewritten to Standard Readme spec (badges, ToC, Install/Usage/Contributing sections)
61
+ - SKILL.md updated for consistency (MCP proxy mention, unified flag style)
62
+ - Unified package description across README, SKILL.md, and package.json
63
+
64
+ ## [0.11.2] - 2026-04-02
65
+
66
+ ### Fixed
67
+
68
+ - Strip surrounding quotes from mnemonic in `/x_wallet setup import` (Telegram copy-paste)
69
+ - Show actual word count in mnemonic validation errors
70
+
71
+ ## [0.11.1] - 2026-04-02
72
+
73
+ ### Fixed
74
+
75
+ - Fix x402-proxy-openclaw publish workflow permissions
76
+
77
+ ## [0.11.0] - 2026-04-02
78
+
79
+ ### Added
80
+
81
+ - OpenClaw `providerAuthChoices` wallet setup flow - interactive generate/import via gateway prompter
82
+ - `/x_wallet setup` subcommand for Telegram/slash-command wallet creation (generate or import mnemonic)
83
+ - BIP-39 mnemonic validation on import (both interactive and slash-command paths)
84
+ - `createWalletFile()` helper in config module
85
+
86
+ ### Changed
87
+
88
+ - Converted dynamic imports in `handler.ts` to static imports (mppx, viem/accounts)
89
+ - Updated example URLs from POST `{"ref":"CoinbaseDev"}` to simpler GET `/twitter/user/openclaw`
90
+ - Usage examples now show `npx x402-proxy` prefix consistently
91
+ - OpenClaw compat bumped to `2026.4.1`
92
+ - Wallet-not-found error messages now suggest `/x_wallet setup` instead of CLI-only instructions
93
+
94
+ ### Removed
95
+
96
+ - Default model display from `/x_wallet` info output
97
+
98
+ ## [0.10.12] - 2026-04-02
99
+
100
+ ### Fixed
101
+
102
+ - Restore explicit SetComputeUnitLimit instruction for Solana transactions
103
+ - Strip `outputSchema` from proxied MCP tool definitions
104
+ - Downgrade @modelcontextprotocol/sdk to 1.27.1 for compatibility
105
+
10
106
  ## [0.10.9] - 2026-04-02
11
107
 
12
108
  ### Fixed
@@ -413,7 +509,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
413
509
  - `appendHistory` / `readHistory` / `calcSpend` - JSONL transaction history
414
510
  - Re-exports from `@x402/fetch`, `@x402/svm`, `@x402/evm`
415
511
 
416
- [Unreleased]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.9...HEAD
512
+ [Unreleased]: https://github.com/cascade-protocol/x402-proxy/compare/v0.12.1...HEAD
513
+ [0.12.1]: https://github.com/cascade-protocol/x402-proxy/compare/v0.12.0...v0.12.1
514
+ [0.12.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.11.6...v0.12.0
515
+ [0.11.6]: https://github.com/cascade-protocol/x402-proxy/compare/v0.11.5...v0.11.6
516
+ [0.11.5]: https://github.com/cascade-protocol/x402-proxy/compare/v0.11.4...v0.11.5
517
+ [0.11.4]: https://github.com/cascade-protocol/x402-proxy/compare/v0.11.3...v0.11.4
518
+ [0.11.3]: https://github.com/cascade-protocol/x402-proxy/compare/v0.11.2...v0.11.3
519
+ [0.11.2]: https://github.com/cascade-protocol/x402-proxy/compare/v0.11.1...v0.11.2
520
+ [0.11.1]: https://github.com/cascade-protocol/x402-proxy/compare/v0.11.0...v0.11.1
521
+ [0.11.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.12...v0.11.0
522
+ [0.10.12]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.9...v0.10.12
417
523
  [0.10.9]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.8...v0.10.9
418
524
  [0.10.8]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.7...v0.10.8
419
525
  [0.10.7]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.6...v0.10.7
package/README.md CHANGED
@@ -4,9 +4,9 @@
4
4
  [![license](https://img.shields.io/npm/l/x402-proxy.svg?style=flat-square)](LICENSE)
5
5
  [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
6
6
 
7
- curl for x402 and MPP paid APIs with MCP proxy support. Auto-pays HTTP 402 on Base, Solana, and Tempo.
7
+ curl for x402 and MPP paid APIs with MCP proxy support. Auto-pays HTTP 402 on Base, Monad, Solana, and Tempo.
8
8
 
9
- Zero crypto code on the buyer side. One mnemonic derives both EVM (Base/Tempo) and Solana keypairs - fund any chain and go. Supports one-time payments (x402, MPP charge) and pay-per-token streaming (MPP sessions). Use it as a CLI, an MCP proxy for AI agents, or as a Node.js library.
9
+ Zero crypto code on the buyer side. One mnemonic derives both EVM (Base/Monad/Tempo) and Solana keypairs - fund any chain and go. Supports one-time payments (x402, MPP charge) and pay-per-token streaming (MPP sessions). Use it as a CLI, an MCP proxy for AI agents, or as a Node.js library.
10
10
 
11
11
  ## Table of Contents
12
12
 
@@ -29,7 +29,7 @@ npx x402-proxy https://surf.cascade.fyi/api/v1/twitter/user/openclaw
29
29
 
30
30
  That's it. The endpoint returns 402, x402-proxy pays and streams the response.
31
31
 
32
- No wallet? It'll walk you through setup automatically. One mnemonic derives both EVM (Base/Tempo) and Solana keypairs. Fund any chain and go.
32
+ No wallet? It'll walk you through setup automatically. One mnemonic derives both EVM (Base/Monad/Tempo) and Solana keypairs. Fund any chain and go.
33
33
 
34
34
  ## Usage
35
35
 
package/dist/bin/cli.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import { i as __toESM } from "../chunk-DjEMn6fM.js";
3
3
  import { C as run, S as buildRouteMap, _ as base58, a as getDebugLogPath, b as buildApplication, c as isConfigured, d as saveConfig, f as saveSession, i as getConfigDirShort, l as loadConfig, o as getHistoryPath, r as ensureConfigDir, t as clearSession, u as loadWalletFile, x as buildCommand, y as require_picocolors } from "../config-cyNyKO4-.js";
4
- import { C as warn, S as success, _ as decodePaymentResponseHeader, b as info, c as resolveWallet, d as displayNetwork, f as formatAmount, g as wrapFetchWithPayment, h as readHistory, l as appendHistory, m as formatUsdcValue, n as fetchAllBalances, o as walletInfoCommand, p as formatTxLine, s as buildX402Client, u as calcSpend, v as dim, x as isTTY, y as error } from "../wallet-CUCoLEqs.js";
4
+ import { C as success, S as isTTY, _ as wrapFetchWithPayment, b as error, c as buildX402Client, d as calcSpend, f as displayNetwork, g as readHistory, h as formatUsdcValue, l as resolveWallet, m as formatTxLine, n as fetchAllBalances, p as formatAmount, s as walletInfoCommand, u as appendHistory, v as decodePaymentResponseHeader, w as warn, x as info, y as dim } from "../wallet-PKXYPnrG.js";
5
5
  import { i as deserializeSessionReceipt, n as tempo, o as parseUnits, r as parseEvent, t as create } from "../client-DqtxTnu6.js";
6
6
  import { t as privateKeyToAccount } from "../accounts-D9KsVVpJ.js";
7
- import { a as Nt, c as Wt, i as Jt, l as Ct, n as setupCommand, o as R, r as Gt, s as Rt, t as runSetup } from "../setup-q91MbrZT.js";
8
- import { n as statusCommand } from "../status-DjZdIeES.js";
7
+ import { a as Nt, c as Wt, i as Jt, l as Ct, n as setupCommand, o as R, r as Gt, s as Rt, t as runSetup } from "../setup-DUHpm-R1.js";
8
+ import { n as statusCommand } from "../status-4wDGkJ3j.js";
9
9
  import { dirname, join, normalize, resolve } from "node:path";
10
10
  import { spawn } from "node:child_process";
11
11
  import { once } from "node:events";
@@ -1374,7 +1374,7 @@ async function resolveWalletForServe(flags) {
1374
1374
  solanaKey: flags.solanaKey
1375
1375
  });
1376
1376
  if (wallet.source !== "none") return wallet;
1377
- const { runSetup } = await import("../setup-DPuLACk7.js");
1377
+ const { runSetup } = await import("../setup-HnE7chKM.js");
1378
1378
  if (isTTY()) {
1379
1379
  dim(" No wallet found. Let's set one up first.\n");
1380
1380
  await runSetup();
@@ -1533,7 +1533,7 @@ Examples:
1533
1533
  },
1534
1534
  network: {
1535
1535
  kind: "parsed",
1536
- brief: "Preferred or required network (base, solana, tempo)",
1536
+ brief: "Preferred or required network (base, monad, solana, tempo)",
1537
1537
  parse: String,
1538
1538
  optional: true
1539
1539
  },
@@ -1630,7 +1630,7 @@ not listed above.`
1630
1630
  },
1631
1631
  network: {
1632
1632
  kind: "parsed",
1633
- brief: "Preferred or required network (base, solana, tempo)",
1633
+ brief: "Preferred or required network (base, monad, solana, tempo)",
1634
1634
  parse: String,
1635
1635
  optional: true
1636
1636
  },
@@ -1715,13 +1715,14 @@ not listed above.`
1715
1715
  var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
1716
1716
  const VALID_KEYS = {
1717
1717
  defaultNetwork: {
1718
- description: "Preferred network (base, solana, tempo)",
1718
+ description: "Preferred network (base, monad, solana, tempo)",
1719
1719
  parse: (v) => {
1720
1720
  if (![
1721
1721
  "base",
1722
+ "monad",
1722
1723
  "solana",
1723
1724
  "tempo"
1724
- ].includes(v)) throw new Error("Must be one of: base, solana, tempo");
1725
+ ].includes(v)) throw new Error("Must be one of: base, monad, solana, tempo");
1725
1726
  return v;
1726
1727
  }
1727
1728
  },
@@ -1911,7 +1912,7 @@ Examples:
1911
1912
  },
1912
1913
  network: {
1913
1914
  kind: "parsed",
1914
- brief: "Require specific network (base, solana, tempo)",
1915
+ brief: "Require specific network (base, monad, solana, tempo)",
1915
1916
  parse: String,
1916
1917
  optional: true
1917
1918
  },
@@ -1960,7 +1961,7 @@ Examples:
1960
1961
  };
1961
1962
  if (!url) {
1962
1963
  if (isConfigured()) {
1963
- const { displayStatus } = await import("../status-B2xUewrq.js");
1964
+ const { displayStatus } = await import("../status-DnstbyRA.js");
1964
1965
  await displayStatus();
1965
1966
  console.log();
1966
1967
  console.log(import_picocolors.default.dim(" Commands:"));
@@ -2015,7 +2016,7 @@ Examples:
2015
2016
  process.exit(1);
2016
2017
  }
2017
2018
  dim(" No wallet found. Let's set one up first.\n");
2018
- const { runSetup } = await import("../setup-DPuLACk7.js");
2019
+ const { runSetup } = await import("../setup-HnE7chKM.js");
2019
2020
  await runSetup();
2020
2021
  console.log();
2021
2022
  wallet = resolveWallet();
@@ -2028,7 +2029,7 @@ Examples:
2028
2029
  verbose(`protocol: ${resolvedProtocol ?? "auto-detect"}, maxDeposit: ${maxDeposit}`);
2029
2030
  let preferredNetwork = config?.defaultNetwork;
2030
2031
  if (!preferredNetwork && wallet.evmAddress && wallet.solanaAddress) {
2031
- const { fetchAllBalances } = await import("../wallet-BsCgqUun.js");
2032
+ const { fetchAllBalances } = await import("../wallet-sqd5HaHh.js");
2032
2033
  const balances = await fetchAllBalances(wallet.evmAddress, wallet.solanaAddress);
2033
2034
  const evmUsdc = balances.evm ? Number(balances.evm.usdc) : 0;
2034
2035
  const solUsdc = balances.sol ? Number(balances.sol.usdc) : 0;
@@ -2195,7 +2196,7 @@ Examples:
2195
2196
  const hasSolana = accepts.some((a) => a.network.startsWith("solana:"));
2196
2197
  const hasMpp = detected.mpp;
2197
2198
  const hasOther = accepts.some((a) => !a.network.startsWith("eip155:") && !a.network.startsWith("solana:"));
2198
- const { fetchAllBalances } = await import("../wallet-BsCgqUun.js");
2199
+ const { fetchAllBalances } = await import("../wallet-sqd5HaHh.js");
2199
2200
  const balances = await fetchAllBalances(wallet.evmAddress, wallet.solanaAddress);
2200
2201
  const evmUsdc = hasEvm && balances.evm ? Number(balances.evm.usdc) : 0;
2201
2202
  const solUsdc = hasSolana && balances.sol ? Number(balances.sol.usdc) : 0;
@@ -2422,7 +2423,7 @@ Wallet is auto-generated on first run. No env vars needed.`
2422
2423
  },
2423
2424
  network: {
2424
2425
  kind: "parsed",
2425
- brief: "Require specific network (base, solana, tempo)",
2426
+ brief: "Require specific network (base, monad, solana, tempo)",
2426
2427
  parse: String,
2427
2428
  optional: true
2428
2429
  },
@@ -2448,7 +2449,7 @@ Wallet is auto-generated on first run. No env vars needed.`
2448
2449
  });
2449
2450
  if (wallet.source === "none") {
2450
2451
  dim("No wallet found. Auto-generating...");
2451
- const { runSetup } = await import("../setup-DPuLACk7.js");
2452
+ const { runSetup } = await import("../setup-HnE7chKM.js");
2452
2453
  await runSetup({ nonInteractive: true });
2453
2454
  const fresh = resolveWallet({
2454
2455
  evmKey: flags.evmKey,
@@ -2469,7 +2470,7 @@ Wallet is auto-generated on first run. No env vars needed.`
2469
2470
  const { SSEClientTransport } = await import("../sse-kba68iqF.js");
2470
2471
  const { StreamableHTTPClientTransport } = await import("../streamableHttp-DRntYTFN.js");
2471
2472
  const { Server } = await import("../server-Dbsk9dql.js");
2472
- const { StdioServerTransport } = await import("../stdio-BCoJJXun.js");
2473
+ const { StdioServerTransport } = await import("../stdio-CdmkLt8r.js");
2473
2474
  const { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ToolListChangedNotificationSchema, ResourceListChangedNotificationSchema } = await import("../types-DH9rDVeP.js");
2474
2475
  async function connectTransport(target) {
2475
2476
  try {
@@ -2492,7 +2493,7 @@ Wallet is auto-generated on first run. No env vars needed.`
2492
2493
  async function startX402Proxy() {
2493
2494
  let preferredNetwork = config?.defaultNetwork;
2494
2495
  if (!preferredNetwork && wallet.evmAddress && wallet.solanaAddress) {
2495
- const { fetchAllBalances } = await import("../wallet-BsCgqUun.js");
2496
+ const { fetchAllBalances } = await import("../wallet-sqd5HaHh.js");
2496
2497
  const balances = await fetchAllBalances(wallet.evmAddress, wallet.solanaAddress);
2497
2498
  const evmUsdc = balances.evm ? Number(balances.evm.usdc) : 0;
2498
2499
  const solUsdc = balances.sol ? Number(balances.sol.usdc) : 0;
@@ -2511,7 +2512,7 @@ Wallet is auto-generated on first run. No env vars needed.`
2511
2512
  }
2512
2513
  const remoteClient = new Client({
2513
2514
  name: "x402-proxy",
2514
- version: "0.11.6"
2515
+ version: "0.12.1"
2515
2516
  });
2516
2517
  await connectTransport(remoteClient);
2517
2518
  function recordX402Payment(ctx) {
@@ -2542,7 +2543,7 @@ Wallet is auto-generated on first run. No env vars needed.`
2542
2543
  }
2543
2544
  const localServer = new Server({
2544
2545
  name: "x402-proxy",
2545
- version: "0.11.6"
2546
+ version: "0.12.1"
2546
2547
  }, { capabilities: {
2547
2548
  tools: tools.length > 0 ? {} : void 0,
2548
2549
  resources: remoteResources.length > 0 ? {} : void 0
@@ -2616,7 +2617,7 @@ Wallet is auto-generated on first run. No env vars needed.`
2616
2617
  }));
2617
2618
  const remoteClient = new Client({
2618
2619
  name: "x402-proxy",
2619
- version: "0.11.6"
2620
+ version: "0.12.1"
2620
2621
  });
2621
2622
  await connectTransport(remoteClient);
2622
2623
  const mppClient = McpClient.wrap(remoteClient, { methods: wrappedMethods });
@@ -2631,7 +2632,7 @@ Wallet is auto-generated on first run. No env vars needed.`
2631
2632
  }
2632
2633
  const localServer = new Server({
2633
2634
  name: "x402-proxy",
2634
- version: "0.11.6"
2635
+ version: "0.12.1"
2635
2636
  }, { capabilities: {
2636
2637
  tools: tools.length > 0 ? {} : void 0,
2637
2638
  resources: remoteResources.length > 0 ? {} : void 0
@@ -3019,7 +3020,7 @@ const app = buildApplication(buildRouteMap({
3019
3020
  docs: { brief: "curl for x402 paid APIs" }
3020
3021
  }), {
3021
3022
  name: "x402-proxy",
3022
- versionInfo: { currentVersion: "0.11.6" },
3023
+ versionInfo: { currentVersion: "0.12.1" },
3023
3024
  scanner: { caseStyle: "allow-kebab-for-camel" }
3024
3025
  });
3025
3026
  //#endregion
package/dist/index.js CHANGED
@@ -47548,6 +47548,7 @@ function explorerUrl(net, tx) {
47548
47548
  if (net.startsWith("eip155:")) {
47549
47549
  const chainId = net.split(":")[1];
47550
47550
  if (chainId === "4217") return `https://explore.mainnet.tempo.xyz/tx/${tx}`;
47551
+ if (chainId === "143") return `https://monadscan.com/tx/${tx}`;
47551
47552
  if (chainId === "8453") return `https://basescan.org/tx/${tx}`;
47552
47553
  return `https://basescan.org/tx/${tx}`;
47553
47554
  }
@@ -47562,6 +47563,7 @@ function shortModel(model) {
47562
47563
  }
47563
47564
  function shortNetwork(net) {
47564
47565
  if (net === "eip155:8453") return "base";
47566
+ if (net === "eip155:143") return "monad";
47565
47567
  if (net === "eip155:4217") return "tempo";
47566
47568
  if (net.startsWith("eip155:")) return `evm:${net.split(":")[1]}`;
47567
47569
  if (net.startsWith("solana:")) return "sol";
@@ -4,7 +4,7 @@ import { c as isConfigured, d as saveConfig, g as generateMnemonic, i as getConf
4
4
  import "node:path";
5
5
  import "node:fs";
6
6
  import { stripVTControlCharacters, styleText } from "node:util";
7
- import N, { stdin, stdout } from "node:process";
7
+ import process$1, { stdin, stdout } from "node:process";
8
8
  import "node:readline";
9
9
  import ot from "node:readline";
10
10
  import "node:tty";
@@ -493,7 +493,7 @@ var $t = class extends B {
493
493
  //#endregion
494
494
  //#region node_modules/.pnpm/@clack+prompts@1.1.0/node_modules/@clack/prompts/dist/index.mjs
495
495
  function pt() {
496
- return N.platform !== "win32" ? N.env.TERM !== "linux" : !!N.env.CI || !!N.env.WT_SESSION || !!N.env.TERMINUS_SUBLIME || N.env.ConEmuTask === "{cmd::Cmder}" || N.env.TERM_PROGRAM === "Terminus-Sublime" || N.env.TERM_PROGRAM === "vscode" || N.env.TERM === "xterm-256color" || N.env.TERM === "alacritty" || N.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
496
+ return process$1.platform !== "win32" ? process$1.env.TERM !== "linux" : !!process$1.env.CI || !!process$1.env.WT_SESSION || !!process$1.env.TERMINUS_SUBLIME || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
497
497
  }
498
498
  const ee = pt(), I = (e, r) => ee ? e : r, Re = I("◆", "*"), $e = I("■", "x"), de = I("▲", "x"), V = I("◇", "o"), he = I("┌", "T"), h = I("│", "|"), x = I("└", "—");
499
499
  I("┐", "T");
@@ -998,7 +998,7 @@ async function runSetup(opts) {
998
998
  message: "Preferred payment protocol?",
999
999
  options: [{
1000
1000
  value: "x402",
1001
- label: "x402 - on-chain payments (Base, Solana)"
1001
+ label: "x402 - on-chain payments (Base, Monad, Solana)"
1002
1002
  }, {
1003
1003
  value: "mpp",
1004
1004
  label: "MPP - machine payments over HTTP 402 (Tempo)"
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { t as runSetup } from "./setup-DUHpm-R1.js";
3
+ export { runSetup };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { i as __toESM } from "./chunk-DjEMn6fM.js";
3
3
  import { i as getConfigDirShort, l as loadConfig, o as getHistoryPath, x as buildCommand, y as require_picocolors } from "./config-cyNyKO4-.js";
4
- import { c as resolveWallet, f as formatAmount, h as readHistory, m as formatUsdcValue, n as fetchAllBalances, p as formatTxLine, t as balanceLine, u as calcSpend, v as dim } from "./wallet-CUCoLEqs.js";
4
+ import { d as calcSpend, g as readHistory, h as formatUsdcValue, l as resolveWallet, m as formatTxLine, n as fetchAllBalances, p as formatAmount, t as balanceLine, y as dim } from "./wallet-PKXYPnrG.js";
5
5
  //#region packages/x402-proxy/src/commands/status.ts
6
6
  var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
7
7
  async function displayStatus() {
@@ -17,11 +17,15 @@ async function displayStatus() {
17
17
  console.log(import_picocolors.default.yellow(" No wallet configured."));
18
18
  console.log(import_picocolors.default.dim(` Run ${import_picocolors.default.cyan("$ npx x402-proxy setup")} to create one.`));
19
19
  } else {
20
- const { evm, sol, tempo } = await fetchAllBalances(wallet.evmAddress, wallet.solanaAddress);
20
+ const { evm, sol, tempo, monad } = await fetchAllBalances(wallet.evmAddress, wallet.solanaAddress);
21
21
  if (wallet.evmAddress) {
22
22
  const bal = evm ? balanceLine(evm.usdc, evm.eth, "ETH") : import_picocolors.default.dim(" (network error)");
23
23
  console.log(` Base: ${import_picocolors.default.green(wallet.evmAddress)}${bal}`);
24
24
  }
25
+ if (wallet.evmAddress) {
26
+ const bal = monad ? balanceLine(monad.usdc, monad.mon, "MON") : import_picocolors.default.dim(" (network error)");
27
+ console.log(` Monad: ${import_picocolors.default.green(wallet.evmAddress)}${bal}`);
28
+ }
25
29
  if (wallet.evmAddress) {
26
30
  const bal = tempo ? import_picocolors.default.dim(` (${tempo.usdc} USDC)`) : import_picocolors.default.dim(" (network error)");
27
31
  console.log(` Tempo: ${import_picocolors.default.green(wallet.evmAddress)}${bal}`);
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { t as displayStatus } from "./status-4wDGkJ3j.js";
3
+ export { displayStatus };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { Z as JSONRPCMessageSchema } from "./types-BQ17ZF7g.js";
3
- import N from "node:process";
3
+ import process from "node:process";
4
4
  //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
5
5
  /**
6
6
  * Buffers a continuous stdio stream into discrete JSON-RPC messages.
@@ -35,7 +35,7 @@ function serializeMessage(message) {
35
35
  * This transport is only available in Node.js environments.
36
36
  */
37
37
  var StdioServerTransport = class {
38
- constructor(_stdin = N.stdin, _stdout = N.stdout) {
38
+ constructor(_stdin = process.stdin, _stdout = process.stdout) {
39
39
  this._stdin = _stdin;
40
40
  this._stdout = _stdout;
41
41
  this._readBuffer = new ReadBuffer();
@@ -17263,6 +17263,7 @@ function explorerUrl(net, tx) {
17263
17263
  if (net.startsWith("eip155:")) {
17264
17264
  const chainId = net.split(":")[1];
17265
17265
  if (chainId === "4217") return `https://explore.mainnet.tempo.xyz/tx/${tx}`;
17266
+ if (chainId === "143") return `https://monadscan.com/tx/${tx}`;
17266
17267
  if (chainId === "8453") return `https://basescan.org/tx/${tx}`;
17267
17268
  return `https://basescan.org/tx/${tx}`;
17268
17269
  }
@@ -17277,6 +17278,7 @@ function shortModel(model) {
17277
17278
  }
17278
17279
  function displayNetwork(net) {
17279
17280
  if (net === "eip155:8453") return "Base";
17281
+ if (net === "eip155:143") return "Monad";
17280
17282
  if (net === "eip155:4217") return "Tempo";
17281
17283
  if (net.startsWith("eip155:")) return `EVM (${net.split(":")[1]})`;
17282
17284
  if (net.startsWith("solana:")) return "Solana";
@@ -17284,6 +17286,7 @@ function displayNetwork(net) {
17284
17286
  }
17285
17287
  function shortNetwork(net) {
17286
17288
  if (net === "eip155:8453") return "base";
17289
+ if (net === "eip155:143") return "monad";
17287
17290
  if (net === "eip155:4217") return "tempo";
17288
17291
  if (net.startsWith("eip155:")) return `evm:${net.split(":")[1]}`;
17289
17292
  if (net.startsWith("solana:")) return "sol";
@@ -17576,6 +17579,7 @@ function solanaAddressFromKey(keyBytes) {
17576
17579
  function networkToCaipPrefix(name) {
17577
17580
  switch (name.toLowerCase()) {
17578
17581
  case "base": return "eip155:8453";
17582
+ case "monad": return "eip155:143";
17579
17583
  case "tempo": return "eip155:4217";
17580
17584
  case "solana": return "solana:";
17581
17585
  default: return name;
@@ -17663,8 +17667,10 @@ async function buildX402Client(wallet, opts) {
17663
17667
  const BASE_RPC = "https://mainnet.base.org";
17664
17668
  const SOLANA_RPC = "https://api.mainnet-beta.solana.com";
17665
17669
  const TEMPO_RPC = "https://rpc.presto.tempo.xyz";
17670
+ const MONAD_RPC = "https://rpc.monad.xyz";
17666
17671
  const USDC_BASE = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
17667
17672
  const USDC_TEMPO = "0x20C000000000000000000000b9537d11c60E8b50";
17673
+ const USDC_MONAD = "0x754704Bc059F8C67012fEd69BC8A327a5aafb603";
17668
17674
  const USDC_SOLANA_MINT = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
17669
17675
  const TOKEN_PROGRAM = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
17670
17676
  const ATA_PROGRAM = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
@@ -17700,6 +17706,17 @@ async function fetchTempoBalances(address) {
17700
17706
  }, "latest"]);
17701
17707
  return { usdc: res.result ? formatUsdcValue(Number(BigInt(res.result)) / 1e6) : "?" };
17702
17708
  }
17709
+ async function fetchMonadBalances(address) {
17710
+ const usdcData = `0x70a08231${address.slice(2).padStart(64, "0")}`;
17711
+ const [monRes, usdcRes] = await Promise.all([rpcCall(MONAD_RPC, "eth_getBalance", [address, "latest"]), rpcCall(MONAD_RPC, "eth_call", [{
17712
+ to: USDC_MONAD,
17713
+ data: usdcData
17714
+ }, "latest"])]);
17715
+ return {
17716
+ mon: monRes.result ? (Number(BigInt(monRes.result)) / 0xde0b6b3a7640000).toFixed(6) : "?",
17717
+ usdc: usdcRes.result ? formatUsdcValue(Number(BigInt(usdcRes.result)) / 1e6) : "?"
17718
+ };
17719
+ }
17703
17720
  async function getUsdcAta(owner) {
17704
17721
  const encoder = getAddressEncoder();
17705
17722
  const [ata] = await getProgramDerivedAddress({
@@ -17726,15 +17743,17 @@ function balanceLine(usdc, native, nativeSymbol) {
17726
17743
  return import_picocolors.default.dim(` (${usdc} USDC, ${native} ${nativeSymbol})`);
17727
17744
  }
17728
17745
  async function fetchAllBalances(evmAddress, solanaAddress) {
17729
- const [evmResult, solResult, tempoResult] = await Promise.allSettled([
17746
+ const [evmResult, solResult, tempoResult, monadResult] = await Promise.allSettled([
17730
17747
  evmAddress ? fetchEvmBalances(evmAddress) : Promise.resolve(null),
17731
17748
  solanaAddress ? fetchSolanaBalances(solanaAddress) : Promise.resolve(null),
17732
- evmAddress ? fetchTempoBalances(evmAddress) : Promise.resolve(null)
17749
+ evmAddress ? fetchTempoBalances(evmAddress) : Promise.resolve(null),
17750
+ evmAddress ? fetchMonadBalances(evmAddress) : Promise.resolve(null)
17733
17751
  ]);
17734
17752
  return {
17735
17753
  evm: evmResult.status === "fulfilled" ? evmResult.value : null,
17736
17754
  sol: solResult.status === "fulfilled" ? solResult.value : null,
17737
- tempo: tempoResult.status === "fulfilled" ? tempoResult.value : null
17755
+ tempo: tempoResult.status === "fulfilled" ? tempoResult.value : null,
17756
+ monad: monadResult.status === "fulfilled" ? monadResult.value : null
17738
17757
  };
17739
17758
  }
17740
17759
  const walletInfoCommand = buildCommand({
@@ -17761,11 +17780,15 @@ const walletInfoCommand = buildCommand({
17761
17780
  info("Wallet");
17762
17781
  console.log();
17763
17782
  console.log(import_picocolors.default.dim(` Source: ${wallet.source}`));
17764
- const { evm, sol, tempo } = await fetchAllBalances(wallet.evmAddress, wallet.solanaAddress);
17783
+ const { evm, sol, tempo, monad } = await fetchAllBalances(wallet.evmAddress, wallet.solanaAddress);
17765
17784
  if (wallet.evmAddress) {
17766
17785
  const bal = evm ? balanceLine(evm.usdc, evm.eth, "ETH") : import_picocolors.default.dim(" (network error)");
17767
17786
  console.log(` Base: ${import_picocolors.default.green(wallet.evmAddress)}${bal}`);
17768
17787
  }
17788
+ if (wallet.evmAddress) {
17789
+ const bal = monad ? balanceLine(monad.usdc, monad.mon, "MON") : import_picocolors.default.dim(" (network error)");
17790
+ console.log(` Monad: ${import_picocolors.default.green(wallet.evmAddress)}${bal}`);
17791
+ }
17769
17792
  if (wallet.evmAddress) {
17770
17793
  const bal = tempo ? import_picocolors.default.dim(` (${tempo.usdc} USDC)`) : import_picocolors.default.dim(" (network error)");
17771
17794
  console.log(` Tempo: ${import_picocolors.default.green(wallet.evmAddress)}${bal}`);
@@ -17800,4 +17823,4 @@ const walletInfoCommand = buildCommand({
17800
17823
  }
17801
17824
  });
17802
17825
  //#endregion
17803
- export { warn as C, success as S, decodePaymentResponseHeader as _, fetchTempoBalances as a, info as b, resolveWallet as c, displayNetwork as d, formatAmount as f, wrapFetchWithPayment as g, readHistory as h, fetchSolanaBalances as i, appendHistory as l, formatUsdcValue as m, fetchAllBalances as n, walletInfoCommand as o, formatTxLine as p, fetchEvmBalances as r, buildX402Client as s, balanceLine as t, calcSpend as u, dim as v, isTTY as x, error as y };
17826
+ export { success as C, isTTY as S, wrapFetchWithPayment as _, fetchSolanaBalances as a, error as b, buildX402Client as c, calcSpend as d, displayNetwork as f, readHistory as g, formatUsdcValue as h, fetchMonadBalances as i, resolveWallet as l, formatTxLine as m, fetchAllBalances as n, fetchTempoBalances as o, formatAmount as p, fetchEvmBalances as r, walletInfoCommand as s, balanceLine as t, appendHistory as u, decodePaymentResponseHeader as v, warn as w, info as x, dim as y };
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { n as fetchAllBalances } from "./wallet-PKXYPnrG.js";
3
+ export { fetchAllBalances };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x402-proxy",
3
- "description": "curl for x402 paid APIs. Auto-pays any endpoint on Base, Solana, and Tempo.",
4
- "version": "0.11.6",
3
+ "description": "curl for x402 paid APIs. Auto-pays any endpoint on Base, Monad, Solana, and Tempo.",
4
+ "version": "0.12.1",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "license": "Apache-2.0",
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { t as runSetup } from "./setup-q91MbrZT.js";
3
- export { runSetup };
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { t as displayStatus } from "./status-DjZdIeES.js";
3
- export { displayStatus };
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { n as fetchAllBalances } from "./wallet-CUCoLEqs.js";
3
- export { fetchAllBalances };