@openclawcash/mcp-server 0.1.1 → 0.1.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/openclawcash-mcp.mjs +22 -2
- package/package.json +1 -1
package/openclawcash-mcp.mjs
CHANGED
|
@@ -174,6 +174,8 @@ const createWalletArgsSchema = z.object({
|
|
|
174
174
|
label: z.string().min(1),
|
|
175
175
|
network: z.enum(["sepolia", "mainnet", "solana-devnet", "solana-testnet", "solana-mainnet"]).optional(),
|
|
176
176
|
exportPassphrase: z.string().trim().min(12),
|
|
177
|
+
exportPassphraseStorageType: z.enum(["env", "secret_manager", "vault", "other"]),
|
|
178
|
+
exportPassphraseStorageRef: z.string().trim().min(3),
|
|
177
179
|
confirmExportPassphraseSaved: z.literal(true),
|
|
178
180
|
});
|
|
179
181
|
|
|
@@ -479,12 +481,30 @@ const tools = [
|
|
|
479
481
|
enum: ["sepolia", "mainnet", "solana-devnet", "solana-testnet", "solana-mainnet"],
|
|
480
482
|
},
|
|
481
483
|
exportPassphrase: { type: "string", minLength: 12 },
|
|
484
|
+
exportPassphraseStorageType: { type: "string", enum: ["env", "secret_manager", "vault", "other"] },
|
|
485
|
+
exportPassphraseStorageRef: { type: "string", minLength: 3 },
|
|
482
486
|
confirmExportPassphraseSaved: { type: "boolean", const: true },
|
|
483
487
|
},
|
|
484
|
-
required: ["label", "exportPassphrase", "confirmExportPassphraseSaved"],
|
|
488
|
+
required: ["label", "exportPassphrase", "exportPassphraseStorageType", "exportPassphraseStorageRef", "confirmExportPassphraseSaved"],
|
|
485
489
|
additionalProperties: false,
|
|
486
490
|
},
|
|
487
|
-
parse: (args) =>
|
|
491
|
+
parse: (args) => {
|
|
492
|
+
const parsed = createWalletArgsSchema.parse(args ?? {});
|
|
493
|
+
if (parsed.exportPassphraseStorageType === "env") {
|
|
494
|
+
const envValue = process.env[parsed.exportPassphraseStorageRef];
|
|
495
|
+
if (!envValue) {
|
|
496
|
+
throw new Error(
|
|
497
|
+
`Missing env-backed wallet export passphrase. Set ${parsed.exportPassphraseStorageRef} before calling wallet_create.`,
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
if (envValue.trim() !== parsed.exportPassphrase) {
|
|
501
|
+
throw new Error(
|
|
502
|
+
`Env verification failed for wallet_create. ${parsed.exportPassphraseStorageRef} does not match exportPassphrase.`,
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
return parsed;
|
|
507
|
+
},
|
|
488
508
|
execute: async (args) =>
|
|
489
509
|
callAgentApi({
|
|
490
510
|
method: "POST",
|
package/package.json
CHANGED