x402-proxy 0.11.6 → 0.12.0
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 +100 -1
- package/README.md +3 -3
- package/dist/bin/cli.js +22 -21
- package/dist/index.js +2 -0
- package/dist/setup-5KzHDwRR.js +3 -0
- package/dist/{setup-q91MbrZT.js → setup-C-fXZBSh.js} +1 -1
- package/dist/{status-DjZdIeES.js → status-CALRKYFp.js} +1 -1
- package/dist/status-CawITnuz.js +3 -0
- package/dist/{wallet-CUCoLEqs.js → wallet-PKXYPnrG.js} +28 -5
- package/dist/wallet-sqd5HaHh.js +3 -0
- package/package.json +2 -2
- package/dist/setup-DPuLACk7.js +0 -3
- package/dist/status-B2xUewrq.js +0 -3
- package/dist/wallet-BsCgqUun.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,96 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.12.0] - 2026-06-11
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- 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`).
|
|
15
|
+
|
|
16
|
+
## [0.11.6] - 2026-04-07
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- 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`
|
|
21
|
+
- Fix `fetchUpstreamModels` URL construction after upstream URL correction
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- 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`
|
|
26
|
+
- Catalog auto-sync: `fetchUpstreamModels()` now called in catalog `run` to fetch live model list from upstream on gateway restart
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- Downgrade plugin startup logs from `info` to `debug` to reduce log spam during `oc status`/`oc doctor`
|
|
31
|
+
|
|
32
|
+
## [0.11.5] - 2026-04-07
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- 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)
|
|
37
|
+
|
|
38
|
+
## [0.11.4] - 2026-04-03
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- Model catalog: Claude Opus 4.5, Claude Sonnet 4.5, Grok 4.1 Fast, MiniMax M2.7
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
|
|
46
|
+
- Refactor model defaults from array to record-based `MODEL_METADATA` lookup
|
|
47
|
+
- Provider auth now returns config patch when wallet already exists (fixes missing provider config on re-setup)
|
|
48
|
+
- Remove `autoEnableWhenConfiguredProviders` from plugin manifest (unnecessary for explicitly installed plugins)
|
|
49
|
+
|
|
50
|
+
## [0.11.3] - 2026-04-03
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
|
|
54
|
+
- README rewritten to Standard Readme spec (badges, ToC, Install/Usage/Contributing sections)
|
|
55
|
+
- SKILL.md updated for consistency (MCP proxy mention, unified flag style)
|
|
56
|
+
- Unified package description across README, SKILL.md, and package.json
|
|
57
|
+
|
|
58
|
+
## [0.11.2] - 2026-04-02
|
|
59
|
+
|
|
60
|
+
### Fixed
|
|
61
|
+
|
|
62
|
+
- Strip surrounding quotes from mnemonic in `/x_wallet setup import` (Telegram copy-paste)
|
|
63
|
+
- Show actual word count in mnemonic validation errors
|
|
64
|
+
|
|
65
|
+
## [0.11.1] - 2026-04-02
|
|
66
|
+
|
|
67
|
+
### Fixed
|
|
68
|
+
|
|
69
|
+
- Fix x402-proxy-openclaw publish workflow permissions
|
|
70
|
+
|
|
71
|
+
## [0.11.0] - 2026-04-02
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
|
|
75
|
+
- OpenClaw `providerAuthChoices` wallet setup flow - interactive generate/import via gateway prompter
|
|
76
|
+
- `/x_wallet setup` subcommand for Telegram/slash-command wallet creation (generate or import mnemonic)
|
|
77
|
+
- BIP-39 mnemonic validation on import (both interactive and slash-command paths)
|
|
78
|
+
- `createWalletFile()` helper in config module
|
|
79
|
+
|
|
80
|
+
### Changed
|
|
81
|
+
|
|
82
|
+
- Converted dynamic imports in `handler.ts` to static imports (mppx, viem/accounts)
|
|
83
|
+
- Updated example URLs from POST `{"ref":"CoinbaseDev"}` to simpler GET `/twitter/user/openclaw`
|
|
84
|
+
- Usage examples now show `npx x402-proxy` prefix consistently
|
|
85
|
+
- OpenClaw compat bumped to `2026.4.1`
|
|
86
|
+
- Wallet-not-found error messages now suggest `/x_wallet setup` instead of CLI-only instructions
|
|
87
|
+
|
|
88
|
+
### Removed
|
|
89
|
+
|
|
90
|
+
- Default model display from `/x_wallet` info output
|
|
91
|
+
|
|
92
|
+
## [0.10.12] - 2026-04-02
|
|
93
|
+
|
|
94
|
+
### Fixed
|
|
95
|
+
|
|
96
|
+
- Restore explicit SetComputeUnitLimit instruction for Solana transactions
|
|
97
|
+
- Strip `outputSchema` from proxied MCP tool definitions
|
|
98
|
+
- Downgrade @modelcontextprotocol/sdk to 1.27.1 for compatibility
|
|
99
|
+
|
|
10
100
|
## [0.10.9] - 2026-04-02
|
|
11
101
|
|
|
12
102
|
### Fixed
|
|
@@ -413,7 +503,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
413
503
|
- `appendHistory` / `readHistory` / `calcSpend` - JSONL transaction history
|
|
414
504
|
- Re-exports from `@x402/fetch`, `@x402/svm`, `@x402/evm`
|
|
415
505
|
|
|
416
|
-
[Unreleased]: https://github.com/cascade-protocol/x402-proxy/compare/v0.
|
|
506
|
+
[Unreleased]: https://github.com/cascade-protocol/x402-proxy/compare/v0.12.0...HEAD
|
|
507
|
+
[0.12.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.11.6...v0.12.0
|
|
508
|
+
[0.11.6]: https://github.com/cascade-protocol/x402-proxy/compare/v0.11.5...v0.11.6
|
|
509
|
+
[0.11.5]: https://github.com/cascade-protocol/x402-proxy/compare/v0.11.4...v0.11.5
|
|
510
|
+
[0.11.4]: https://github.com/cascade-protocol/x402-proxy/compare/v0.11.3...v0.11.4
|
|
511
|
+
[0.11.3]: https://github.com/cascade-protocol/x402-proxy/compare/v0.11.2...v0.11.3
|
|
512
|
+
[0.11.2]: https://github.com/cascade-protocol/x402-proxy/compare/v0.11.1...v0.11.2
|
|
513
|
+
[0.11.1]: https://github.com/cascade-protocol/x402-proxy/compare/v0.11.0...v0.11.1
|
|
514
|
+
[0.11.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.12...v0.11.0
|
|
515
|
+
[0.10.12]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.9...v0.10.12
|
|
417
516
|
[0.10.9]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.8...v0.10.9
|
|
418
517
|
[0.10.8]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.7...v0.10.8
|
|
419
518
|
[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)
|
|
5
5
|
[](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
|
|
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-
|
|
8
|
-
import { n as statusCommand } from "../status-
|
|
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-C-fXZBSh.js";
|
|
8
|
+
import { n as statusCommand } from "../status-CALRKYFp.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-
|
|
1377
|
+
const { runSetup } = await import("../setup-5KzHDwRR.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-
|
|
1964
|
+
const { displayStatus } = await import("../status-CawITnuz.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-
|
|
2019
|
+
const { runSetup } = await import("../setup-5KzHDwRR.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-
|
|
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-
|
|
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-
|
|
2452
|
+
const { runSetup } = await import("../setup-5KzHDwRR.js");
|
|
2452
2453
|
await runSetup({ nonInteractive: true });
|
|
2453
2454
|
const fresh = resolveWallet({
|
|
2454
2455
|
evmKey: flags.evmKey,
|
|
@@ -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-
|
|
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.
|
|
2515
|
+
version: "0.12.0"
|
|
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.
|
|
2546
|
+
version: "0.12.0"
|
|
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.
|
|
2620
|
+
version: "0.12.0"
|
|
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.
|
|
2635
|
+
version: "0.12.0"
|
|
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.
|
|
3023
|
+
versionInfo: { currentVersion: "0.12.0" },
|
|
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";
|
|
@@ -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)"
|
|
@@ -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 {
|
|
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() {
|
|
@@ -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 {
|
|
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 };
|
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.
|
|
3
|
+
"description": "curl for x402 paid APIs. Auto-pays any endpoint on Base, Monad, Solana, and Tempo.",
|
|
4
|
+
"version": "0.12.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"license": "Apache-2.0",
|
package/dist/setup-DPuLACk7.js
DELETED
package/dist/status-B2xUewrq.js
DELETED
package/dist/wallet-BsCgqUun.js
DELETED