x402-proxy 0.10.7 → 0.10.9

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/README.md +7 -1
  3. package/dist/Credential-COZQnr1-.js +2055 -0
  4. package/dist/Mcp-CrCEqLqO.js +10 -0
  5. package/dist/Sse-ChldYgU7.js +9742 -0
  6. package/dist/Sse-kCB38G56.js +16482 -0
  7. package/dist/accounts-DsuvWwph.js +232 -0
  8. package/dist/accounts-DzvAlQRn.js +5 -0
  9. package/dist/accounts-IG-Cmrwy.js +229 -0
  10. package/dist/api-CUzmQvTQ.js +2802 -0
  11. package/dist/auth-DTzQmnZ_.js +1196 -0
  12. package/dist/bin/cli.js +585 -242
  13. package/dist/ccip-Bx-zoUCJ.js +240 -0
  14. package/dist/ccip-C2k1DD1T.js +153 -0
  15. package/dist/ccip-C6CQOJYv.js +152 -0
  16. package/dist/ccip-RZzsZ5Mv.js +156 -0
  17. package/dist/chain-CafcHffR.js +1997 -0
  18. package/dist/chain-DwfP5RGZ.js +1968 -0
  19. package/dist/chunk-DBEY4PJZ.js +16 -0
  20. package/dist/chunk-DjEMn6fM.js +36 -0
  21. package/dist/client-Blw2V7LF.js +657 -0
  22. package/dist/client-C37gWJOZ.js +102 -0
  23. package/dist/client-CEc4NYAA.js +6388 -0
  24. package/dist/client-CVDTUY0l.js +5152 -0
  25. package/dist/config-BUQsit4s.js +3 -0
  26. package/dist/config-DR1Fs_wL.js +6600 -0
  27. package/dist/{config-D9wIR3xc.js → config-rvKA3SYT.js} +10 -5
  28. package/dist/decodeFunctionData-DuFcwhC_.js +4510 -0
  29. package/dist/decodeFunctionData-JPOUdvil.js +4394 -0
  30. package/dist/derive-DNUl8LU9.js +9109 -0
  31. package/dist/dist-C2YO6HSQ.js +6581 -0
  32. package/dist/dist-DM5_F3r5.js +4 -0
  33. package/dist/dist-DxJCYyL5.js +1388 -0
  34. package/dist/hashTypedData-BHmP9dBd.js +859 -0
  35. package/dist/hashTypedData-CtEdfx4y.js +846 -0
  36. package/dist/helpers-CuUSw-tH.js +7125 -0
  37. package/dist/hmac-59IlS_by.js +648 -0
  38. package/dist/http-BAtucMbS.js +2060 -0
  39. package/dist/index.d.ts +1903 -9
  40. package/dist/index.js +18006 -50
  41. package/dist/index.node-CxkL0OFh.js +3592 -0
  42. package/dist/index.node-DvmeuZBj.js +3 -0
  43. package/dist/isAddressEqual-BLrd1Hg1.js +9 -0
  44. package/dist/isAddressEqual-DsAqfQOD.js +10 -0
  45. package/dist/localBatchGatewayRequest-C-RPJyDO.js +6260 -0
  46. package/dist/localBatchGatewayRequest-DOdQ9bR7.js +93 -0
  47. package/dist/localBatchGatewayRequest-DQkbZaSy.js +6261 -0
  48. package/dist/parseUnits-CApwcKSD.js +49 -0
  49. package/dist/parseUnits-cMO2udMe.js +48 -0
  50. package/dist/schemas-BxMFYNbH.js +1270 -0
  51. package/dist/secp256k1-BZpiyffY.js +2525 -0
  52. package/dist/secp256k1-BjenrLl5.js +1877 -0
  53. package/dist/secp256k1-CLPUX17u.js +3 -0
  54. package/dist/sendRawTransactionSync-DvSkhZtW.js +3612 -0
  55. package/dist/server-CSq0IuUq.js +565 -0
  56. package/dist/setup-BY4J49Lv.js +1110 -0
  57. package/dist/setup-wMOAgrsN.js +3 -0
  58. package/dist/sha256-FAs0qeni.js +17 -0
  59. package/dist/sha3-CYkWM8Xa.js +195 -0
  60. package/dist/sha3-DbMJRJ3C.js +194 -0
  61. package/dist/sse-B4LLqBQm.js +408 -0
  62. package/dist/status-Bu23RjW6.js +3 -0
  63. package/dist/{status-DihAcUSC.js → status-X21VnGUO.js} +16 -15
  64. package/dist/stdio-BADqxZdZ.js +85 -0
  65. package/dist/streamableHttp-BHkJypcI.js +358 -0
  66. package/dist/tempo-3nttrxgQ.js +17 -0
  67. package/dist/tempo-DER0P-ul.js +18 -0
  68. package/dist/types-BEKUz-Mf.js +1240 -0
  69. package/dist/types-DatK5vR5.js +3 -0
  70. package/dist/utils-BYjkXZDF.js +444 -0
  71. package/dist/utils-SeGHMW9O.js +445 -0
  72. package/dist/wallet-DKVlrR1S.js +3 -0
  73. package/dist/wallet-DSyht15_.js +17759 -0
  74. package/package.json +18 -71
  75. package/dist/config-B_upkJeK.js +0 -66
  76. package/dist/config-Be35NM5s.js +0 -3
  77. package/dist/config-J1m-CWXT.js +0 -27
  78. package/dist/derive-CL6e8K0Z.js +0 -81
  79. package/dist/openclaw/plugin.d.ts +0 -15
  80. package/dist/openclaw/plugin.js +0 -2067
  81. package/dist/openclaw.plugin.json +0 -93
  82. package/dist/setup-CNyMLnM-.js +0 -197
  83. package/dist/setup-DTIxPe58.js +0 -3
  84. package/dist/status-DZlJ4pS7.js +0 -3
  85. package/dist/wallet-B0S-rma9.js +0 -544
  86. package/dist/wallet-DBrVZJqe.js +0 -3
  87. package/openclaw.plugin.json +0 -93
  88. package/skills/SKILL.md +0 -183
  89. package/skills/references/library.md +0 -85
  90. package/skills/references/openclaw-plugin.md +0 -145
package/package.json CHANGED
@@ -1,9 +1,22 @@
1
1
  {
2
2
  "name": "x402-proxy",
3
- "version": "0.10.7",
4
- "description": "curl for x402 paid APIs. Auto-pays any endpoint on Base, Solana, and Tempo. Also works as an OpenClaw plugin.",
3
+ "description": "curl for x402 paid APIs. Auto-pays any endpoint on Base, Solana, and Tempo.",
4
+ "version": "0.10.9",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
+ "license": "Apache-2.0",
8
+ "engines": {
9
+ "node": ">=22.0.0"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/cascade-protocol/x402-proxy.git",
14
+ "directory": "packages/x402-proxy"
15
+ },
16
+ "homepage": "https://github.com/cascade-protocol/x402-proxy#readme",
17
+ "bugs": {
18
+ "url": "https://github.com/cascade-protocol/x402-proxy/issues"
19
+ },
7
20
  "main": "./dist/index.js",
8
21
  "types": "./dist/index.d.ts",
9
22
  "exports": {
@@ -11,28 +24,8 @@
11
24
  "types": "./dist/index.d.ts",
12
25
  "default": "./dist/index.js"
13
26
  },
14
- "./openclaw": {
15
- "types": "./dist/openclaw/plugin.d.ts",
16
- "default": "./dist/openclaw/plugin.js"
17
- },
18
27
  "./package.json": "./package.json"
19
28
  },
20
- "openclaw": {
21
- "extensions": [
22
- "./dist/openclaw/plugin.js"
23
- ],
24
- "providers": [
25
- "surf"
26
- ],
27
- "compat": {
28
- "pluginApi": ">=2026.3.24",
29
- "minGatewayVersion": "2026.3.24"
30
- },
31
- "build": {
32
- "openclawVersion": "2026.3.24",
33
- "pluginSdkVersion": "2026.3.24"
34
- }
35
- },
36
29
  "bin": {
37
30
  "x402-proxy": "./dist/bin/cli.js"
38
31
  },
@@ -60,30 +53,6 @@
60
53
  "viem": "^2.47.6",
61
54
  "yaml": "^2.8.3"
62
55
  },
63
- "peerDependencies": {
64
- "openclaw": ">=2026.3.8"
65
- },
66
- "peerDependenciesMeta": {
67
- "openclaw": {
68
- "optional": true
69
- }
70
- },
71
- "devDependencies": {
72
- "@types/node": "^25.5.0",
73
- "openclaw": "^2026.3.24",
74
- "publint": "^0.3.18",
75
- "tsdown": "^0.21.5",
76
- "typescript": "^5.9.3",
77
- "vitest": "^4.1.1"
78
- },
79
- "files": [
80
- "dist/**",
81
- "openclaw.plugin.json",
82
- "README.md",
83
- "CHANGELOG.md",
84
- "skills/**",
85
- "LICENSE"
86
- ],
87
56
  "keywords": [
88
57
  "x402",
89
58
  "mpp",
@@ -97,28 +66,6 @@
97
66
  "tempo",
98
67
  "usdc",
99
68
  "coinbase",
100
- "cli",
101
- "openclaw",
102
- "openclaw-plugin"
103
- ],
104
- "license": "Apache-2.0",
105
- "engines": {
106
- "node": ">=22.0.0"
107
- },
108
- "repository": {
109
- "type": "git",
110
- "url": "git+https://github.com/cascade-protocol/x402-proxy.git",
111
- "directory": "packages/x402-proxy"
112
- },
113
- "homepage": "https://github.com/cascade-protocol/x402-proxy#readme",
114
- "bugs": {
115
- "url": "https://github.com/cascade-protocol/x402-proxy/issues"
116
- },
117
- "scripts": {
118
- "build": "rm -rf dist && tsdown --publint && cp openclaw.plugin.json dist/",
119
- "dev": "tsdown --watch",
120
- "type-check": "tsc --noEmit",
121
- "test": "vitest run",
122
- "check": "pnpm type-check && biome check --write"
123
- }
124
- }
69
+ "cli"
70
+ ]
71
+ }
@@ -1,66 +0,0 @@
1
- import os from "node:os";
2
- import path from "node:path";
3
- import fs from "node:fs";
4
- import "yaml";
5
- //#region \0rolldown/runtime.js
6
- var __defProp = Object.defineProperty;
7
- var __exportAll = (all, no_symbols) => {
8
- let target = {};
9
- for (var name in all) __defProp(target, name, {
10
- get: all[name],
11
- enumerable: true
12
- });
13
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
14
- return target;
15
- };
16
- //#endregion
17
- //#region src/lib/config.ts
18
- var config_exports = /* @__PURE__ */ __exportAll({
19
- clearSession: () => clearSession,
20
- ensureConfigDir: () => ensureConfigDir,
21
- getConfigDir: () => getConfigDir,
22
- getHistoryPath: () => getHistoryPath,
23
- getSessionPath: () => getSessionPath,
24
- getWalletPath: () => getWalletPath,
25
- loadWalletFile: () => loadWalletFile,
26
- saveSession: () => saveSession
27
- });
28
- const APP_NAME = "x402-proxy";
29
- function getConfigDir() {
30
- const xdg = process.env.XDG_CONFIG_HOME || path.join(os.homedir(), ".config");
31
- return path.join(xdg, APP_NAME);
32
- }
33
- function getWalletPath() {
34
- return path.join(getConfigDir(), "wallet.json");
35
- }
36
- function getHistoryPath() {
37
- return path.join(getConfigDir(), "history.jsonl");
38
- }
39
- function ensureConfigDir() {
40
- fs.mkdirSync(getConfigDir(), { recursive: true });
41
- }
42
- function loadWalletFile() {
43
- const p = getWalletPath();
44
- if (!fs.existsSync(p)) return null;
45
- try {
46
- const data = JSON.parse(fs.readFileSync(p, "utf-8"));
47
- if (data.version === 1 && typeof data.mnemonic === "string") return data;
48
- return null;
49
- } catch {
50
- return null;
51
- }
52
- }
53
- function getSessionPath() {
54
- return path.join(getConfigDir(), "session.json");
55
- }
56
- function saveSession(session) {
57
- ensureConfigDir();
58
- fs.writeFileSync(getSessionPath(), JSON.stringify(session, null, 2), "utf-8");
59
- }
60
- function clearSession() {
61
- try {
62
- fs.unlinkSync(getSessionPath());
63
- } catch {}
64
- }
65
- //#endregion
66
- export { getHistoryPath as n, loadWalletFile as r, config_exports as t };
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { f as saveSession, t as clearSession } from "./config-D9wIR3xc.js";
3
- export { clearSession, saveSession };
@@ -1,27 +0,0 @@
1
- import fs from "node:fs";
2
- import path from "node:path";
3
- import os from "node:os";
4
- import "yaml";
5
- //#region src/lib/config.ts
6
- const APP_NAME = "x402-proxy";
7
- function getConfigDir() {
8
- const xdg = process.env.XDG_CONFIG_HOME || path.join(os.homedir(), ".config");
9
- return path.join(xdg, APP_NAME);
10
- }
11
- function ensureConfigDir() {
12
- fs.mkdirSync(getConfigDir(), { recursive: true });
13
- }
14
- function getSessionPath() {
15
- return path.join(getConfigDir(), "session.json");
16
- }
17
- function saveSession(session) {
18
- ensureConfigDir();
19
- fs.writeFileSync(getSessionPath(), JSON.stringify(session, null, 2), "utf-8");
20
- }
21
- function clearSession() {
22
- try {
23
- fs.unlinkSync(getSessionPath());
24
- } catch {}
25
- }
26
- //#endregion
27
- export { clearSession, saveSession };
@@ -1,81 +0,0 @@
1
- #!/usr/bin/env node
2
- import { ed25519 } from "@noble/curves/ed25519.js";
3
- import { base58 } from "@scure/base";
4
- import { secp256k1 } from "@noble/curves/secp256k1.js";
5
- import { hmac } from "@noble/hashes/hmac.js";
6
- import { sha512 } from "@noble/hashes/sha2.js";
7
- import { keccak_256 } from "@noble/hashes/sha3.js";
8
- import { HDKey } from "@scure/bip32";
9
- import { generateMnemonic, mnemonicToSeedSync } from "@scure/bip39";
10
- import { wordlist } from "@scure/bip39/wordlists/english.js";
11
- //#region src/lib/derive.ts
12
- /**
13
- * Wallet derivation from BIP-39 mnemonic.
14
- *
15
- * A single 24-word mnemonic is the root secret. Both Solana and EVM keypairs
16
- * are deterministically derived from it.
17
- *
18
- * Solana: SLIP-10 Ed25519 at m/44'/501'/0'/0'
19
- * EVM: BIP-32 secp256k1 at m/44'/60'/0'/0/0
20
- *
21
- * Ported from agentbox/packages/openclaw-x402/src/wallet.ts
22
- */
23
- function generateMnemonic$1() {
24
- return generateMnemonic(wordlist, 256);
25
- }
26
- /**
27
- * SLIP-10 Ed25519 derivation at m/44'/501'/0'/0' (Phantom/Backpack compatible).
28
- */
29
- const enc = new TextEncoder();
30
- function deriveSolanaKeypair(mnemonic) {
31
- const seed = mnemonicToSeedSync(mnemonic);
32
- let I = hmac(sha512, enc.encode("ed25519 seed"), seed);
33
- let key = I.slice(0, 32);
34
- let chainCode = I.slice(32);
35
- for (const index of [
36
- 2147483692,
37
- 2147484149,
38
- 2147483648,
39
- 2147483648
40
- ]) {
41
- const data = new Uint8Array(37);
42
- data[0] = 0;
43
- data.set(key, 1);
44
- data[33] = index >>> 24 & 255;
45
- data[34] = index >>> 16 & 255;
46
- data[35] = index >>> 8 & 255;
47
- data[36] = index & 255;
48
- I = hmac(sha512, chainCode, data);
49
- key = I.slice(0, 32);
50
- chainCode = I.slice(32);
51
- }
52
- const secretKey = new Uint8Array(key);
53
- const publicKey = ed25519.getPublicKey(secretKey);
54
- return {
55
- secretKey,
56
- publicKey,
57
- address: base58.encode(publicKey)
58
- };
59
- }
60
- /**
61
- * BIP-32 secp256k1 derivation at m/44'/60'/0'/0/0.
62
- */
63
- function deriveEvmKeypair(mnemonic) {
64
- const seed = mnemonicToSeedSync(mnemonic);
65
- const derived = HDKey.fromMasterSeed(seed).derive("m/44'/60'/0'/0/0");
66
- if (!derived.privateKey) throw new Error("Failed to derive EVM private key");
67
- const privateKey = `0x${Buffer.from(derived.privateKey).toString("hex")}`;
68
- const hash = keccak_256(secp256k1.getPublicKey(derived.privateKey, false).slice(1));
69
- return {
70
- privateKey,
71
- address: checksumAddress(Buffer.from(hash.slice(-20)).toString("hex"))
72
- };
73
- }
74
- function checksumAddress(addr) {
75
- const hash = Buffer.from(keccak_256(enc.encode(addr))).toString("hex");
76
- let out = "0x";
77
- for (let i = 0; i < 40; i++) out += Number.parseInt(hash[i], 16) >= 8 ? addr[i].toUpperCase() : addr[i];
78
- return out;
79
- }
80
- //#endregion
81
- export { deriveSolanaKeypair as n, generateMnemonic$1 as r, deriveEvmKeypair as t };
@@ -1,15 +0,0 @@
1
- import { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-entry";
2
- import * as openclaw_plugin_sdk0 from "openclaw/plugin-sdk";
3
- import * as openclaw_plugin_sdk_core0 from "openclaw/plugin-sdk/core";
4
-
5
- //#region src/openclaw/plugin.d.ts
6
- declare function register(api: OpenClawPluginApi): void;
7
- declare const _default: {
8
- id: string;
9
- name: string;
10
- description: string;
11
- configSchema: openclaw_plugin_sdk0.OpenClawPluginConfigSchema;
12
- register: NonNullable<openclaw_plugin_sdk_core0.OpenClawPluginDefinition["register"]>;
13
- } & Pick<openclaw_plugin_sdk_core0.OpenClawPluginDefinition, "kind">;
14
- //#endregion
15
- export { _default as default, register };