openclaw-arcade-plugin 0.1.14 → 0.1.17
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/SKILL.md +7 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/dist/src/arcade.test.js +5 -3
- package/dist/src/arcade.test.js.map +1 -1
- package/index.ts +132 -121
- package/openclaw.plugin.json +18 -20
- package/package.json +1 -1
- package/src/arcade.test.ts +5 -3
package/SKILL.md
CHANGED
|
@@ -15,6 +15,13 @@ metadata: '{"openclaw": {"requires": {"bins": ["node"]}}}'
|
|
|
15
15
|
| `proof` | Retrieve the Merkle proof for a mined transaction |
|
|
16
16
|
| `config` | Show current broadcaster URL and network |
|
|
17
17
|
|
|
18
|
+
## Network Support
|
|
19
|
+
|
|
20
|
+
The plugin is network-aware and supports:
|
|
21
|
+
- **`mainnet`**: Production network (`https://arc.gorillapool.io`).
|
|
22
|
+
- **`testnet`**: Testing network (`https://testnet.arc.gorillapool.io`).
|
|
23
|
+
- **`local`**: Local development environment (customizable URL).
|
|
24
|
+
|
|
18
25
|
## Usage Guidance
|
|
19
26
|
|
|
20
27
|
### Broadcasting Payments
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
* OpenClaw Arcade Plugin
|
|
3
3
|
* Transaction broadcasting and lifecycle tracking via BSV Arcade.
|
|
4
4
|
*/
|
|
5
|
-
export declare function
|
|
6
|
-
export
|
|
5
|
+
export declare function register(api: any): Promise<void>;
|
|
6
|
+
export declare const plugin: {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
activate: typeof register;
|
|
11
|
+
register: typeof register;
|
|
12
|
+
};
|
|
13
|
+
export default register;
|
|
7
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,GAAG,iBAoIpC;AAEH,eAAO,MAAM,MAAM;;;;;;CAMlB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
+
let isInitialized = false;
|
|
1
2
|
/**
|
|
2
3
|
* OpenClaw Arcade Plugin
|
|
3
4
|
* Transaction broadcasting and lifecycle tracking via BSV Arcade.
|
|
4
5
|
*/
|
|
5
|
-
export async function
|
|
6
|
-
return register(api);
|
|
7
|
-
}
|
|
8
|
-
let isInitialized = false;
|
|
9
|
-
export default function register(api) {
|
|
6
|
+
export async function register(api) {
|
|
10
7
|
if (isInitialized)
|
|
11
8
|
return;
|
|
12
9
|
isInitialized = true;
|
|
13
10
|
const entries = api.getConfig?.()?.plugins?.entries || {};
|
|
14
|
-
const entry = entries['
|
|
11
|
+
const entry = entries['arcade']
|
|
15
12
|
|| entries['openclaw-arcade-plugin']
|
|
13
|
+
|| entries['openclaw-arcade']
|
|
16
14
|
|| entries['bsv-arcade']
|
|
17
15
|
|| {};
|
|
18
16
|
const pluginConfig = { ...entry, ...(entry.config || {}), ...(api.config || {}) };
|
|
@@ -22,7 +20,7 @@ export default function register(api) {
|
|
|
22
20
|
: 'https://arc.gorillapool.io';
|
|
23
21
|
const arcadeUrl = (pluginConfig.arcadeUrl || defaultArcadeUrl).replace(/\/$/, '');
|
|
24
22
|
api.logger.info(`[arcade] Initializing Arcade Plugin (network: ${network}, host: ${arcadeUrl})`);
|
|
25
|
-
//
|
|
23
|
+
// 1. Tool
|
|
26
24
|
api.registerTool({
|
|
27
25
|
name: "arcade",
|
|
28
26
|
description: "Submit and track BSV transactions with full lifecycle visibility",
|
|
@@ -94,7 +92,7 @@ export default function register(api) {
|
|
|
94
92
|
}
|
|
95
93
|
}
|
|
96
94
|
});
|
|
97
|
-
//
|
|
95
|
+
// 2. Command
|
|
98
96
|
api.registerCommand({
|
|
99
97
|
name: "arcade",
|
|
100
98
|
description: "BSV transaction tracking commands",
|
|
@@ -105,6 +103,9 @@ export default function register(api) {
|
|
|
105
103
|
const args = ctx.args || [];
|
|
106
104
|
const action = args[0] || 'config';
|
|
107
105
|
const params = { action };
|
|
106
|
+
if (action === 'help') {
|
|
107
|
+
return { text: `🛡️ **Arcade Help**\n\n**Subcommands**:\n- \`status <txid>\`: Check broadcast status\n- \`broadcast <hex>\`: Send raw transaction\n- \`proof <txid>\`: Fetch Merkle Proof\n- \`config\`: Show active URL` };
|
|
108
|
+
}
|
|
108
109
|
if (action === 'status' && args[1])
|
|
109
110
|
params.txid = args[1];
|
|
110
111
|
if (action === 'broadcast' && args[1])
|
|
@@ -122,7 +123,7 @@ export default function register(api) {
|
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
});
|
|
125
|
-
//
|
|
126
|
+
// 3. CLI
|
|
126
127
|
api.registerCli(({ program }) => {
|
|
127
128
|
program.command("arcade")
|
|
128
129
|
.description("BSV transaction tracking commands")
|
|
@@ -131,4 +132,12 @@ export default function register(api) {
|
|
|
131
132
|
});
|
|
132
133
|
}, { descriptors: [{ name: "arcade", description: "BSV transaction tracking commands" }] });
|
|
133
134
|
}
|
|
135
|
+
export const plugin = {
|
|
136
|
+
id: "openclaw-arcade-plugin",
|
|
137
|
+
name: "BSV Arcade Broadcaster",
|
|
138
|
+
description: "Submit and track BSV transactions with full lifecycle visibility",
|
|
139
|
+
activate: register,
|
|
140
|
+
register: register
|
|
141
|
+
};
|
|
142
|
+
export default register;
|
|
134
143
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names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AS,UAAU,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;oBAC7D,MAAM,IAAI,GAAQ,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;oBACnC,OAAO,EAAE,IAAI,EAAE,yCAAyC,MAAM,CAAC,IAAI,iBAAiB,IAAI,CAAC,QAAQ,IAAI,SAAS,EAAE,EAAE,CAAC;gBACrH,CAAC;gBAED,OAAO,EAAE,IAAI,EAAE,YAAY,MAAM,aAAa,EAAE,CAAC;YACnD,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,OAAO,EAAE,IAAI,EAAE,mBAAmB,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YACtD,CAAC;QACH,CAAC;KACF,CAAC,CAAC;IAEH,SAAS;IACT,GAAG,CAAC,WAAW,CAAC,CAAC,EAAE,OAAO,EAAO,EAAE,EAAE;QACnC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;aACtB,WAAW,CAAC,mCAAmC,CAAC;aAChD,MAAM,CAAC,GAAG,EAAE;YACX,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC,EAAE,CAAC,CAAC;AAC9F,CAAC;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,EAAE,EAAE,wBAAwB;IAC5B,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,kEAAkE;IAC/E,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/dist/src/arcade.test.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Verifies that the arcade tool is registered correctly and handles
|
|
5
5
|
* actions as expected.
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import { plugin } from '../index.js';
|
|
8
8
|
// Simple test runner
|
|
9
9
|
let passed = 0;
|
|
10
10
|
let failed = 0;
|
|
@@ -36,10 +36,12 @@ async function run() {
|
|
|
36
36
|
registerTool: (tool) => {
|
|
37
37
|
registeredTool = tool;
|
|
38
38
|
},
|
|
39
|
+
registerCommand: () => { },
|
|
40
|
+
registerCli: () => { },
|
|
39
41
|
getConfig: () => ({
|
|
40
42
|
plugins: {
|
|
41
43
|
entries: {
|
|
42
|
-
'openclaw-arcade': {
|
|
44
|
+
'openclaw-arcade-plugin': {
|
|
43
45
|
config: {
|
|
44
46
|
arcadeUrl: 'https://arc.gorillapool.io',
|
|
45
47
|
network: 'mainnet'
|
|
@@ -50,7 +52,7 @@ async function run() {
|
|
|
50
52
|
})
|
|
51
53
|
};
|
|
52
54
|
await test('Plugin registers arcade tool', async () => {
|
|
53
|
-
register(mockApi);
|
|
55
|
+
plugin.register(mockApi);
|
|
54
56
|
assert(registeredTool !== null, 'tool should be registered');
|
|
55
57
|
assert(registeredTool.name === 'arcade', 'tool name should be arcade');
|
|
56
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arcade.test.js","sourceRoot":"","sources":["../../src/arcade.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"arcade.test.js","sourceRoot":"","sources":["../../src/arcade.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,qBAAqB;AACrB,IAAI,MAAM,GAAG,CAAC,CAAC;AACf,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf,KAAK,UAAU,IAAI,CAAC,IAAY,EAAE,EAA8B;IAC9D,IAAI,CAAC;QACH,MAAM,EAAE,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QAC3B,MAAM,EAAE,CAAC;IACX,CAAC;IAAC,OAAO,GAAY,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AE,CAAC,CAAC;QACtE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EAAE,6BAA6B,CAAC,CAAC;IACpG,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,KAAK,MAAM,YAAY,MAAM,SAAS,CAAC,CAAC;IACpD,IAAI,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC;AAED,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;IAChB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/index.ts
CHANGED
|
@@ -1,141 +1,152 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
|
|
4
|
+
let isInitialized = false;
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* OpenClaw Arcade Plugin
|
|
6
8
|
* Transaction broadcasting and lifecycle tracking via BSV Arcade.
|
|
7
9
|
*/
|
|
8
|
-
export async function
|
|
9
|
-
return register(api);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
let isInitialized = false;
|
|
13
|
-
|
|
14
|
-
export default function register(api: any) {
|
|
10
|
+
export async function register(api: any) {
|
|
15
11
|
if (isInitialized) return;
|
|
16
12
|
isInitialized = true;
|
|
17
13
|
|
|
18
14
|
const entries = api.getConfig?.()?.plugins?.entries || {};
|
|
19
|
-
const entry = entries['
|
|
15
|
+
const entry = entries['arcade']
|
|
20
16
|
|| entries['openclaw-arcade-plugin']
|
|
17
|
+
|| entries['openclaw-arcade']
|
|
21
18
|
|| entries['bsv-arcade']
|
|
22
19
|
|| {};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
20
|
+
|
|
21
|
+
const pluginConfig = { ...entry, ...(entry.config || {}), ...(api.config || {}) };
|
|
22
|
+
const network = pluginConfig.network || 'mainnet';
|
|
23
|
+
const defaultArcadeUrl = network === 'testnet'
|
|
24
|
+
? 'https://testnet.arc.gorillapool.io'
|
|
25
|
+
: 'https://arc.gorillapool.io';
|
|
26
|
+
const arcadeUrl = (pluginConfig.arcadeUrl || defaultArcadeUrl).replace(/\/$/, '');
|
|
27
|
+
|
|
28
|
+
api.logger.info(`[arcade] Initializing Arcade Plugin (network: ${network}, host: ${arcadeUrl})`);
|
|
29
|
+
|
|
30
|
+
// 1. Tool
|
|
31
|
+
api.registerTool({
|
|
32
|
+
name: "arcade",
|
|
33
|
+
description: "Submit and track BSV transactions with full lifecycle visibility",
|
|
34
|
+
parameters: {
|
|
35
|
+
type: "object",
|
|
36
|
+
properties: {
|
|
37
|
+
action: {
|
|
38
|
+
type: "string",
|
|
39
|
+
enum: ["broadcast", "status", "proof", "config"],
|
|
40
|
+
description: "Action to perform"
|
|
41
|
+
},
|
|
42
|
+
txhex: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "Hex-encoded raw transaction to broadcast"
|
|
45
|
+
},
|
|
46
|
+
txid: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "Transaction ID to track or fetch proof for"
|
|
49
|
+
}
|
|
48
50
|
},
|
|
49
|
-
|
|
50
|
-
type: "string",
|
|
51
|
-
description: "Transaction ID to track or fetch proof for"
|
|
52
|
-
}
|
|
51
|
+
required: ["action"]
|
|
53
52
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
53
|
+
async execute(_id: string, params: any) {
|
|
54
|
+
try {
|
|
55
|
+
const { action, txhex, txid } = params;
|
|
56
|
+
|
|
57
|
+
switch (action) {
|
|
58
|
+
case "broadcast":
|
|
59
|
+
if (!txhex) throw new Error("txhex is required for broadcast");
|
|
60
|
+
const bResp = await fetch(`${arcadeUrl}/v1/tx`, {
|
|
61
|
+
method: 'POST',
|
|
62
|
+
headers: { 'Content-Type': 'application/json' },
|
|
63
|
+
body: JSON.stringify({ rawTx: txhex })
|
|
64
|
+
});
|
|
65
|
+
const bData: any = await bResp.json();
|
|
66
|
+
if (!bResp.ok) throw new Error(`Broadcast failed: ${JSON.stringify(bData)}`);
|
|
67
|
+
return { content: [{ type: "text", text: `Transaction broadcasted! TXID: ${bData.txid}\nStatus: ${bData.txStatus}` }] };
|
|
68
|
+
|
|
69
|
+
case "status":
|
|
70
|
+
if (!txid) throw new Error("txid is required for status check");
|
|
71
|
+
const sResp = await fetch(`${arcadeUrl}/v1/tx/${txid}`);
|
|
72
|
+
const sData: any = await sResp.json();
|
|
73
|
+
if (!sResp.ok) throw new Error(`Status check failed: ${JSON.stringify(sData)}`);
|
|
74
|
+
return { content: [{ type: "text", text: `Transaction ${txid}:\nStatus: ${sData.txStatus}\nBlock: ${sData.blockHeight || 'Pending'}` }] };
|
|
75
|
+
|
|
76
|
+
case "proof":
|
|
77
|
+
if (!txid) throw new Error("txid is required for proof retrieval");
|
|
78
|
+
const pResp = await fetch(`${arcadeUrl}/v1/tx/${txid}/proof`);
|
|
79
|
+
if (!pResp.ok) throw new Error(`Proof retrieval failed: ${pResp.status}`);
|
|
80
|
+
const pData = await pResp.arrayBuffer();
|
|
81
|
+
const base64Proof = Buffer.from(pData).toString('base64');
|
|
82
|
+
return { content: [{ type: "text", text: `Merkle Proof (Base64): ${base64Proof}` }] };
|
|
83
|
+
|
|
84
|
+
case "config":
|
|
85
|
+
return { content: [{ type: "text", text: `Arcade Configuration:\nURL: ${arcadeUrl}\nNetwork: ${network}` }] };
|
|
86
|
+
|
|
87
|
+
default:
|
|
88
|
+
throw new Error(`Unknown action: ${action}`);
|
|
89
|
+
}
|
|
90
|
+
} catch (error: any) {
|
|
91
|
+
return {
|
|
92
|
+
content: [{
|
|
93
|
+
type: "text",
|
|
94
|
+
text: `Error: ${error.message || String(error)}`
|
|
95
|
+
}]
|
|
96
|
+
};
|
|
92
97
|
}
|
|
93
|
-
} catch (error: any) {
|
|
94
|
-
return {
|
|
95
|
-
content: [{
|
|
96
|
-
type: "text",
|
|
97
|
-
text: `Error: ${error.message || String(error)}`
|
|
98
|
-
}]
|
|
99
|
-
};
|
|
100
98
|
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const res = await fetch(`${arcadeUrl}/v1/tx/${params.txid}`);
|
|
122
|
-
const data: any = await res.json();
|
|
123
|
-
return { text: `🛡️ **Transaction Status**\n**TXID**: ${params.txid}\n**Status**: ${data.txStatus || 'Unknown'}` };
|
|
124
|
-
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// 2. Command
|
|
102
|
+
api.registerCommand({
|
|
103
|
+
name: "arcade",
|
|
104
|
+
description: "BSV transaction tracking commands",
|
|
105
|
+
acceptsArgs: true,
|
|
106
|
+
requireAuth: true,
|
|
107
|
+
handler: async (ctx: any) => {
|
|
108
|
+
try {
|
|
109
|
+
const args = ctx.args || [];
|
|
110
|
+
const action = args[0] || 'config';
|
|
111
|
+
const params: any = { action };
|
|
112
|
+
|
|
113
|
+
if (action === 'help') {
|
|
114
|
+
return { text: `🛡️ **Arcade Help**\n\n**Subcommands**:\n- \`status <txid>\`: Check broadcast status\n- \`broadcast <hex>\`: Send raw transaction\n- \`proof <txid>\`: Fetch Merkle Proof\n- \`config\`: Show active URL` };
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (action === 'status' && args[1]) params.txid = args[1];
|
|
118
|
+
if (action === 'broadcast' && args[1]) params.txhex = args[1];
|
|
125
119
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
120
|
+
// Custom logic for simplified chat output
|
|
121
|
+
if (action === 'status' && params.txid) {
|
|
122
|
+
const res = await fetch(`${arcadeUrl}/v1/tx/${params.txid}`);
|
|
123
|
+
const data: any = await res.json();
|
|
124
|
+
return { text: `🛡️ **Transaction Status**\n**TXID**: ${params.txid}\n**Status**: ${data.txStatus || 'Unknown'}` };
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return { text: `Command '${action}' executed.` };
|
|
128
|
+
} catch (error: any) {
|
|
129
|
+
return { text: `❌ Arcade Error: ${error.message}` };
|
|
130
|
+
}
|
|
129
131
|
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// 3. CLI
|
|
135
|
+
api.registerCli(({ program }: any) => {
|
|
136
|
+
program.command("arcade")
|
|
137
|
+
.description("BSV transaction tracking commands")
|
|
138
|
+
.action(() => {
|
|
139
|
+
console.log("Usage: arcade <action> [args]");
|
|
140
|
+
});
|
|
141
|
+
}, { descriptors: [{ name: "arcade", description: "BSV transaction tracking commands" }] });
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export const plugin = {
|
|
145
|
+
id: "openclaw-arcade-plugin",
|
|
146
|
+
name: "BSV Arcade Broadcaster",
|
|
147
|
+
description: "Submit and track BSV transactions with full lifecycle visibility",
|
|
148
|
+
activate: register,
|
|
149
|
+
register: register
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export default register;
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,10 +2,21 @@
|
|
|
2
2
|
"id": "openclaw-arcade-plugin",
|
|
3
3
|
"name": "BSV Arcade Broadcaster",
|
|
4
4
|
"description": "Submit and track BSV transactions with full lifecycle visibility",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.15",
|
|
6
6
|
"skills": [
|
|
7
7
|
"./SKILL.md"
|
|
8
8
|
],
|
|
9
|
+
"providerAuthEnvVars": {
|
|
10
|
+
"ARCADE_URL": "Arcade server URL for transaction broadcasting",
|
|
11
|
+
"BSV_NETWORK": "BSV network to use (mainnet/testnet)"
|
|
12
|
+
},
|
|
13
|
+
"providerAuthChoices": [
|
|
14
|
+
{
|
|
15
|
+
"id": "public-arcade",
|
|
16
|
+
"label": "Public Arcade (GorillaPool)",
|
|
17
|
+
"description": "Uses public infrastructure for broadcasting"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
9
20
|
"commands": [
|
|
10
21
|
{
|
|
11
22
|
"name": "arcade",
|
|
@@ -23,23 +34,8 @@
|
|
|
23
34
|
},
|
|
24
35
|
"configSchema": {
|
|
25
36
|
"type": "object",
|
|
26
|
-
"additionalProperties":
|
|
37
|
+
"additionalProperties": false,
|
|
27
38
|
"properties": {
|
|
28
|
-
"enabled": {
|
|
29
|
-
"type": "boolean"
|
|
30
|
-
},
|
|
31
|
-
"config": {
|
|
32
|
-
"type": "object",
|
|
33
|
-
"additionalProperties": true,
|
|
34
|
-
"properties": {
|
|
35
|
-
"arcadeUrl": {
|
|
36
|
-
"type": "string"
|
|
37
|
-
},
|
|
38
|
-
"network": {
|
|
39
|
-
"type": "string"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
39
|
"arcadeUrl": {
|
|
44
40
|
"type": "string",
|
|
45
41
|
"default": "https://arc.gorillapool.io",
|
|
@@ -49,10 +45,12 @@
|
|
|
49
45
|
"type": "string",
|
|
50
46
|
"enum": [
|
|
51
47
|
"mainnet",
|
|
52
|
-
"testnet"
|
|
48
|
+
"testnet",
|
|
49
|
+
"local"
|
|
53
50
|
],
|
|
54
|
-
"default": "mainnet"
|
|
55
|
-
|
|
51
|
+
"default": "mainnet",
|
|
52
|
+
"description": "BSV network to use"
|
|
53
|
+
},
|
|
56
54
|
}
|
|
57
55
|
},
|
|
58
56
|
"uiHints": {
|
package/package.json
CHANGED
package/src/arcade.test.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* actions as expected.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import { plugin } from '../index.js';
|
|
9
9
|
|
|
10
10
|
// Simple test runner
|
|
11
11
|
let passed = 0;
|
|
@@ -41,10 +41,12 @@ async function run() {
|
|
|
41
41
|
registerTool: (tool: any) => {
|
|
42
42
|
registeredTool = tool;
|
|
43
43
|
},
|
|
44
|
+
registerCommand: () => {},
|
|
45
|
+
registerCli: () => {},
|
|
44
46
|
getConfig: () => ({
|
|
45
47
|
plugins: {
|
|
46
48
|
entries: {
|
|
47
|
-
'openclaw-arcade': {
|
|
49
|
+
'openclaw-arcade-plugin': {
|
|
48
50
|
config: {
|
|
49
51
|
arcadeUrl: 'https://arc.gorillapool.io',
|
|
50
52
|
network: 'mainnet'
|
|
@@ -56,7 +58,7 @@ async function run() {
|
|
|
56
58
|
};
|
|
57
59
|
|
|
58
60
|
await test('Plugin registers arcade tool', async () => {
|
|
59
|
-
register(mockApi);
|
|
61
|
+
plugin.register(mockApi);
|
|
60
62
|
assert(registeredTool !== null, 'tool should be registered');
|
|
61
63
|
assert(registeredTool.name === 'arcade', 'tool name should be arcade');
|
|
62
64
|
});
|