clawtrl-wallet 1.0.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.
Files changed (3) hide show
  1. package/README.md +49 -0
  2. package/cli.js +65 -0
  3. package/package.json +29 -0
package/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # clawtrl-wallet
2
+
3
+ Crypto wallet for AI agents on Base (Ethereum L2). ERC-8128 signing, x402 autonomous payments, ETH/USDC transfers.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npx clawtrl-wallet
9
+ ```
10
+
11
+ Works with or without root:
12
+ - **With root/sudo**: Installs to `/opt/clawtrl/`, sets up systemd service
13
+ - **Without root**: Installs to `~/.clawtrl/`, runs proxy as background process
14
+
15
+ ## What's Included
16
+
17
+ | Tool | Description |
18
+ |------|-------------|
19
+ | `wallet-info` | Get wallet address and chain identity |
20
+ | `wallet-balance` | Check ETH/USDC balances on Base |
21
+ | `signed-fetch` | ERC-8128 signed HTTP requests + x402 auto-payment |
22
+ | `crypto-send` | Send ETH or USDC to any address on Base |
23
+ | `erc8128-sign` | Sign an HTTP request and return headers |
24
+
25
+ ## Requirements
26
+
27
+ - Node.js 18+
28
+ - `AGENT_WALLET_PRIVATE_KEY` environment variable (Ethereum private key)
29
+
30
+ ## Architecture
31
+
32
+ ```
33
+ Agent → shell tool (curl) → signing proxy (:8128) → Base chain
34
+ |
35
+ ERC-8128 signing
36
+ x402 payments (v1 + v2)
37
+ USDC/ETH transfers
38
+ ```
39
+
40
+ ## Links
41
+
42
+ - [Source Code](https://github.com/PortalFnd/openclaw-skills)
43
+ - [Clawtrl](https://clawtrl.com)
44
+ - [ERC-8128](https://erc8128.org)
45
+ - [x402 Protocol](https://docs.x402.org)
46
+
47
+ ## License
48
+
49
+ MIT
package/cli.js ADDED
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+ // Clawtrl Wallet — npx installer
3
+ // Usage: npx clawtrl-wallet
4
+ // Downloads and runs install.sh from GitHub (works with or without root)
5
+
6
+ const { execSync, spawn } = require("child_process");
7
+ const https = require("https");
8
+ const fs = require("fs");
9
+ const os = require("os");
10
+ const path = require("path");
11
+
12
+ const INSTALL_URL =
13
+ "https://raw.githubusercontent.com/PortalFnd/openclaw-skills/main/clawtrl-wallet/install.sh";
14
+
15
+ function download(url) {
16
+ return new Promise((resolve, reject) => {
17
+ https.get(url, (res) => {
18
+ if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
19
+ return download(res.headers.location).then(resolve).catch(reject);
20
+ }
21
+ if (res.statusCode !== 200) {
22
+ return reject(new Error(`HTTP ${res.statusCode}`));
23
+ }
24
+ let data = "";
25
+ res.on("data", (chunk) => (data += chunk));
26
+ res.on("end", () => resolve(data));
27
+ res.on("error", reject);
28
+ }).on("error", reject);
29
+ });
30
+ }
31
+
32
+ async function main() {
33
+ console.log("");
34
+ console.log(" Clawtrl Wallet — downloading installer...");
35
+ console.log("");
36
+
37
+ try {
38
+ const script = await download(INSTALL_URL);
39
+ const tmpFile = path.join(os.tmpdir(), `clawtrl-install-${Date.now()}.sh`);
40
+ fs.writeFileSync(tmpFile, script, { mode: 0o755 });
41
+
42
+ const child = spawn("bash", [tmpFile], {
43
+ stdio: "inherit",
44
+ env: { ...process.env },
45
+ });
46
+
47
+ child.on("close", (code) => {
48
+ try { fs.unlinkSync(tmpFile); } catch {}
49
+ process.exit(code || 0);
50
+ });
51
+
52
+ child.on("error", (err) => {
53
+ console.error(" Failed to run installer:", err.message);
54
+ console.error(" Try manually: curl -sSL " + INSTALL_URL + " | bash");
55
+ try { fs.unlinkSync(tmpFile); } catch {}
56
+ process.exit(1);
57
+ });
58
+ } catch (err) {
59
+ console.error(" Failed to download installer:", err.message);
60
+ console.error(" Try manually: curl -sSL " + INSTALL_URL + " | bash");
61
+ process.exit(1);
62
+ }
63
+ }
64
+
65
+ main();
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "clawtrl-wallet",
3
+ "version": "1.0.0",
4
+ "description": "Crypto wallet for AI agents — ERC-8128 signing, x402 payments, transfers on Base",
5
+ "bin": {
6
+ "clawtrl-wallet": "./cli.js"
7
+ },
8
+ "keywords": [
9
+ "ai-agent",
10
+ "wallet",
11
+ "erc-8128",
12
+ "x402",
13
+ "base",
14
+ "ethereum",
15
+ "signing-proxy",
16
+ "openclaw",
17
+ "clawtrl"
18
+ ],
19
+ "author": "Clawtrl",
20
+ "license": "MIT",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "https://github.com/PortalFnd/openclaw-skills"
24
+ },
25
+ "homepage": "https://clawtrl.com/skills",
26
+ "engines": {
27
+ "node": ">=18"
28
+ }
29
+ }