x402-proxy-openclaw 0.11.1 → 0.11.3

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/dist/commands.js CHANGED
@@ -110,15 +110,22 @@ function handleHistory(histPath, page) {
110
110
  if (nav.length > 0) lines.push("", nav.join(" · "));
111
111
  return { text: lines.join("\n") };
112
112
  }
113
+ /** Parse mnemonic from import args, stripping surrounding quotes. Returns error string or clean mnemonic. */
114
+ function parseMnemonicImport(parts) {
115
+ const words = parts.join(" ").replace(/^["'""\u201C\u201D]+|["'""\u201C\u201D]+$/g, "").split(/\s+/).filter(Boolean);
116
+ if (words.length !== 12 && words.length !== 24) return { error: `Mnemonic must be 12 or 24 words (got ${words.length}).\nUsage: \`/x_wallet setup import word1 word2 ... word24\`` };
117
+ const mnemonic = words.join(" ");
118
+ if (!isValidMnemonic(mnemonic)) return { error: "Invalid BIP-39 mnemonic. Check the words and try again." };
119
+ return { mnemonic };
120
+ }
113
121
  async function handleSetup(ctx, parts) {
114
122
  const action = parts[0]?.toLowerCase();
115
123
  let mnemonic = null;
116
124
  if (action === "generate") mnemonic = generateMnemonic();
117
125
  else if (action === "import") {
118
- const words = parts.slice(1);
119
- if (words.length !== 12 && words.length !== 24) return { text: "Mnemonic must be 12 or 24 words.\nUsage: `/x_wallet setup import word1 word2 ... word24`" };
120
- mnemonic = words.join(" ");
121
- if (!isValidMnemonic(mnemonic)) return { text: "Invalid BIP-39 mnemonic. Check the words and try again." };
126
+ const result = parseMnemonicImport(parts.slice(1));
127
+ if ("error" in result) return { text: result.error };
128
+ mnemonic = result.mnemonic;
122
129
  }
123
130
  if (!mnemonic) return { text: [
124
131
  "No wallet configured.",
@@ -162,7 +169,7 @@ function createWalletCommand(ctx) {
162
169
  if (parts[0]?.toLowerCase() === "send") return { text: "Use `/x_send <amount|all> <address>` for transfers." };
163
170
  try {
164
171
  const snap = await getWalletSnapshot(ctx.rpcUrl, solanaWallet, evmWallet, ctx.historyPath);
165
- const lines = [`x402-proxy v0.11.1`];
172
+ const lines = [`x402-proxy v0.11.3`];
166
173
  lines.push("", `**Protocol** - ${ctx.getDefaultRequestProtocol()}`);
167
174
  lines.push(`MPP session budget: ${ctx.getDefaultMppSessionBudget()} USDC`);
168
175
  lines.push(`MPP ready: ${evmWallet ? "yes" : "no"}`);
@@ -120,5 +120,5 @@
120
120
  "advanced": true
121
121
  }
122
122
  },
123
- "version": "0.11.1"
123
+ "version": "0.11.3"
124
124
  }
@@ -120,5 +120,5 @@
120
120
  "advanced": true
121
121
  }
122
122
  },
123
- "version": "0.11.1"
123
+ "version": "0.11.3"
124
124
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x402-proxy-openclaw",
3
3
  "description": "OpenClaw plugin for x402 and MPP payments, wallet tools, and paid inference proxying.",
4
- "version": "0.11.1",
4
+ "version": "0.11.3",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "license": "Apache-2.0",
package/skills/SKILL.md CHANGED
@@ -5,7 +5,7 @@ description: Use x402-proxy CLI for consuming and debugging x402 and MPP paid AP
5
5
 
6
6
  # x402-proxy
7
7
 
8
- `curl` for x402 and MPP paid APIs. Auto-pays HTTP 402 responses with USDC on Base, Solana, and [Tempo](https://tempo.xyz/). Supports one-time payments (x402, MPP charge) and pay-per-token streaming (MPP sessions).
8
+ `curl` for x402 and MPP paid APIs with MCP proxy support. Auto-pays HTTP 402 on Base, Solana, and [Tempo](https://tempo.xyz/). Supports one-time payments (x402, MPP charge) and pay-per-token streaming (MPP sessions).
9
9
 
10
10
  ## Quick start
11
11
 
@@ -22,9 +22,9 @@ First run auto-creates a wallet. No setup needed.
22
22
  npx x402-proxy https://api.example.com/resource
23
23
 
24
24
  # POST with body and headers
25
- npx x402-proxy --method POST \
26
- --header "Content-Type: application/json" \
27
- --body '{"query":"example"}' \
25
+ npx x402-proxy -X POST \
26
+ -H "Content-Type: application/json" \
27
+ -d '{"query":"example"}' \
28
28
  https://api.example.com/search
29
29
 
30
30
  # Force a specific chain