openclaw-simplesv-plugin 0.1.0 → 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/README.md +13 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -1
- package/dist/index.js.map +1 -1
- package/index.ts +32 -1
- package/openclaw.plugin.json +11 -2
- package/package.json +8 -4
- package/src/ambient.d.ts +2 -0
package/README.md
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
# OpenClaw SimpleSV Plugin
|
|
2
2
|
|
|
3
|
-
A programmatic OpenClaw plugin that provides a high-level blockchain "Utility Belt" using the **@bsv/simple** library.
|
|
3
|
+
A programmatic OpenClaw plugin that provides a high-level blockchain "Utility Belt" using the **@bsv/simple** library. It allows AI agents to manage identity, assets, and permanent data.
|
|
4
4
|
|
|
5
5
|
## Key Features
|
|
6
6
|
- **DIDs**: Manage and resolve Decentralized Identifiers (`did:bsv`).
|
|
7
7
|
- **PushDrop Tokens**: Issue and transfer tokens with encrypted state.
|
|
8
8
|
- **Inscriptions**: Permanently write data to the BSV blockchain.
|
|
9
9
|
- **Verifiable Credentials**: Issue W3C-compatible credentials for agents.
|
|
10
|
+
- **Optional MCP Integration**: Mount advanced tools from the `@bsv/simple-mcp` ecosystem.
|
|
10
11
|
|
|
11
12
|
## AI Tool: `simplesv`
|
|
12
13
|
Agents can use the `simplesv` tool to:
|
|
13
14
|
- `inscribe`: Store permanent JSON/Text records.
|
|
14
15
|
- `token_issue`: Create new digital assets or state.
|
|
15
|
-
- `
|
|
16
|
-
- `
|
|
16
|
+
- `token_transfer`: Send assets to other agents.
|
|
17
|
+
- `resolve_did`: Look up agent profiles and public keys.
|
|
18
|
+
- `vc_issue`: Certify facts about other agents (Web of Trust).
|
|
19
|
+
- `pay_p2p`: Standard peer-to-peer payments.
|
|
20
|
+
|
|
21
|
+
## Advanced MCP Tools (Optional)
|
|
22
|
+
When enabled, the plugin automatically mounts advanced tools from the Model Context Protocol server, prefixing them with `simplesv_`:
|
|
23
|
+
- `simplesv_decode_tx`: Detail transaction analysis.
|
|
24
|
+
- `simplesv_brc_lookup`: Search blockchain standards documentation.
|
|
25
|
+
- ...and many more from the `@bsv/simple-mcp` library.
|
|
17
26
|
|
|
18
27
|
## Architecture
|
|
19
28
|
Built with the **OpenClaw Plugin SDK**, this extension uses:
|
|
20
29
|
- `@bsv/simple` for high-level blockchain APIs.
|
|
21
30
|
- `@bsv/sdk` for identity and crypto.
|
|
22
|
-
- Shared wallet identity with other
|
|
31
|
+
- Shared wallet identity with other OpenClaw BSV plugins.
|
|
23
32
|
|
|
24
33
|
## License
|
|
25
34
|
MIT
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAG,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAG,EAAE,GAAG,QA2GxC"}
|
package/dist/index.js
CHANGED
|
@@ -8,8 +8,9 @@ export default function register(api) {
|
|
|
8
8
|
const pluginConfig = api.getConfig?.()?.plugins?.entries?.['openclaw-simplesv-plugin']?.config || api.config || {};
|
|
9
9
|
const network = pluginConfig.network || 'mainnet';
|
|
10
10
|
const walletDir = pluginConfig.walletDir || path.join(os.homedir(), '.openclaw', 'bsv-wallet');
|
|
11
|
+
const enableMcp = pluginConfig.enableMcp === true;
|
|
11
12
|
api.logger.info(`[simplesv] Initializing SimpleSV Plugin (network: ${network})`);
|
|
12
|
-
// Register the simplesv tool
|
|
13
|
+
// Register the base simplesv tool
|
|
13
14
|
api.registerTool({
|
|
14
15
|
name: "simplesv",
|
|
15
16
|
description: "High-level BSV utility belt: DIDs, Tokens, and Inscriptions",
|
|
@@ -79,5 +80,34 @@ export default function register(api) {
|
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
});
|
|
83
|
+
// === OPTIONAL MCP INTEGRATION ===
|
|
84
|
+
if (enableMcp) {
|
|
85
|
+
try {
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
import('@bsv/simple-mcp').then((mcp) => {
|
|
88
|
+
api.logger.info("[simplesv] @bsv/simple-mcp detected! Mounting advanced blockchain tools...");
|
|
89
|
+
// Loop through all tools provided by the MCP library and register them
|
|
90
|
+
// Note: This logic depends on the specific export structure of @bsv/simple-mcp
|
|
91
|
+
if (mcp.tools) {
|
|
92
|
+
Object.values(mcp.tools).forEach((tool) => {
|
|
93
|
+
api.registerTool({
|
|
94
|
+
name: `simplesv_${tool.name}`,
|
|
95
|
+
description: `(Advanced) ${tool.description}`,
|
|
96
|
+
parameters: tool.parameters,
|
|
97
|
+
execute: async (id, params) => {
|
|
98
|
+
return await tool.execute(params, { walletDir, network });
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
api.logger.info(`[simplesv] Registered ${Object.keys(mcp.tools).length} advanced MCP tools.`);
|
|
103
|
+
}
|
|
104
|
+
}).catch((_err) => {
|
|
105
|
+
api.logger.warn("[simplesv] Failed to load @bsv/simple-mcp. Advanced tools disabled.");
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
api.logger.warn("[simplesv] @bsv/simple-mcp not found in node_modules. Skipping advanced tools.");
|
|
110
|
+
}
|
|
111
|
+
}
|
|
82
112
|
}
|
|
83
113
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB;;;GAGG;A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AC,MAAM,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;QACpG,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/index.ts
CHANGED
|
@@ -9,10 +9,11 @@ export default function register(api: any) {
|
|
|
9
9
|
const pluginConfig = api.getConfig?.()?.plugins?.entries?.['openclaw-simplesv-plugin']?.config || api.config || {};
|
|
10
10
|
const network = pluginConfig.network || 'mainnet';
|
|
11
11
|
const walletDir = pluginConfig.walletDir || path.join(os.homedir(), '.openclaw', 'bsv-wallet');
|
|
12
|
+
const enableMcp = pluginConfig.enableMcp === true;
|
|
12
13
|
|
|
13
14
|
api.logger.info(`[simplesv] Initializing SimpleSV Plugin (network: ${network})`);
|
|
14
15
|
|
|
15
|
-
// Register the simplesv tool
|
|
16
|
+
// Register the base simplesv tool
|
|
16
17
|
api.registerTool({
|
|
17
18
|
name: "simplesv",
|
|
18
19
|
description: "High-level BSV utility belt: DIDs, Tokens, and Inscriptions",
|
|
@@ -81,4 +82,34 @@ export default function register(api: any) {
|
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
});
|
|
85
|
+
|
|
86
|
+
// === OPTIONAL MCP INTEGRATION ===
|
|
87
|
+
if (enableMcp) {
|
|
88
|
+
try {
|
|
89
|
+
// @ts-ignore
|
|
90
|
+
import('@bsv/simple-mcp').then((mcp) => {
|
|
91
|
+
api.logger.info("[simplesv] @bsv/simple-mcp detected! Mounting advanced blockchain tools...");
|
|
92
|
+
|
|
93
|
+
// Loop through all tools provided by the MCP library and register them
|
|
94
|
+
// Note: This logic depends on the specific export structure of @bsv/simple-mcp
|
|
95
|
+
if (mcp.tools) {
|
|
96
|
+
Object.values(mcp.tools).forEach((tool: any) => {
|
|
97
|
+
api.registerTool({
|
|
98
|
+
name: `simplesv_${tool.name}`,
|
|
99
|
+
description: `(Advanced) ${tool.description}`,
|
|
100
|
+
parameters: tool.parameters,
|
|
101
|
+
execute: async (id: string, params: any) => {
|
|
102
|
+
return await tool.execute(params, { walletDir, network });
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
api.logger.info(`[simplesv] Registered ${Object.keys(mcp.tools).length} advanced MCP tools.`);
|
|
107
|
+
}
|
|
108
|
+
}).catch((_err) => {
|
|
109
|
+
api.logger.warn("[simplesv] Failed to load @bsv/simple-mcp. Advanced tools disabled.");
|
|
110
|
+
});
|
|
111
|
+
} catch (err) {
|
|
112
|
+
api.logger.warn("[simplesv] @bsv/simple-mcp not found in node_modules. Skipping advanced tools.");
|
|
113
|
+
}
|
|
114
|
+
}
|
|
84
115
|
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "openclaw-simplesv-plugin",
|
|
3
3
|
"name": "BSV Simple Utility Belt",
|
|
4
|
-
"description": "High-level blockchain operations: DIDs, PushDrop tokens, and Inscriptions",
|
|
5
|
-
"version": "0.1.
|
|
4
|
+
"description": "High-level blockchain operations: DIDs, PushDrop tokens, and Inscriptions. Supports optional MCP integration.",
|
|
5
|
+
"version": "0.1.2",
|
|
6
6
|
"skills": [
|
|
7
7
|
"./SKILL.md"
|
|
8
8
|
],
|
|
@@ -18,6 +18,11 @@
|
|
|
18
18
|
"walletDir": {
|
|
19
19
|
"type": "string",
|
|
20
20
|
"description": "Path to BSV wallet storage (defaults to ~/.openclaw/bsv-wallet)"
|
|
21
|
+
},
|
|
22
|
+
"enableMcp": {
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"default": false,
|
|
25
|
+
"description": "Enable optional advanced tools via @bsv/simple-mcp"
|
|
21
26
|
}
|
|
22
27
|
}
|
|
23
28
|
},
|
|
@@ -25,6 +30,10 @@
|
|
|
25
30
|
"network": {
|
|
26
31
|
"label": "Blockchain Network"
|
|
27
32
|
},
|
|
33
|
+
"enableMcp": {
|
|
34
|
+
"label": "Enable Advanced MCP Tools",
|
|
35
|
+
"help": "Requires @bsv/simple-mcp to be installed"
|
|
36
|
+
},
|
|
28
37
|
"walletDir": {
|
|
29
38
|
"label": "Wallet Directory",
|
|
30
39
|
"advanced": true
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-simplesv-plugin",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "OpenClaw plugin for advanced BSV operations (DIDs, Tokens, Inscriptions) via @bsv/simple",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "OpenClaw plugin for advanced BSV operations (DIDs, Tokens, Inscriptions) via @bsv/simple and optional MCP integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"index.ts",
|
|
9
|
+
"src/ambient.d.ts",
|
|
9
10
|
"openclaw.plugin.json",
|
|
10
11
|
"src/",
|
|
11
12
|
"dist/",
|
|
@@ -26,8 +27,11 @@
|
|
|
26
27
|
"knex": "^3.2.8",
|
|
27
28
|
"dotenv": "^17.3.1"
|
|
28
29
|
},
|
|
30
|
+
"optionalDependencies": {
|
|
31
|
+
"@bsv/simple-mcp": "^1.0.0"
|
|
32
|
+
},
|
|
29
33
|
"devDependencies": {
|
|
30
|
-
"@types/node": "^
|
|
34
|
+
"@types/node": "^25.5.0",
|
|
31
35
|
"typescript": "^6.0.2",
|
|
32
36
|
"eslint": "^10.1.0"
|
|
33
37
|
},
|
|
@@ -42,7 +46,7 @@
|
|
|
42
46
|
"bsv",
|
|
43
47
|
"did",
|
|
44
48
|
"tokens",
|
|
45
|
-
"
|
|
49
|
+
"mcp",
|
|
46
50
|
"inscription"
|
|
47
51
|
],
|
|
48
52
|
"author": "Tomás Díaz",
|
package/src/ambient.d.ts
ADDED