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.
- package/CHANGELOG.md +23 -1
- package/README.md +7 -1
- package/dist/Credential-COZQnr1-.js +2055 -0
- package/dist/Mcp-CrCEqLqO.js +10 -0
- package/dist/Sse-ChldYgU7.js +9742 -0
- package/dist/Sse-kCB38G56.js +16482 -0
- package/dist/accounts-DsuvWwph.js +232 -0
- package/dist/accounts-DzvAlQRn.js +5 -0
- package/dist/accounts-IG-Cmrwy.js +229 -0
- package/dist/api-CUzmQvTQ.js +2802 -0
- package/dist/auth-DTzQmnZ_.js +1196 -0
- package/dist/bin/cli.js +585 -242
- package/dist/ccip-Bx-zoUCJ.js +240 -0
- package/dist/ccip-C2k1DD1T.js +153 -0
- package/dist/ccip-C6CQOJYv.js +152 -0
- package/dist/ccip-RZzsZ5Mv.js +156 -0
- package/dist/chain-CafcHffR.js +1997 -0
- package/dist/chain-DwfP5RGZ.js +1968 -0
- package/dist/chunk-DBEY4PJZ.js +16 -0
- package/dist/chunk-DjEMn6fM.js +36 -0
- package/dist/client-Blw2V7LF.js +657 -0
- package/dist/client-C37gWJOZ.js +102 -0
- package/dist/client-CEc4NYAA.js +6388 -0
- package/dist/client-CVDTUY0l.js +5152 -0
- package/dist/config-BUQsit4s.js +3 -0
- package/dist/config-DR1Fs_wL.js +6600 -0
- package/dist/{config-D9wIR3xc.js → config-rvKA3SYT.js} +10 -5
- package/dist/decodeFunctionData-DuFcwhC_.js +4510 -0
- package/dist/decodeFunctionData-JPOUdvil.js +4394 -0
- package/dist/derive-DNUl8LU9.js +9109 -0
- package/dist/dist-C2YO6HSQ.js +6581 -0
- package/dist/dist-DM5_F3r5.js +4 -0
- package/dist/dist-DxJCYyL5.js +1388 -0
- package/dist/hashTypedData-BHmP9dBd.js +859 -0
- package/dist/hashTypedData-CtEdfx4y.js +846 -0
- package/dist/helpers-CuUSw-tH.js +7125 -0
- package/dist/hmac-59IlS_by.js +648 -0
- package/dist/http-BAtucMbS.js +2060 -0
- package/dist/index.d.ts +1903 -9
- package/dist/index.js +18006 -50
- package/dist/index.node-CxkL0OFh.js +3592 -0
- package/dist/index.node-DvmeuZBj.js +3 -0
- package/dist/isAddressEqual-BLrd1Hg1.js +9 -0
- package/dist/isAddressEqual-DsAqfQOD.js +10 -0
- package/dist/localBatchGatewayRequest-C-RPJyDO.js +6260 -0
- package/dist/localBatchGatewayRequest-DOdQ9bR7.js +93 -0
- package/dist/localBatchGatewayRequest-DQkbZaSy.js +6261 -0
- package/dist/parseUnits-CApwcKSD.js +49 -0
- package/dist/parseUnits-cMO2udMe.js +48 -0
- package/dist/schemas-BxMFYNbH.js +1270 -0
- package/dist/secp256k1-BZpiyffY.js +2525 -0
- package/dist/secp256k1-BjenrLl5.js +1877 -0
- package/dist/secp256k1-CLPUX17u.js +3 -0
- package/dist/sendRawTransactionSync-DvSkhZtW.js +3612 -0
- package/dist/server-CSq0IuUq.js +565 -0
- package/dist/setup-BY4J49Lv.js +1110 -0
- package/dist/setup-wMOAgrsN.js +3 -0
- package/dist/sha256-FAs0qeni.js +17 -0
- package/dist/sha3-CYkWM8Xa.js +195 -0
- package/dist/sha3-DbMJRJ3C.js +194 -0
- package/dist/sse-B4LLqBQm.js +408 -0
- package/dist/status-Bu23RjW6.js +3 -0
- package/dist/{status-DihAcUSC.js → status-X21VnGUO.js} +16 -15
- package/dist/stdio-BADqxZdZ.js +85 -0
- package/dist/streamableHttp-BHkJypcI.js +358 -0
- package/dist/tempo-3nttrxgQ.js +17 -0
- package/dist/tempo-DER0P-ul.js +18 -0
- package/dist/types-BEKUz-Mf.js +1240 -0
- package/dist/types-DatK5vR5.js +3 -0
- package/dist/utils-BYjkXZDF.js +444 -0
- package/dist/utils-SeGHMW9O.js +445 -0
- package/dist/wallet-DKVlrR1S.js +3 -0
- package/dist/wallet-DSyht15_.js +17759 -0
- package/package.json +18 -71
- package/dist/config-B_upkJeK.js +0 -66
- package/dist/config-Be35NM5s.js +0 -3
- package/dist/config-J1m-CWXT.js +0 -27
- package/dist/derive-CL6e8K0Z.js +0 -81
- package/dist/openclaw/plugin.d.ts +0 -15
- package/dist/openclaw/plugin.js +0 -2067
- package/dist/openclaw.plugin.json +0 -93
- package/dist/setup-CNyMLnM-.js +0 -197
- package/dist/setup-DTIxPe58.js +0 -3
- package/dist/status-DZlJ4pS7.js +0 -3
- package/dist/wallet-B0S-rma9.js +0 -544
- package/dist/wallet-DBrVZJqe.js +0 -3
- package/openclaw.plugin.json +0 -93
- package/skills/SKILL.md +0 -183
- package/skills/references/library.md +0 -85
- package/skills/references/openclaw-plugin.md +0 -145
package/package.json
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x402-proxy",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
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
|
-
|
|
102
|
-
|
|
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
|
+
}
|
package/dist/config-B_upkJeK.js
DELETED
|
@@ -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 };
|
package/dist/config-Be35NM5s.js
DELETED
package/dist/config-J1m-CWXT.js
DELETED
|
@@ -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 };
|
package/dist/derive-CL6e8K0Z.js
DELETED
|
@@ -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 };
|