openclaw-simplesv-plugin 0.1.0 → 0.1.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/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
- - `resolve_did`: Look up agent profiles.
16
- - `vc_issue`: Certify facts about other agents.
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 overlay plugins.
31
+ - Shared wallet identity with other OpenClaw BSV plugins.
23
32
 
24
33
  ## License
25
34
  MIT
@@ -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,QA4ExC"}
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,QA6GxC"}
package/dist/index.js CHANGED
@@ -5,11 +5,14 @@ import os from "node:os";
5
5
  * High-level blockchain utility belt (DIDs, Tokens, Inscriptions).
6
6
  */
7
7
  export default function register(api) {
8
- const pluginConfig = api.getConfig?.()?.plugins?.entries?.['openclaw-simplesv-plugin']?.config || api.config || {};
8
+ const entry = api.getConfig?.()?.plugins?.entries?.['openclaw-simplesv'] || {};
9
+ const pluginConfig = { ...entry, ...(entry.config || {}), ...(api.config || {}) };
9
10
  const network = pluginConfig.network || 'mainnet';
11
+ const chaintracksUrl = pluginConfig.chaintracksUrl || 'https://chaintracks-us-1.bsvb.tech';
10
12
  const walletDir = pluginConfig.walletDir || path.join(os.homedir(), '.openclaw', 'bsv-wallet');
11
- api.logger.info(`[simplesv] Initializing SimpleSV Plugin (network: ${network})`);
12
- // Register the simplesv tool
13
+ const enableMcp = pluginConfig.enableMcp === true;
14
+ api.logger.info(`[simplesv] Initializing SimpleSV Plugin (network: ${network}, chaintracks: ${chaintracksUrl})`);
15
+ // Register the base simplesv tool
13
16
  api.registerTool({
14
17
  name: "simplesv",
15
18
  description: "High-level BSV utility belt: DIDs, Tokens, and Inscriptions",
@@ -79,5 +82,34 @@ export default function register(api) {
79
82
  }
80
83
  }
81
84
  });
85
+ // === OPTIONAL MCP INTEGRATION ===
86
+ if (enableMcp) {
87
+ try {
88
+ // @ts-ignore
89
+ import('@bsv/simple-mcp').then((mcp) => {
90
+ api.logger.info("[simplesv] @bsv/simple-mcp detected! Mounting advanced blockchain tools...");
91
+ // Loop through all tools provided by the MCP library and register them
92
+ // Note: This logic depends on the specific export structure of @bsv/simple-mcp
93
+ if (mcp.tools) {
94
+ Object.values(mcp.tools).forEach((tool) => {
95
+ api.registerTool({
96
+ name: `simplesv_${tool.name}`,
97
+ description: `(Advanced) ${tool.description}`,
98
+ parameters: tool.parameters,
99
+ execute: async (id, params) => {
100
+ return await tool.execute(params, { walletDir, network });
101
+ }
102
+ });
103
+ });
104
+ api.logger.info(`[simplesv] Registered ${Object.keys(mcp.tools).length} advanced MCP tools.`);
105
+ }
106
+ }).catch((_err) => {
107
+ api.logger.warn("[simplesv] Failed to load @bsv/simple-mcp. Advanced tools disabled.");
108
+ });
109
+ }
110
+ catch (err) {
111
+ api.logger.warn("[simplesv] @bsv/simple-mcp not found in node_modules. Skipping advanced tools.");
112
+ }
113
+ }
82
114
  }
83
115
  //# 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;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAQ;IACvC,MAAM,YAAY,GAAG,GAAG,CAAC,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,0BAA0B,CAAC,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC;IACnH,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,IAAI,SAAS,CAAC;IAClD,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;IAE/F,GAAG,CAAC,MAAM,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AM,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAC;YACzF,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;QACpG,CAAC;IACH,CAAC;AACH,CAAC"}
package/index.ts CHANGED
@@ -6,13 +6,16 @@ import os from "node:os";
6
6
  * High-level blockchain utility belt (DIDs, Tokens, Inscriptions).
7
7
  */
8
8
  export default function register(api: any) {
9
- const pluginConfig = api.getConfig?.()?.plugins?.entries?.['openclaw-simplesv-plugin']?.config || api.config || {};
9
+ const entry = api.getConfig?.()?.plugins?.entries?.['openclaw-simplesv'] || {};
10
+ const pluginConfig = { ...entry, ...(entry.config || {}), ...(api.config || {}) };
10
11
  const network = pluginConfig.network || 'mainnet';
12
+ const chaintracksUrl = pluginConfig.chaintracksUrl || 'https://chaintracks-us-1.bsvb.tech';
11
13
  const walletDir = pluginConfig.walletDir || path.join(os.homedir(), '.openclaw', 'bsv-wallet');
14
+ const enableMcp = pluginConfig.enableMcp === true;
12
15
 
13
- api.logger.info(`[simplesv] Initializing SimpleSV Plugin (network: ${network})`);
16
+ api.logger.info(`[simplesv] Initializing SimpleSV Plugin (network: ${network}, chaintracks: ${chaintracksUrl})`);
14
17
 
15
- // Register the simplesv tool
18
+ // Register the base simplesv tool
16
19
  api.registerTool({
17
20
  name: "simplesv",
18
21
  description: "High-level BSV utility belt: DIDs, Tokens, and Inscriptions",
@@ -81,4 +84,34 @@ export default function register(api: any) {
81
84
  }
82
85
  }
83
86
  });
87
+
88
+ // === OPTIONAL MCP INTEGRATION ===
89
+ if (enableMcp) {
90
+ try {
91
+ // @ts-ignore
92
+ import('@bsv/simple-mcp').then((mcp) => {
93
+ api.logger.info("[simplesv] @bsv/simple-mcp detected! Mounting advanced blockchain tools...");
94
+
95
+ // Loop through all tools provided by the MCP library and register them
96
+ // Note: This logic depends on the specific export structure of @bsv/simple-mcp
97
+ if (mcp.tools) {
98
+ Object.values(mcp.tools).forEach((tool: any) => {
99
+ api.registerTool({
100
+ name: `simplesv_${tool.name}`,
101
+ description: `(Advanced) ${tool.description}`,
102
+ parameters: tool.parameters,
103
+ execute: async (id: string, params: any) => {
104
+ return await tool.execute(params, { walletDir, network });
105
+ }
106
+ });
107
+ });
108
+ api.logger.info(`[simplesv] Registered ${Object.keys(mcp.tools).length} advanced MCP tools.`);
109
+ }
110
+ }).catch((_err) => {
111
+ api.logger.warn("[simplesv] Failed to load @bsv/simple-mcp. Advanced tools disabled.");
112
+ });
113
+ } catch (err) {
114
+ api.logger.warn("[simplesv] @bsv/simple-mcp not found in node_modules. Skipping advanced tools.");
115
+ }
116
+ }
84
117
  }
@@ -1,8 +1,8 @@
1
1
  {
2
- "id": "openclaw-simplesv-plugin",
2
+ "id": "openclaw-simplesv",
3
3
  "name": "BSV Simple Utility Belt",
4
- "description": "High-level blockchain operations: DIDs, PushDrop tokens, and Inscriptions",
5
- "version": "0.1.0",
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
  ],
@@ -15,9 +15,19 @@
15
15
  "enum": ["mainnet", "testnet"],
16
16
  "default": "mainnet"
17
17
  },
18
+ "chaintracksUrl": {
19
+ "type": "string",
20
+ "default": "https://chaintracks-us-1.bsvb.tech",
21
+ "description": "Custom Chaintracks server URL for SPV header verification"
22
+ },
18
23
  "walletDir": {
19
24
  "type": "string",
20
25
  "description": "Path to BSV wallet storage (defaults to ~/.openclaw/bsv-wallet)"
26
+ },
27
+ "enableMcp": {
28
+ "type": "boolean",
29
+ "default": false,
30
+ "description": "Enable optional advanced tools via @bsv/simple-mcp"
21
31
  }
22
32
  }
23
33
  },
@@ -25,6 +35,16 @@
25
35
  "network": {
26
36
  "label": "Blockchain Network"
27
37
  },
38
+ "chaintracksUrl": {
39
+ "label": "Chaintracks Server URL",
40
+ "placeholder": "https://chaintracks-us-1.bsvb.tech",
41
+ "help": "Custom server for SPV block header verification",
42
+ "advanced": true
43
+ },
44
+ "enableMcp": {
45
+ "label": "Enable Advanced MCP Tools",
46
+ "help": "Requires @bsv/simple-mcp to be installed"
47
+ },
28
48
  "walletDir": {
29
49
  "label": "Wallet Directory",
30
50
  "advanced": true
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "openclaw-simplesv-plugin",
3
- "version": "0.1.0",
4
- "description": "OpenClaw plugin for advanced BSV operations (DIDs, Tokens, Inscriptions) via @bsv/simple",
3
+ "version": "0.1.3",
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": "^22.10.0",
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
- "pushdrop",
49
+ "mcp",
46
50
  "inscription"
47
51
  ],
48
52
  "author": "Tomás Díaz",
@@ -0,0 +1,2 @@
1
+ // Ambient declaration for optional dependencies
2
+ declare module "@bsv/simple-mcp";