openclaw-arcade-plugin 0.1.13 → 0.1.15
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/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +131 -122
- 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 +138 -126
- package/openclaw.plugin.json +15 -18
- package/package.json +1 -1
- package/src/arcade.test.ts +5 -3
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
* OpenClaw Arcade Plugin
|
|
3
3
|
* Transaction broadcasting and lifecycle tracking via BSV Arcade.
|
|
4
4
|
*/
|
|
5
|
-
export declare
|
|
6
|
-
|
|
5
|
+
export declare const plugin: {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
activate(api: any): Promise<void>;
|
|
10
|
+
register(api: any): void;
|
|
11
|
+
};
|
|
12
|
+
export default plugin;
|
|
7
13
|
//# 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,eAAO,MAAM,MAAM;;;;kBAKG,GAAG;kBAIT,GAAG;CAoIlB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,134 +1,143 @@
|
|
|
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
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
||
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
6
|
+
export const plugin = {
|
|
7
|
+
id: "openclaw-arcade-plugin",
|
|
8
|
+
name: "BSV Arcade Broadcaster",
|
|
9
|
+
description: "Submit and track BSV transactions with full lifecycle visibility",
|
|
10
|
+
async activate(api) {
|
|
11
|
+
return this.register(api);
|
|
12
|
+
},
|
|
13
|
+
register(api) {
|
|
14
|
+
if (isInitialized)
|
|
15
|
+
return;
|
|
16
|
+
isInitialized = true;
|
|
17
|
+
const entries = api.getConfig?.()?.plugins?.entries || {};
|
|
18
|
+
const entry = entries['openclaw-arcade-plugin']
|
|
19
|
+
|| entries['openclaw-arcade']
|
|
20
|
+
|| entries['bsv-arcade']
|
|
21
|
+
|| {};
|
|
22
|
+
const pluginConfig = { ...entry, ...(entry.config || {}), ...(api.config || {}) };
|
|
23
|
+
const network = pluginConfig.network || 'mainnet';
|
|
24
|
+
const defaultArcadeUrl = network === 'testnet'
|
|
25
|
+
? 'https://testnet.arc.gorillapool.io'
|
|
26
|
+
: 'https://arc.gorillapool.io';
|
|
27
|
+
const arcadeUrl = (pluginConfig.arcadeUrl || defaultArcadeUrl).replace(/\/$/, '');
|
|
28
|
+
api.logger.info(`[arcade] Initializing Arcade Plugin (network: ${network}, host: ${arcadeUrl})`);
|
|
29
|
+
// 1. Tool
|
|
30
|
+
api.registerTool({
|
|
31
|
+
name: "arcade",
|
|
32
|
+
description: "Submit and track BSV transactions with full lifecycle visibility",
|
|
33
|
+
parameters: {
|
|
34
|
+
type: "object",
|
|
35
|
+
properties: {
|
|
36
|
+
action: {
|
|
37
|
+
type: "string",
|
|
38
|
+
enum: ["broadcast", "status", "proof", "config"],
|
|
39
|
+
description: "Action to perform"
|
|
40
|
+
},
|
|
41
|
+
txhex: {
|
|
42
|
+
type: "string",
|
|
43
|
+
description: "Hex-encoded raw transaction to broadcast"
|
|
44
|
+
},
|
|
45
|
+
txid: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description: "Transaction ID to track or fetch proof for"
|
|
48
|
+
}
|
|
40
49
|
},
|
|
41
|
-
|
|
42
|
-
type: "string",
|
|
43
|
-
description: "Transaction ID to track or fetch proof for"
|
|
44
|
-
}
|
|
50
|
+
required: ["action"]
|
|
45
51
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
throw new Error(`Unknown action: ${action}`);
|
|
52
|
+
async execute(_id, params) {
|
|
53
|
+
try {
|
|
54
|
+
const { action, txhex, txid } = params;
|
|
55
|
+
switch (action) {
|
|
56
|
+
case "broadcast":
|
|
57
|
+
if (!txhex)
|
|
58
|
+
throw new Error("txhex is required for broadcast");
|
|
59
|
+
const bResp = await fetch(`${arcadeUrl}/v1/tx`, {
|
|
60
|
+
method: 'POST',
|
|
61
|
+
headers: { 'Content-Type': 'application/json' },
|
|
62
|
+
body: JSON.stringify({ rawTx: txhex })
|
|
63
|
+
});
|
|
64
|
+
const bData = await bResp.json();
|
|
65
|
+
if (!bResp.ok)
|
|
66
|
+
throw new Error(`Broadcast failed: ${JSON.stringify(bData)}`);
|
|
67
|
+
return { content: [{ type: "text", text: `Transaction broadcasted! TXID: ${bData.txid}\nStatus: ${bData.txStatus}` }] };
|
|
68
|
+
case "status":
|
|
69
|
+
if (!txid)
|
|
70
|
+
throw new Error("txid is required for status check");
|
|
71
|
+
const sResp = await fetch(`${arcadeUrl}/v1/tx/${txid}`);
|
|
72
|
+
const sData = await sResp.json();
|
|
73
|
+
if (!sResp.ok)
|
|
74
|
+
throw new Error(`Status check failed: ${JSON.stringify(sData)}`);
|
|
75
|
+
return { content: [{ type: "text", text: `Transaction ${txid}:\nStatus: ${sData.txStatus}\nBlock: ${sData.blockHeight || 'Pending'}` }] };
|
|
76
|
+
case "proof":
|
|
77
|
+
if (!txid)
|
|
78
|
+
throw new Error("txid is required for proof retrieval");
|
|
79
|
+
const pResp = await fetch(`${arcadeUrl}/v1/tx/${txid}/proof`);
|
|
80
|
+
if (!pResp.ok)
|
|
81
|
+
throw new Error(`Proof retrieval failed: ${pResp.status}`);
|
|
82
|
+
const pData = await pResp.arrayBuffer();
|
|
83
|
+
const base64Proof = Buffer.from(pData).toString('base64');
|
|
84
|
+
return { content: [{ type: "text", text: `Merkle Proof (Base64): ${base64Proof}` }] };
|
|
85
|
+
case "config":
|
|
86
|
+
return { content: [{ type: "text", text: `Arcade Configuration:\nURL: ${arcadeUrl}\nNetwork: ${network}` }] };
|
|
87
|
+
default:
|
|
88
|
+
throw new Error(`Unknown action: ${action}`);
|
|
89
|
+
}
|
|
85
90
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
// Register the /arcade slash command for direct chat interaction (Autoreply)
|
|
98
|
-
api.registerCommand({
|
|
99
|
-
name: "arcade",
|
|
100
|
-
description: "BSV transaction tracking commands",
|
|
101
|
-
acceptsArgs: true,
|
|
102
|
-
requireAuth: true,
|
|
103
|
-
handler: async (ctx) => {
|
|
104
|
-
try {
|
|
105
|
-
const args = ctx.args || [];
|
|
106
|
-
const action = args[0] || 'config';
|
|
107
|
-
const params = { action };
|
|
108
|
-
if (action === 'status' && args[1])
|
|
109
|
-
params.txid = args[1];
|
|
110
|
-
if (action === 'broadcast' && args[1])
|
|
111
|
-
params.txhex = args[1];
|
|
112
|
-
// Custom logic for simplified chat output
|
|
113
|
-
if (action === 'status' && params.txid) {
|
|
114
|
-
const res = await fetch(`${arcadeUrl}/v1/tx/${params.txid}`);
|
|
115
|
-
const data = await res.json();
|
|
116
|
-
return { text: `🛡️ **Transaction Status**\n**TXID**: ${params.txid}\n**Status**: ${data.txStatus || 'Unknown'}` };
|
|
91
|
+
catch (error) {
|
|
92
|
+
return {
|
|
93
|
+
content: [{
|
|
94
|
+
type: "text",
|
|
95
|
+
text: `Error: ${error.message || String(error)}`
|
|
96
|
+
}]
|
|
97
|
+
};
|
|
117
98
|
}
|
|
118
|
-
return { text: `Command '${action}' executed.` };
|
|
119
99
|
}
|
|
120
|
-
|
|
121
|
-
|
|
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) => {
|
|
108
|
+
try {
|
|
109
|
+
const args = ctx.args || [];
|
|
110
|
+
const action = args[0] || 'config';
|
|
111
|
+
const params = { action };
|
|
112
|
+
if (action === 'help') {
|
|
113
|
+
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` };
|
|
114
|
+
}
|
|
115
|
+
if (action === 'status' && args[1])
|
|
116
|
+
params.txid = args[1];
|
|
117
|
+
if (action === 'broadcast' && args[1])
|
|
118
|
+
params.txhex = args[1];
|
|
119
|
+
// Custom logic for simplified chat output
|
|
120
|
+
if (action === 'status' && params.txid) {
|
|
121
|
+
const res = await fetch(`${arcadeUrl}/v1/tx/${params.txid}`);
|
|
122
|
+
const data = await res.json();
|
|
123
|
+
return { text: `🛡️ **Transaction Status**\n**TXID**: ${params.txid}\n**Status**: ${data.txStatus || 'Unknown'}` };
|
|
124
|
+
}
|
|
125
|
+
return { text: `Command '${action}' executed.` };
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
return { text: `❌ Arcade Error: ${error.message}` };
|
|
129
|
+
}
|
|
122
130
|
}
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
// Register CLI extensions
|
|
126
|
-
api.registerCli(({ program }) => {
|
|
127
|
-
program.command("arcade")
|
|
128
|
-
.description("BSV transaction tracking commands")
|
|
129
|
-
.action(() => {
|
|
130
|
-
console.log("Usage: arcade <action> [args]");
|
|
131
131
|
});
|
|
132
|
-
|
|
133
|
-
}
|
|
132
|
+
// 3. CLI
|
|
133
|
+
api.registerCli(({ program }) => {
|
|
134
|
+
program.command("arcade")
|
|
135
|
+
.description("BSV transaction tracking commands")
|
|
136
|
+
.action(() => {
|
|
137
|
+
console.log("Usage: arcade <action> [args]");
|
|
138
|
+
});
|
|
139
|
+
}, { descriptors: [{ name: "arcade", description: "BSV transaction tracking commands" }] });
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
export default plugin;
|
|
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":[],"mappings":"AAGA;;;GAGG;AAC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K,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;oBAE9D,0CAA0C;oBAC1C,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;wBACvC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,SAAS,UAAU,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;wBAC7D,MAAM,IAAI,GAAQ,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;wBACnC,OAAO,EAAE,IAAI,EAAE,yCAAyC,MAAM,CAAC,IAAI,iBAAiB,IAAI,CAAC,QAAQ,IAAI,SAAS,EAAE,EAAE,CAAC;oBACrH,CAAC;oBAED,OAAO,EAAE,IAAI,EAAE,YAAY,MAAM,aAAa,EAAE,CAAC;gBACnD,CAAC;gBAAC,OAAO,KAAU,EAAE,CAAC;oBACpB,OAAO,EAAE,IAAI,EAAE,mBAAmB,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;gBACtD,CAAC;YACH,CAAC;SACF,CAAC,CAAC;QAEH,SAAS;QACT,GAAG,CAAC,WAAW,CAAC,CAAC,EAAE,OAAO,EAAO,EAAE,EAAE;YACnC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;iBACtB,WAAW,CAAC,mCAAmC,CAAC;iBAChD,MAAM,CAAC,GAAG,EAAE;gBACX,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;YAC/C,CAAC,CAAC,CAAC;QACP,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC9F,CAAC;CACF,CAAC;AAEF,eAAe,MAAM,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,OA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,OAAO,EAAE,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,153 @@
|
|
|
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
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
export const plugin = {
|
|
11
|
+
id: "openclaw-arcade-plugin",
|
|
12
|
+
name: "BSV Arcade Broadcaster",
|
|
13
|
+
description: "Submit and track BSV transactions with full lifecycle visibility",
|
|
14
|
+
|
|
15
|
+
async activate(api: any) {
|
|
16
|
+
return this.register(api);
|
|
17
|
+
},
|
|
11
18
|
|
|
12
|
-
|
|
19
|
+
register(api: any) {
|
|
20
|
+
if (isInitialized) return;
|
|
21
|
+
isInitialized = true;
|
|
13
22
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
||
|
|
21
|
-
||
|
|
22
|
-
|
|
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
|
-
|
|
23
|
+
const entries = api.getConfig?.()?.plugins?.entries || {};
|
|
24
|
+
const entry = entries['openclaw-arcade-plugin']
|
|
25
|
+
|| entries['openclaw-arcade']
|
|
26
|
+
|| entries['bsv-arcade']
|
|
27
|
+
|| {};
|
|
28
|
+
|
|
29
|
+
const pluginConfig = { ...entry, ...(entry.config || {}), ...(api.config || {}) };
|
|
30
|
+
const network = pluginConfig.network || 'mainnet';
|
|
31
|
+
const defaultArcadeUrl = network === 'testnet'
|
|
32
|
+
? 'https://testnet.arc.gorillapool.io'
|
|
33
|
+
: 'https://arc.gorillapool.io';
|
|
34
|
+
const arcadeUrl = (pluginConfig.arcadeUrl || defaultArcadeUrl).replace(/\/$/, '');
|
|
35
|
+
|
|
36
|
+
api.logger.info(`[arcade] Initializing Arcade Plugin (network: ${network}, host: ${arcadeUrl})`);
|
|
37
|
+
|
|
38
|
+
// 1. Tool
|
|
39
|
+
api.registerTool({
|
|
40
|
+
name: "arcade",
|
|
41
|
+
description: "Submit and track BSV transactions with full lifecycle visibility",
|
|
42
|
+
parameters: {
|
|
43
|
+
type: "object",
|
|
44
|
+
properties: {
|
|
45
|
+
action: {
|
|
46
|
+
type: "string",
|
|
47
|
+
enum: ["broadcast", "status", "proof", "config"],
|
|
48
|
+
description: "Action to perform"
|
|
49
|
+
},
|
|
50
|
+
txhex: {
|
|
51
|
+
type: "string",
|
|
52
|
+
description: "Hex-encoded raw transaction to broadcast"
|
|
53
|
+
},
|
|
54
|
+
txid: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "Transaction ID to track or fetch proof for"
|
|
57
|
+
}
|
|
48
58
|
},
|
|
49
|
-
|
|
50
|
-
type: "string",
|
|
51
|
-
description: "Transaction ID to track or fetch proof for"
|
|
52
|
-
}
|
|
59
|
+
required: ["action"]
|
|
53
60
|
},
|
|
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
|
-
|
|
61
|
+
async execute(_id: string, params: any) {
|
|
62
|
+
try {
|
|
63
|
+
const { action, txhex, txid } = params;
|
|
64
|
+
|
|
65
|
+
switch (action) {
|
|
66
|
+
case "broadcast":
|
|
67
|
+
if (!txhex) throw new Error("txhex is required for broadcast");
|
|
68
|
+
const bResp = await fetch(`${arcadeUrl}/v1/tx`, {
|
|
69
|
+
method: 'POST',
|
|
70
|
+
headers: { 'Content-Type': 'application/json' },
|
|
71
|
+
body: JSON.stringify({ rawTx: txhex })
|
|
72
|
+
});
|
|
73
|
+
const bData: any = await bResp.json();
|
|
74
|
+
if (!bResp.ok) throw new Error(`Broadcast failed: ${JSON.stringify(bData)}`);
|
|
75
|
+
return { content: [{ type: "text", text: `Transaction broadcasted! TXID: ${bData.txid}\nStatus: ${bData.txStatus}` }] };
|
|
76
|
+
|
|
77
|
+
case "status":
|
|
78
|
+
if (!txid) throw new Error("txid is required for status check");
|
|
79
|
+
const sResp = await fetch(`${arcadeUrl}/v1/tx/${txid}`);
|
|
80
|
+
const sData: any = await sResp.json();
|
|
81
|
+
if (!sResp.ok) throw new Error(`Status check failed: ${JSON.stringify(sData)}`);
|
|
82
|
+
return { content: [{ type: "text", text: `Transaction ${txid}:\nStatus: ${sData.txStatus}\nBlock: ${sData.blockHeight || 'Pending'}` }] };
|
|
83
|
+
|
|
84
|
+
case "proof":
|
|
85
|
+
if (!txid) throw new Error("txid is required for proof retrieval");
|
|
86
|
+
const pResp = await fetch(`${arcadeUrl}/v1/tx/${txid}/proof`);
|
|
87
|
+
if (!pResp.ok) throw new Error(`Proof retrieval failed: ${pResp.status}`);
|
|
88
|
+
const pData = await pResp.arrayBuffer();
|
|
89
|
+
const base64Proof = Buffer.from(pData).toString('base64');
|
|
90
|
+
return { content: [{ type: "text", text: `Merkle Proof (Base64): ${base64Proof}` }] };
|
|
91
|
+
|
|
92
|
+
case "config":
|
|
93
|
+
return { content: [{ type: "text", text: `Arcade Configuration:\nURL: ${arcadeUrl}\nNetwork: ${network}` }] };
|
|
94
|
+
|
|
95
|
+
default:
|
|
96
|
+
throw new Error(`Unknown action: ${action}`);
|
|
97
|
+
}
|
|
98
|
+
} catch (error: any) {
|
|
99
|
+
return {
|
|
100
|
+
content: [{
|
|
101
|
+
type: "text",
|
|
102
|
+
text: `Error: ${error.message || String(error)}`
|
|
103
|
+
}]
|
|
104
|
+
};
|
|
92
105
|
}
|
|
93
|
-
} catch (error: any) {
|
|
94
|
-
return {
|
|
95
|
-
content: [{
|
|
96
|
-
type: "text",
|
|
97
|
-
text: `Error: ${error.message || String(error)}`
|
|
98
|
-
}]
|
|
99
|
-
};
|
|
100
106
|
}
|
|
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
|
-
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// 2. Command
|
|
110
|
+
api.registerCommand({
|
|
111
|
+
name: "arcade",
|
|
112
|
+
description: "BSV transaction tracking commands",
|
|
113
|
+
acceptsArgs: true,
|
|
114
|
+
requireAuth: true,
|
|
115
|
+
handler: async (ctx: any) => {
|
|
116
|
+
try {
|
|
117
|
+
const args = ctx.args || [];
|
|
118
|
+
const action = args[0] || 'config';
|
|
119
|
+
const params: any = { action };
|
|
120
|
+
|
|
121
|
+
if (action === 'help') {
|
|
122
|
+
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` };
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (action === 'status' && args[1]) params.txid = args[1];
|
|
126
|
+
if (action === 'broadcast' && args[1]) params.txhex = args[1];
|
|
125
127
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
// Custom logic for simplified chat output
|
|
129
|
+
if (action === 'status' && params.txid) {
|
|
130
|
+
const res = await fetch(`${arcadeUrl}/v1/tx/${params.txid}`);
|
|
131
|
+
const data: any = await res.json();
|
|
132
|
+
return { text: `🛡️ **Transaction Status**\n**TXID**: ${params.txid}\n**Status**: ${data.txStatus || 'Unknown'}` };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return { text: `Command '${action}' executed.` };
|
|
136
|
+
} catch (error: any) {
|
|
137
|
+
return { text: `❌ Arcade Error: ${error.message}` };
|
|
138
|
+
}
|
|
129
139
|
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
// 3. CLI
|
|
143
|
+
api.registerCli(({ program }: any) => {
|
|
144
|
+
program.command("arcade")
|
|
145
|
+
.description("BSV transaction tracking commands")
|
|
146
|
+
.action(() => {
|
|
147
|
+
console.log("Usage: arcade <action> [args]");
|
|
148
|
+
});
|
|
149
|
+
}, { descriptors: [{ name: "arcade", description: "BSV transaction tracking commands" }] });
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export default plugin;
|
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",
|
|
@@ -51,7 +47,8 @@
|
|
|
51
47
|
"mainnet",
|
|
52
48
|
"testnet"
|
|
53
49
|
],
|
|
54
|
-
"default": "mainnet"
|
|
50
|
+
"default": "mainnet",
|
|
51
|
+
"description": "BSV network to use"
|
|
55
52
|
}
|
|
56
53
|
}
|
|
57
54
|
},
|
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
|
});
|