x402-proxy-openclaw 0.11.1 → 0.11.2

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.2`];
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.2"
124
124
  }
@@ -120,5 +120,5 @@
120
120
  "advanced": true
121
121
  }
122
122
  },
123
- "version": "0.11.1"
123
+ "version": "0.11.2"
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.2",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "license": "Apache-2.0",