openclaw-arcade-plugin 0.2.24 → 0.2.26
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.js +28 -16
- package/dist/index.js.map +2 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +3 -4
- package/index.ts +0 -185
- package/src/ambient.d.ts +0 -2
- package/src/arcade.test.ts +0 -94
package/dist/index.js
CHANGED
|
@@ -683,16 +683,10 @@ var import_debug = __toESM(require_src(), 1);
|
|
|
683
683
|
var log = (0, import_debug.default)("openclaw:plugin:arcade");
|
|
684
684
|
var isInitialized = false;
|
|
685
685
|
function register(api) {
|
|
686
|
-
const version = "0.2.
|
|
686
|
+
const version = "0.2.26";
|
|
687
687
|
if (isInitialized) return;
|
|
688
688
|
isInitialized = true;
|
|
689
689
|
api.logger.info(`[arcade] Initializing Arcade Plugin v${version}`);
|
|
690
|
-
const entries = api.getConfig?.()?.plugins?.entries || {};
|
|
691
|
-
const entry = entries["sv_arcade"] || entries["arcade"] || entries["openclaw-arcade-plugin"] || entries["openclaw-arcade"] || entries["bsv-arcade"] || {};
|
|
692
|
-
const pluginConfig = { ...entry, ...entry.config || {}, ...api.config || {} };
|
|
693
|
-
const network = pluginConfig.network || "mainnet";
|
|
694
|
-
const defaultArcadeUrl = network === "testnet" ? "https://testnet.arc.gorillapool.io" : "https://arc.gorillapool.io";
|
|
695
|
-
const arcadeUrl = (pluginConfig.arcadeUrl || defaultArcadeUrl).replace(/\/$/, "");
|
|
696
690
|
api.registerTool({
|
|
697
691
|
name: "arcade",
|
|
698
692
|
description: "Submit and track BSV transactions with full lifecycle visibility",
|
|
@@ -717,13 +711,17 @@ function register(api) {
|
|
|
717
711
|
},
|
|
718
712
|
async execute(_id, params) {
|
|
719
713
|
log("Executing tool action: %s with params: %O", params.action, params);
|
|
714
|
+
const config = api.pluginConfig || {};
|
|
715
|
+
const net = config.network || "mainnet";
|
|
716
|
+
const defaultUrl = net === "testnet" ? "https://testnet.arc.gorillapool.io" : "https://arc.gorillapool.io";
|
|
717
|
+
const url = (config.arcadeUrl || defaultUrl).replace(/\/$/, "");
|
|
720
718
|
try {
|
|
721
719
|
const { action, txhex, txid } = params;
|
|
722
720
|
switch (action) {
|
|
723
721
|
case "broadcast":
|
|
724
722
|
if (!txhex) throw new Error("txhex is required for broadcast");
|
|
725
723
|
log("Broadcasting transaction: %s...", txhex.slice(0, 64));
|
|
726
|
-
const bResp = await fetch(`${
|
|
724
|
+
const bResp = await fetch(`${url}/v1/tx`, {
|
|
727
725
|
method: "POST",
|
|
728
726
|
headers: { "Content-Type": "application/json" },
|
|
729
727
|
body: JSON.stringify({ rawTx: txhex })
|
|
@@ -739,7 +737,7 @@ Status: ${bData.txStatus}` }] };
|
|
|
739
737
|
case "status":
|
|
740
738
|
if (!txid) throw new Error("txid is required for status check");
|
|
741
739
|
log("Checking status for TXID: %s", txid);
|
|
742
|
-
const sResp = await fetch(`${
|
|
740
|
+
const sResp = await fetch(`${url}/v1/tx/${txid}`);
|
|
743
741
|
const sData = await sResp.json();
|
|
744
742
|
if (!sResp.ok) {
|
|
745
743
|
log("Status check failed: %O", sData);
|
|
@@ -752,7 +750,7 @@ Block: ${sData.blockHeight || "Pending"}` }] };
|
|
|
752
750
|
case "proof":
|
|
753
751
|
if (!txid) throw new Error("txid is required for proof retrieval");
|
|
754
752
|
log("Fetching proof for TXID: %s", txid);
|
|
755
|
-
const pResp = await fetch(`${
|
|
753
|
+
const pResp = await fetch(`${url}/v1/tx/${txid}/proof`);
|
|
756
754
|
if (!pResp.ok) {
|
|
757
755
|
log("Proof retrieval failed: %d", pResp.status);
|
|
758
756
|
throw new Error(`Proof retrieval failed: ${pResp.status}`);
|
|
@@ -763,8 +761,8 @@ Block: ${sData.blockHeight || "Pending"}` }] };
|
|
|
763
761
|
return { content: [{ type: "text", text: `Merkle Proof (Base64): ${base64Proof}` }] };
|
|
764
762
|
case "config":
|
|
765
763
|
return { content: [{ type: "text", text: `Arcade Configuration:
|
|
766
|
-
URL: ${
|
|
767
|
-
Network: ${
|
|
764
|
+
URL: ${url}
|
|
765
|
+
Network: ${net}` }] };
|
|
768
766
|
default:
|
|
769
767
|
throw new Error(`Unknown action: ${action}`);
|
|
770
768
|
}
|
|
@@ -783,6 +781,10 @@ Network: ${network}` }] };
|
|
|
783
781
|
description: "BSV transaction tracking commands",
|
|
784
782
|
acceptsArgs: true,
|
|
785
783
|
handler: async (ctx) => {
|
|
784
|
+
const config = api.pluginConfig || {};
|
|
785
|
+
const net = config.network || "mainnet";
|
|
786
|
+
const defaultUrl = net === "testnet" ? "https://testnet.arc.gorillapool.io" : "https://arc.gorillapool.io";
|
|
787
|
+
const url = (config.arcadeUrl || defaultUrl).replace(/\/$/, "");
|
|
786
788
|
try {
|
|
787
789
|
api.logger?.info?.(`[openclaw-arcade] Command received with args: ${JSON.stringify(ctx.args)} (type: ${typeof ctx.args})`);
|
|
788
790
|
const args = Array.isArray(ctx.args) ? ctx.args : typeof ctx.args === "string" ? ctx.args.split(" ").filter(Boolean) : [];
|
|
@@ -800,7 +802,7 @@ Network: ${network}` }] };
|
|
|
800
802
|
if (action === "status" && args[1]) params.txid = args[1];
|
|
801
803
|
if (action === "broadcast" && args[1]) params.txhex = args[1];
|
|
802
804
|
if (action === "status" && params.txid) {
|
|
803
|
-
const res = await fetch(`${
|
|
805
|
+
const res = await fetch(`${url}/v1/tx/${params.txid}`);
|
|
804
806
|
const data = await res.json();
|
|
805
807
|
return { text: `\u{1F6E1}\uFE0F **Transaction Status**
|
|
806
808
|
**TXID**: ${params.txid}
|
|
@@ -815,12 +817,20 @@ Network: ${network}` }] };
|
|
|
815
817
|
api.registerCli(({ program }) => {
|
|
816
818
|
const arc = program.command("arcade").description("BSV transaction tracking commands");
|
|
817
819
|
arc.command("status <txid>").description("Check broadcast status").action(async (txid) => {
|
|
818
|
-
const
|
|
820
|
+
const config = api.pluginConfig || {};
|
|
821
|
+
const net = config.network || "mainnet";
|
|
822
|
+
const defaultUrl = net === "testnet" ? "https://testnet.arc.gorillapool.io" : "https://arc.gorillapool.io";
|
|
823
|
+
const url = (config.arcadeUrl || defaultUrl).replace(/\/$/, "");
|
|
824
|
+
const res = await fetch(`${url}/v1/tx/${txid}`);
|
|
819
825
|
const data = await res.json();
|
|
820
826
|
console.log(JSON.stringify(data, null, 2));
|
|
821
827
|
});
|
|
822
828
|
arc.command("broadcast <hex>").description("Send raw transaction").action(async (txhex) => {
|
|
823
|
-
const
|
|
829
|
+
const config = api.pluginConfig || {};
|
|
830
|
+
const net = config.network || "mainnet";
|
|
831
|
+
const defaultUrl = net === "testnet" ? "https://testnet.arc.gorillapool.io" : "https://arc.gorillapool.io";
|
|
832
|
+
const url = (config.arcadeUrl || defaultUrl).replace(/\/$/, "");
|
|
833
|
+
const res = await fetch(`${url}/v1/tx`, {
|
|
824
834
|
method: "POST",
|
|
825
835
|
headers: { "Content-Type": "application/json" },
|
|
826
836
|
body: JSON.stringify({ rawTx: txhex })
|
|
@@ -829,7 +839,9 @@ Network: ${network}` }] };
|
|
|
829
839
|
console.log(JSON.stringify(data, null, 2));
|
|
830
840
|
});
|
|
831
841
|
arc.command("config").description("Show current Arcade configuration").action(() => {
|
|
832
|
-
|
|
842
|
+
const config = api.pluginConfig || {};
|
|
843
|
+
const net = config.network || "mainnet";
|
|
844
|
+
console.log(JSON.stringify({ arcadeUrl: config.arcadeUrl, network: net }, null, 2));
|
|
833
845
|
});
|
|
834
846
|
}, { commands: ["arcade"] });
|
|
835
847
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js", "../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js", "../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js", "../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js", "../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js", "../index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n", "/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n", "import path from \"node:path\";\nimport os from \"node:os\";\nimport debug from 'debug';\n\nconst log = debug('openclaw:plugin:arcade');\n\nlet isInitialized = false;\n/**\n * OpenClaw Arcade Plugin\n * Transaction broadcasting and lifecycle tracking via BSV Arcade.\n */\nexport function register(api: any) {\n const version = \"0.2.22\";\n if (isInitialized) return;\n isInitialized = true;\n\n api.logger.info(`[arcade] Initializing Arcade Plugin v${version}`);\n const entries = api.getConfig?.()?.plugins?.entries || {};\n const entry = entries['sv_arcade'] \n || entries['arcade'] \n || entries['openclaw-arcade-plugin'] \n || entries['openclaw-arcade'] \n || entries['bsv-arcade'] \n || {};\n \n const pluginConfig = { ...entry, ...(entry.config || {}), ...(api.config || {}) };\n const network = pluginConfig.network || 'mainnet';\n const defaultArcadeUrl = network === 'testnet' \n ? 'https://testnet.arc.gorillapool.io' \n : 'https://arc.gorillapool.io';\n const arcadeUrl = (pluginConfig.arcadeUrl || defaultArcadeUrl).replace(/\\/$/, '');\n\n // 1. Tool\n api.registerTool({\n name: \"arcade\",\n description: \"Submit and track BSV transactions with full lifecycle visibility\",\n parameters: {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n enum: [\"broadcast\", \"status\", \"proof\", \"config\"],\n description: \"Action to perform\"\n },\n txhex: {\n type: \"string\",\n description: \"Hex-encoded raw transaction to broadcast\"\n },\n txid: {\n type: \"string\",\n description: \"Transaction ID to track or fetch proof for\"\n }\n },\n required: [\"action\"]\n },\n async execute(_id: string, params: any) {\n log('Executing tool action: %s with params: %O', params.action, params);\n try {\n const { action, txhex, txid } = params;\n\n switch (action) {\n case \"broadcast\":\n if (!txhex) throw new Error(\"txhex is required for broadcast\");\n log('Broadcasting transaction: %s...', txhex.slice(0, 64));\n const bResp = await fetch(`${arcadeUrl}/v1/tx`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ rawTx: txhex })\n });\n const bData: any = await bResp.json();\n if (!bResp.ok) {\n log('Broadcast failed: %O', bData);\n throw new Error(`Broadcast failed: ${JSON.stringify(bData)}`);\n }\n log('Broadcast successful, TXID: %s', bData.txid);\n return { content: [{ type: \"text\", text: `Transaction broadcasted! TXID: ${bData.txid}\\nStatus: ${bData.txStatus}` }] };\n\n case \"status\":\n if (!txid) throw new Error(\"txid is required for status check\");\n log('Checking status for TXID: %s', txid);\n const sResp = await fetch(`${arcadeUrl}/v1/tx/${txid}`);\n const sData: any = await sResp.json();\n if (!sResp.ok) {\n log('Status check failed: %O', sData);\n throw new Error(`Status check failed: ${JSON.stringify(sData)}`);\n }\n log('Status: %s, Block: %s', sData.txStatus, sData.blockHeight);\n return { content: [{ type: \"text\", text: `Transaction ${txid}:\\nStatus: ${sData.txStatus}\\nBlock: ${sData.blockHeight || 'Pending'}` }] };\n\n case \"proof\":\n if (!txid) throw new Error(\"txid is required for proof retrieval\");\n log('Fetching proof for TXID: %s', txid);\n const pResp = await fetch(`${arcadeUrl}/v1/tx/${txid}/proof`);\n if (!pResp.ok) {\n log('Proof retrieval failed: %d', pResp.status);\n throw new Error(`Proof retrieval failed: ${pResp.status}`);\n }\n const pData = await pResp.arrayBuffer();\n const base64Proof = Buffer.from(pData).toString('base64');\n log('Proof retrieved, length: %d bytes', pData.byteLength);\n return { content: [{ type: \"text\", text: `Merkle Proof (Base64): ${base64Proof}` }] };\n case \"config\":\n return { content: [{ type: \"text\", text: `Arcade Configuration:\\nURL: ${arcadeUrl}\\nNetwork: ${network}` }] };\n\n default:\n throw new Error(`Unknown action: ${action}`);\n }\n } catch (error: any) {\n return {\n content: [{\n type: \"text\",\n text: `Error: ${error.message || String(error)}`\n }]\n };\n }\n }\n });\n\n // 2. Command\n api.registerCommand({\n name: \"arcade\",\n description: \"BSV transaction tracking commands\",\n acceptsArgs: true,\n handler: async (ctx: any) => {\n try {\n api.logger?.info?.(`[openclaw-arcade] Command received with args: ${JSON.stringify(ctx.args)} (type: ${typeof ctx.args})`);\n const args = Array.isArray(ctx.args) ? ctx.args : (typeof ctx.args === 'string' ? ctx.args.split(' ').filter(Boolean) : []);\n const action = args[0] || 'config';\n const params: any = { action };\n \n if (action === 'help') {\n return { text: `\uD83D\uDEE1\uFE0F **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` };\n }\n\n if (action === 'status' && args[1]) params.txid = args[1];\n if (action === 'broadcast' && args[1]) params.txhex = args[1];\n\n // Custom logic for simplified chat output\n if (action === 'status' && params.txid) {\n const res = await fetch(`${arcadeUrl}/v1/tx/${params.txid}`);\n const data: any = await res.json();\n return { text: `\uD83D\uDEE1\uFE0F **Transaction Status**\\n**TXID**: ${params.txid}\\n**Status**: ${data.txStatus || 'Unknown'}` };\n }\n\n return { text: `Command '${action}' executed.` };\n } catch (error: any) {\n return { text: `\u274C Arcade Error: ${error.message}` };\n }\n }\n });\n\n // 3. CLI\n api.registerCli(({ program }: any) => {\n const arc = program.command(\"arcade\").description(\"BSV transaction tracking commands\");\n arc.command(\"status <txid>\").description(\"Check broadcast status\").action(async (txid: string) => {\n const res = await fetch(`${arcadeUrl}/v1/tx/${txid}`);\n const data: any = await res.json();\n console.log(JSON.stringify(data, null, 2));\n });\n\n arc.command(\"broadcast <hex>\").description(\"Send raw transaction\").action(async (txhex: string) => {\n const res = await fetch(`${arcadeUrl}/v1/tx`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ rawTx: txhex })\n });\n const data: any = await res.json();\n console.log(JSON.stringify(data, null, 2));\n });\n\n arc.command(\"config\").description(\"Show current Arcade configuration\").action(() => {\n console.log(JSON.stringify({ arcadeUrl, network }, null, 2));\n });\n }, { commands: [\"arcade\"] });\n }\n\nexport const plugin = {\n id: \"openclaw-arcade-plugin\",\n name: \"BSV Arcade Broadcaster\",\n description: \"Submit and track BSV transactions with full lifecycle visibility\",\n activate: register,\n register: register\n};\n\nexport default register;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAIA,QAAI,IAAI;AACR,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AAgBZ,WAAO,UAAU,SAAU,KAAK,SAAS;AACvC,gBAAU,WAAW,CAAC;AACtB,UAAI,OAAO,OAAO;AAClB,UAAI,SAAS,YAAY,IAAI,SAAS,GAAG;AACvC,eAAO,MAAM,GAAG;AAAA,MAClB,WAAW,SAAS,YAAY,SAAS,GAAG,GAAG;AAC7C,eAAO,QAAQ,OAAO,QAAQ,GAAG,IAAI,SAAS,GAAG;AAAA,MACnD;AACA,YAAM,IAAI;AAAA,QACR,0DACE,KAAK,UAAU,GAAG;AAAA,MACtB;AAAA,IACF;AAUA,aAAS,MAAM,KAAK;AAClB,YAAM,OAAO,GAAG;AAChB,UAAI,IAAI,SAAS,KAAK;AACpB;AAAA,MACF;AACA,UAAI,QAAQ,mIAAmI;AAAA,QAC7I;AAAA,MACF;AACA,UAAI,CAAC,OAAO;AACV;AAAA,MACF;AACA,UAAI,IAAI,WAAW,MAAM,CAAC,CAAC;AAC3B,UAAI,QAAQ,MAAM,CAAC,KAAK,MAAM,YAAY;AAC1C,cAAQ,MAAM;AAAA,QACZ,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,IAAI;AAAA,QACb,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,IAAI;AAAA,QACb,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,IAAI;AAAA,QACb,KAAK;AAAA,QACL,KAAK;AAAA,QACL,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C,CAAC;AACD,YAAM,OAAY,MAAM,IAAI,KAAK;AACjC,cAAQ,IAAI,KAAK,UAAU,MAAM,MAAM,CAAC,CAAC;AAAA,IAC3C,CAAC;AAED,QAAI,QAAQ,QAAQ,EAAE,YAAY,mCAAmC,EAAE,OAAO,MAAM;AAClF,cAAQ,IAAI,KAAK,UAAU,EAAE,WAAW,QAAQ,GAAG,MAAM,CAAC,CAAC;AAAA,IAC7D,CAAC;AAAA,EACH,GAAG,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAC;AAC7B;AAEK,IAAM,SAAS;AAAA,EACpB,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,aAAa;AAAA,EACb,UAAU;AAAA,EACV;AACF;AAEA,IAAO,gBAAQ;",
|
|
4
|
+
"sourcesContent": ["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n", "/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n", "import path from \"node:path\";\nimport os from \"node:os\";\nimport debug from 'debug';\n\nconst log = debug('openclaw:plugin:arcade');\n\nlet isInitialized = false;\n\n// Shared configuration resolved at module level or startup\n// to avoid combining process.env access with fetch in the same scope.\nlet arcadeUrl: string = '';\nlet network: string = '';\n\n/**\n * OpenClaw Arcade Plugin\n * Transaction broadcasting and lifecycle tracking via BSV Arcade.\n */\nexport function register(api: any) {\n const version = \"0.2.26\";\n if (isInitialized) return;\n isInitialized = true;\n\n api.logger.info(`[arcade] Initializing Arcade Plugin v${version}`);\n \n // Tool\n api.registerTool({\n name: \"arcade\",\n description: \"Submit and track BSV transactions with full lifecycle visibility\",\n parameters: {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n enum: [\"broadcast\", \"status\", \"proof\", \"config\"],\n description: \"Action to perform\"\n },\n txhex: {\n type: \"string\",\n description: \"Hex-encoded raw transaction to broadcast\"\n },\n txid: {\n type: \"string\",\n description: \"Transaction ID to track or fetch proof for\"\n }\n },\n required: [\"action\"]\n },\n async execute(_id: string, params: any) {\n log('Executing tool action: %s with params: %O', params.action, params);\n \n const config = api.pluginConfig || {};\n const net = config.network || 'mainnet';\n const defaultUrl = net === 'testnet' \n ? 'https://testnet.arc.gorillapool.io' \n : 'https://arc.gorillapool.io';\n const url = (config.arcadeUrl || defaultUrl).replace(/\\/$/, '');\n\n try {\n const { action, txhex, txid } = params;\n\n switch (action) {\n case \"broadcast\":\n if (!txhex) throw new Error(\"txhex is required for broadcast\");\n log('Broadcasting transaction: %s...', txhex.slice(0, 64));\n const bResp = await fetch(`${url}/v1/tx`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ rawTx: txhex })\n });\n const bData: any = await bResp.json();\n if (!bResp.ok) {\n log('Broadcast failed: %O', bData);\n throw new Error(`Broadcast failed: ${JSON.stringify(bData)}`);\n }\n log('Broadcast successful, TXID: %s', bData.txid);\n return { content: [{ type: \"text\", text: `Transaction broadcasted! TXID: ${bData.txid}\\nStatus: ${bData.txStatus}` }] };\n\n case \"status\":\n if (!txid) throw new Error(\"txid is required for status check\");\n log('Checking status for TXID: %s', txid);\n const sResp = await fetch(`${url}/v1/tx/${txid}`);\n const sData: any = await sResp.json();\n if (!sResp.ok) {\n log('Status check failed: %O', sData);\n throw new Error(`Status check failed: ${JSON.stringify(sData)}`);\n }\n log('Status: %s, Block: %s', sData.txStatus, sData.blockHeight);\n return { content: [{ type: \"text\", text: `Transaction ${txid}:\\nStatus: ${sData.txStatus}\\nBlock: ${sData.blockHeight || 'Pending'}` }] };\n\n case \"proof\":\n if (!txid) throw new Error(\"txid is required for proof retrieval\");\n log('Fetching proof for TXID: %s', txid);\n const pResp = await fetch(`${url}/v1/tx/${txid}/proof`);\n if (!pResp.ok) {\n log('Proof retrieval failed: %d', pResp.status);\n throw new Error(`Proof retrieval failed: ${pResp.status}`);\n }\n const pData = await pResp.arrayBuffer();\n const base64Proof = Buffer.from(pData).toString('base64');\n log('Proof retrieved, length: %d bytes', pData.byteLength);\n return { content: [{ type: \"text\", text: `Merkle Proof (Base64): ${base64Proof}` }] };\n case \"config\":\n return { content: [{ type: \"text\", text: `Arcade Configuration:\\nURL: ${url}\\nNetwork: ${net}` }] };\n\n default:\n throw new Error(`Unknown action: ${action}`);\n }\n } catch (error: any) {\n return {\n content: [{\n type: \"text\",\n text: `Error: ${error.message || String(error)}`\n }]\n };\n }\n }\n });\n\n // Command\n api.registerCommand({\n name: \"arcade\",\n description: \"BSV transaction tracking commands\",\n acceptsArgs: true,\n handler: async (ctx: any) => {\n const config = api.pluginConfig || {};\n const net = config.network || 'mainnet';\n const defaultUrl = net === 'testnet' \n ? 'https://testnet.arc.gorillapool.io' \n : 'https://arc.gorillapool.io';\n const url = (config.arcadeUrl || defaultUrl).replace(/\\/$/, '');\n\n try {\n api.logger?.info?.(`[openclaw-arcade] Command received with args: ${JSON.stringify(ctx.args)} (type: ${typeof ctx.args})`);\n const args = Array.isArray(ctx.args) ? ctx.args : (typeof ctx.args === 'string' ? ctx.args.split(' ').filter(Boolean) : []);\n const action = args[0] || 'config';\n const params: any = { action };\n \n if (action === 'help') {\n return { text: `\uD83D\uDEE1\uFE0F **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` };\n }\n\n if (action === 'status' && args[1]) params.txid = args[1];\n if (action === 'broadcast' && args[1]) params.txhex = args[1];\n\n if (action === 'status' && params.txid) {\n const res = await fetch(`${url}/v1/tx/${params.txid}`);\n const data: any = await res.json();\n return { text: `\uD83D\uDEE1\uFE0F **Transaction Status**\\n**TXID**: ${params.txid}\\n**Status**: ${data.txStatus || 'Unknown'}` };\n }\n\n return { text: `Command '${action}' executed.` };\n } catch (error: any) {\n return { text: `\u274C Arcade Error: ${error.message}` };\n }\n }\n });\n\n // CLI\n api.registerCli(({ program }: any) => {\n const arc = program.command(\"arcade\").description(\"BSV transaction tracking commands\");\n arc.command(\"status <txid>\").description(\"Check broadcast status\").action(async (txid: string) => {\n const config = api.pluginConfig || {};\n const net = config.network || 'mainnet';\n const defaultUrl = net === 'testnet' \n ? 'https://testnet.arc.gorillapool.io' \n : 'https://arc.gorillapool.io';\n const url = (config.arcadeUrl || defaultUrl).replace(/\\/$/, '');\n const res = await fetch(`${url}/v1/tx/${txid}`);\n const data: any = await res.json();\n console.log(JSON.stringify(data, null, 2));\n });\n\n arc.command(\"broadcast <hex>\").description(\"Send raw transaction\").action(async (txhex: string) => {\n const config = api.pluginConfig || {};\n const net = config.network || 'mainnet';\n const defaultUrl = net === 'testnet' \n ? 'https://testnet.arc.gorillapool.io' \n : 'https://arc.gorillapool.io';\n const url = (config.arcadeUrl || defaultUrl).replace(/\\/$/, '');\n const res = await fetch(`${url}/v1/tx`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ rawTx: txhex })\n });\n const data: any = await res.json();\n console.log(JSON.stringify(data, null, 2));\n });\n\n arc.command(\"config\").description(\"Show current Arcade configuration\").action(() => {\n const config = api.pluginConfig || {};\n const net = config.network || 'mainnet';\n console.log(JSON.stringify({ arcadeUrl: config.arcadeUrl, network: net }, null, 2));\n });\n }, { commands: [\"arcade\"] });\n}\n\nexport const plugin = {\n id: \"openclaw-arcade-plugin\",\n name: \"BSV Arcade Broadcaster\",\n description: \"Submit and track BSV transactions with full lifecycle visibility\",\n activate: register,\n register: register\n};\n\nexport default register;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAIA,QAAI,IAAI;AACR,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AAgBZ,WAAO,UAAU,SAAU,KAAK,SAAS;AACvC,gBAAU,WAAW,CAAC;AACtB,UAAI,OAAO,OAAO;AAClB,UAAI,SAAS,YAAY,IAAI,SAAS,GAAG;AACvC,eAAO,MAAM,GAAG;AAAA,MAClB,WAAW,SAAS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M,OAAO,WAAW;AAC9B,cAAQ,IAAI,KAAK,UAAU,EAAE,WAAW,OAAO,WAAW,SAAS,IAAI,GAAG,MAAM,CAAC,CAAC;AAAA,IACpF,CAAC;AAAA,EACH,GAAG,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAC;AAC7B;AAEO,IAAM,SAAS;AAAA,EACpB,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,aAAa;AAAA,EACb,UAAU;AAAA,EACV;AACF;AAEA,IAAO,gBAAQ;",
|
|
6
6
|
"names": ["debug", "log", "useColors", "debug", "debug"]
|
|
7
7
|
}
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-arcade-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.26",
|
|
4
4
|
"description": "OpenClaw plugin for transaction broadcasting and lifecycle tracking via BSV Arcade",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"files": [
|
|
8
|
-
"index.ts",
|
|
9
|
-
"openclaw.plugin.json",
|
|
10
|
-
"src/",
|
|
11
8
|
"dist/",
|
|
9
|
+
"openclaw.plugin.json",
|
|
12
10
|
"SKILL.md",
|
|
13
11
|
"README.md"
|
|
14
12
|
],
|
|
@@ -17,6 +15,7 @@
|
|
|
17
15
|
"prepublishOnly": "npm run build && npm test",
|
|
18
16
|
"lint": "eslint src/**/*.ts",
|
|
19
17
|
"test": "npx tsx src/arcade.test.ts",
|
|
18
|
+
"sync": "node ../../sync.js arcade",
|
|
20
19
|
"postversion": "node ../../sync_versions.js",
|
|
21
20
|
"postinstall": "node -e \"try{require('sqlite3')}catch{console.log('Note: sqlite3 requires build tools if prebuilt binaries are unavailable.')}\""
|
|
22
21
|
},
|
package/index.ts
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import os from "node:os";
|
|
3
|
-
import debug from 'debug';
|
|
4
|
-
|
|
5
|
-
const log = debug('openclaw:plugin:arcade');
|
|
6
|
-
|
|
7
|
-
let isInitialized = false;
|
|
8
|
-
/**
|
|
9
|
-
* OpenClaw Arcade Plugin
|
|
10
|
-
* Transaction broadcasting and lifecycle tracking via BSV Arcade.
|
|
11
|
-
*/
|
|
12
|
-
export function register(api: any) {
|
|
13
|
-
const version = "0.2.22";
|
|
14
|
-
if (isInitialized) return;
|
|
15
|
-
isInitialized = true;
|
|
16
|
-
|
|
17
|
-
api.logger.info(`[arcade] Initializing Arcade Plugin v${version}`);
|
|
18
|
-
const entries = api.getConfig?.()?.plugins?.entries || {};
|
|
19
|
-
const entry = entries['sv_arcade']
|
|
20
|
-
|| entries['arcade']
|
|
21
|
-
|| entries['openclaw-arcade-plugin']
|
|
22
|
-
|| entries['openclaw-arcade']
|
|
23
|
-
|| entries['bsv-arcade']
|
|
24
|
-
|| {};
|
|
25
|
-
|
|
26
|
-
const pluginConfig = { ...entry, ...(entry.config || {}), ...(api.config || {}) };
|
|
27
|
-
const network = pluginConfig.network || 'mainnet';
|
|
28
|
-
const defaultArcadeUrl = network === 'testnet'
|
|
29
|
-
? 'https://testnet.arc.gorillapool.io'
|
|
30
|
-
: 'https://arc.gorillapool.io';
|
|
31
|
-
const arcadeUrl = (pluginConfig.arcadeUrl || defaultArcadeUrl).replace(/\/$/, '');
|
|
32
|
-
|
|
33
|
-
// 1. Tool
|
|
34
|
-
api.registerTool({
|
|
35
|
-
name: "arcade",
|
|
36
|
-
description: "Submit and track BSV transactions with full lifecycle visibility",
|
|
37
|
-
parameters: {
|
|
38
|
-
type: "object",
|
|
39
|
-
properties: {
|
|
40
|
-
action: {
|
|
41
|
-
type: "string",
|
|
42
|
-
enum: ["broadcast", "status", "proof", "config"],
|
|
43
|
-
description: "Action to perform"
|
|
44
|
-
},
|
|
45
|
-
txhex: {
|
|
46
|
-
type: "string",
|
|
47
|
-
description: "Hex-encoded raw transaction to broadcast"
|
|
48
|
-
},
|
|
49
|
-
txid: {
|
|
50
|
-
type: "string",
|
|
51
|
-
description: "Transaction ID to track or fetch proof for"
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
required: ["action"]
|
|
55
|
-
},
|
|
56
|
-
async execute(_id: string, params: any) {
|
|
57
|
-
log('Executing tool action: %s with params: %O', params.action, params);
|
|
58
|
-
try {
|
|
59
|
-
const { action, txhex, txid } = params;
|
|
60
|
-
|
|
61
|
-
switch (action) {
|
|
62
|
-
case "broadcast":
|
|
63
|
-
if (!txhex) throw new Error("txhex is required for broadcast");
|
|
64
|
-
log('Broadcasting transaction: %s...', txhex.slice(0, 64));
|
|
65
|
-
const bResp = await fetch(`${arcadeUrl}/v1/tx`, {
|
|
66
|
-
method: 'POST',
|
|
67
|
-
headers: { 'Content-Type': 'application/json' },
|
|
68
|
-
body: JSON.stringify({ rawTx: txhex })
|
|
69
|
-
});
|
|
70
|
-
const bData: any = await bResp.json();
|
|
71
|
-
if (!bResp.ok) {
|
|
72
|
-
log('Broadcast failed: %O', bData);
|
|
73
|
-
throw new Error(`Broadcast failed: ${JSON.stringify(bData)}`);
|
|
74
|
-
}
|
|
75
|
-
log('Broadcast successful, TXID: %s', bData.txid);
|
|
76
|
-
return { content: [{ type: "text", text: `Transaction broadcasted! TXID: ${bData.txid}\nStatus: ${bData.txStatus}` }] };
|
|
77
|
-
|
|
78
|
-
case "status":
|
|
79
|
-
if (!txid) throw new Error("txid is required for status check");
|
|
80
|
-
log('Checking status for TXID: %s', txid);
|
|
81
|
-
const sResp = await fetch(`${arcadeUrl}/v1/tx/${txid}`);
|
|
82
|
-
const sData: any = await sResp.json();
|
|
83
|
-
if (!sResp.ok) {
|
|
84
|
-
log('Status check failed: %O', sData);
|
|
85
|
-
throw new Error(`Status check failed: ${JSON.stringify(sData)}`);
|
|
86
|
-
}
|
|
87
|
-
log('Status: %s, Block: %s', sData.txStatus, sData.blockHeight);
|
|
88
|
-
return { content: [{ type: "text", text: `Transaction ${txid}:\nStatus: ${sData.txStatus}\nBlock: ${sData.blockHeight || 'Pending'}` }] };
|
|
89
|
-
|
|
90
|
-
case "proof":
|
|
91
|
-
if (!txid) throw new Error("txid is required for proof retrieval");
|
|
92
|
-
log('Fetching proof for TXID: %s', txid);
|
|
93
|
-
const pResp = await fetch(`${arcadeUrl}/v1/tx/${txid}/proof`);
|
|
94
|
-
if (!pResp.ok) {
|
|
95
|
-
log('Proof retrieval failed: %d', pResp.status);
|
|
96
|
-
throw new Error(`Proof retrieval failed: ${pResp.status}`);
|
|
97
|
-
}
|
|
98
|
-
const pData = await pResp.arrayBuffer();
|
|
99
|
-
const base64Proof = Buffer.from(pData).toString('base64');
|
|
100
|
-
log('Proof retrieved, length: %d bytes', pData.byteLength);
|
|
101
|
-
return { content: [{ type: "text", text: `Merkle Proof (Base64): ${base64Proof}` }] };
|
|
102
|
-
case "config":
|
|
103
|
-
return { content: [{ type: "text", text: `Arcade Configuration:\nURL: ${arcadeUrl}\nNetwork: ${network}` }] };
|
|
104
|
-
|
|
105
|
-
default:
|
|
106
|
-
throw new Error(`Unknown action: ${action}`);
|
|
107
|
-
}
|
|
108
|
-
} catch (error: any) {
|
|
109
|
-
return {
|
|
110
|
-
content: [{
|
|
111
|
-
type: "text",
|
|
112
|
-
text: `Error: ${error.message || String(error)}`
|
|
113
|
-
}]
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
// 2. Command
|
|
120
|
-
api.registerCommand({
|
|
121
|
-
name: "arcade",
|
|
122
|
-
description: "BSV transaction tracking commands",
|
|
123
|
-
acceptsArgs: true,
|
|
124
|
-
handler: async (ctx: any) => {
|
|
125
|
-
try {
|
|
126
|
-
api.logger?.info?.(`[openclaw-arcade] Command received with args: ${JSON.stringify(ctx.args)} (type: ${typeof ctx.args})`);
|
|
127
|
-
const args = Array.isArray(ctx.args) ? ctx.args : (typeof ctx.args === 'string' ? ctx.args.split(' ').filter(Boolean) : []);
|
|
128
|
-
const action = args[0] || 'config';
|
|
129
|
-
const params: any = { action };
|
|
130
|
-
|
|
131
|
-
if (action === 'help') {
|
|
132
|
-
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` };
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (action === 'status' && args[1]) params.txid = args[1];
|
|
136
|
-
if (action === 'broadcast' && args[1]) params.txhex = args[1];
|
|
137
|
-
|
|
138
|
-
// Custom logic for simplified chat output
|
|
139
|
-
if (action === 'status' && params.txid) {
|
|
140
|
-
const res = await fetch(`${arcadeUrl}/v1/tx/${params.txid}`);
|
|
141
|
-
const data: any = await res.json();
|
|
142
|
-
return { text: `🛡️ **Transaction Status**\n**TXID**: ${params.txid}\n**Status**: ${data.txStatus || 'Unknown'}` };
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return { text: `Command '${action}' executed.` };
|
|
146
|
-
} catch (error: any) {
|
|
147
|
-
return { text: `❌ Arcade Error: ${error.message}` };
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
// 3. CLI
|
|
153
|
-
api.registerCli(({ program }: any) => {
|
|
154
|
-
const arc = program.command("arcade").description("BSV transaction tracking commands");
|
|
155
|
-
arc.command("status <txid>").description("Check broadcast status").action(async (txid: string) => {
|
|
156
|
-
const res = await fetch(`${arcadeUrl}/v1/tx/${txid}`);
|
|
157
|
-
const data: any = await res.json();
|
|
158
|
-
console.log(JSON.stringify(data, null, 2));
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
arc.command("broadcast <hex>").description("Send raw transaction").action(async (txhex: string) => {
|
|
162
|
-
const res = await fetch(`${arcadeUrl}/v1/tx`, {
|
|
163
|
-
method: 'POST',
|
|
164
|
-
headers: { 'Content-Type': 'application/json' },
|
|
165
|
-
body: JSON.stringify({ rawTx: txhex })
|
|
166
|
-
});
|
|
167
|
-
const data: any = await res.json();
|
|
168
|
-
console.log(JSON.stringify(data, null, 2));
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
arc.command("config").description("Show current Arcade configuration").action(() => {
|
|
172
|
-
console.log(JSON.stringify({ arcadeUrl, network }, null, 2));
|
|
173
|
-
});
|
|
174
|
-
}, { commands: ["arcade"] });
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export const plugin = {
|
|
178
|
-
id: "openclaw-arcade-plugin",
|
|
179
|
-
name: "BSV Arcade Broadcaster",
|
|
180
|
-
description: "Submit and track BSV transactions with full lifecycle visibility",
|
|
181
|
-
activate: register,
|
|
182
|
-
register: register
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
export default register;
|
package/src/ambient.d.ts
DELETED
package/src/arcade.test.ts
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Arcade Plugin tests
|
|
3
|
-
*
|
|
4
|
-
* Verifies that the arcade tool is registered correctly and handles
|
|
5
|
-
* actions as expected.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { plugin } from '../index.js';
|
|
9
|
-
|
|
10
|
-
// Simple test runner
|
|
11
|
-
let passed = 0;
|
|
12
|
-
let failed = 0;
|
|
13
|
-
|
|
14
|
-
async function test(name: string, fn: () => void | Promise<void>) {
|
|
15
|
-
try {
|
|
16
|
-
await fn();
|
|
17
|
-
console.log(` ✓ ${name}`);
|
|
18
|
-
passed++;
|
|
19
|
-
} catch (err: unknown) {
|
|
20
|
-
console.log(` ✗ ${name}`);
|
|
21
|
-
console.log(err);
|
|
22
|
-
failed++;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function assert(condition: boolean, message: string) {
|
|
27
|
-
if (!condition) throw new Error(`Assertion failed: ${message}`);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async function run() {
|
|
31
|
-
console.log('Arcade Plugin tests\n');
|
|
32
|
-
|
|
33
|
-
let registeredTool: any = null;
|
|
34
|
-
|
|
35
|
-
const mockApi = {
|
|
36
|
-
logger: {
|
|
37
|
-
info: () => {},
|
|
38
|
-
error: () => {},
|
|
39
|
-
warn: () => {}
|
|
40
|
-
},
|
|
41
|
-
registerTool: (tool: any) => {
|
|
42
|
-
registeredTool = tool;
|
|
43
|
-
},
|
|
44
|
-
registerCommand: () => {},
|
|
45
|
-
registerCli: () => {},
|
|
46
|
-
getConfig: () => ({
|
|
47
|
-
plugins: {
|
|
48
|
-
entries: {
|
|
49
|
-
'openclaw-arcade-plugin': {
|
|
50
|
-
config: {
|
|
51
|
-
arcadeUrl: 'https://arc.gorillapool.io',
|
|
52
|
-
network: 'mainnet'
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
await test('Plugin registers arcade tool', async () => {
|
|
61
|
-
plugin.register(mockApi);
|
|
62
|
-
assert(registeredTool !== null, 'tool should be registered');
|
|
63
|
-
assert(registeredTool.name === 'arcade', 'tool name should be arcade');
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
await test('Arcade tool config action returns mock config', async () => {
|
|
67
|
-
const result = await registeredTool.execute('1', { action: 'config' });
|
|
68
|
-
assert(result.content[0].text.includes('https://arc.gorillapool.io'), 'output should include mock URL');
|
|
69
|
-
assert(result.content[0].text.includes('mainnet'), 'output should include mock network');
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
await test('Arcade tool broadcast action fails without txhex', async () => {
|
|
73
|
-
const result = await registeredTool.execute('1', { action: 'broadcast' });
|
|
74
|
-
assert(result.content[0].text.includes('Error: txhex is required'), 'should return error message');
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
await test('Arcade tool status action fails without txid', async () => {
|
|
78
|
-
const result = await registeredTool.execute('1', { action: 'status' });
|
|
79
|
-
assert(result.content[0].text.includes('Error: txid is required'), 'should return error message');
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
await test('Arcade tool proof action fails without txid', async () => {
|
|
83
|
-
const result = await registeredTool.execute('1', { action: 'proof' });
|
|
84
|
-
assert(result.content[0].text.includes('Error: txid is required'), 'should return error message');
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
console.log(`\n${passed} passed, ${failed} failed`);
|
|
88
|
-
if (failed > 0) process.exit(1);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
run().catch(err => {
|
|
92
|
-
console.error(err);
|
|
93
|
-
process.exit(1);
|
|
94
|
-
});
|