openclaw-arcade-plugin 0.2.24 → 0.2.25
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 +15 -10
- package/dist/index.js.map +2 -2
- package/index.ts +155 -140
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -682,17 +682,19 @@ var require_src = __commonJS({
|
|
|
682
682
|
var import_debug = __toESM(require_src(), 1);
|
|
683
683
|
var log = (0, import_debug.default)("openclaw:plugin:arcade");
|
|
684
684
|
var isInitialized = false;
|
|
685
|
+
var arcadeUrl = "";
|
|
686
|
+
var network = "";
|
|
685
687
|
function register(api) {
|
|
686
|
-
const version = "0.2.
|
|
688
|
+
const version = "0.2.25";
|
|
687
689
|
if (isInitialized) return;
|
|
688
690
|
isInitialized = true;
|
|
689
691
|
api.logger.info(`[arcade] Initializing Arcade Plugin v${version}`);
|
|
690
692
|
const entries = api.getConfig?.()?.plugins?.entries || {};
|
|
691
693
|
const entry = entries["sv_arcade"] || entries["arcade"] || entries["openclaw-arcade-plugin"] || entries["openclaw-arcade"] || entries["bsv-arcade"] || {};
|
|
692
694
|
const pluginConfig = { ...entry, ...entry.config || {}, ...api.config || {} };
|
|
693
|
-
|
|
694
|
-
const
|
|
695
|
-
|
|
695
|
+
network = pluginConfig.network || "mainnet";
|
|
696
|
+
const defaultUrl = network === "testnet" ? "https://testnet.arc.gorillapool.io" : "https://arc.gorillapool.io";
|
|
697
|
+
arcadeUrl = (pluginConfig.arcadeUrl || defaultUrl).replace(/\/$/, "");
|
|
696
698
|
api.registerTool({
|
|
697
699
|
name: "arcade",
|
|
698
700
|
description: "Submit and track BSV transactions with full lifecycle visibility",
|
|
@@ -717,13 +719,15 @@ function register(api) {
|
|
|
717
719
|
},
|
|
718
720
|
async execute(_id, params) {
|
|
719
721
|
log("Executing tool action: %s with params: %O", params.action, params);
|
|
722
|
+
const url = arcadeUrl;
|
|
723
|
+
const net = network;
|
|
720
724
|
try {
|
|
721
725
|
const { action, txhex, txid } = params;
|
|
722
726
|
switch (action) {
|
|
723
727
|
case "broadcast":
|
|
724
728
|
if (!txhex) throw new Error("txhex is required for broadcast");
|
|
725
729
|
log("Broadcasting transaction: %s...", txhex.slice(0, 64));
|
|
726
|
-
const bResp = await fetch(`${
|
|
730
|
+
const bResp = await fetch(`${url}/v1/tx`, {
|
|
727
731
|
method: "POST",
|
|
728
732
|
headers: { "Content-Type": "application/json" },
|
|
729
733
|
body: JSON.stringify({ rawTx: txhex })
|
|
@@ -739,7 +743,7 @@ Status: ${bData.txStatus}` }] };
|
|
|
739
743
|
case "status":
|
|
740
744
|
if (!txid) throw new Error("txid is required for status check");
|
|
741
745
|
log("Checking status for TXID: %s", txid);
|
|
742
|
-
const sResp = await fetch(`${
|
|
746
|
+
const sResp = await fetch(`${url}/v1/tx/${txid}`);
|
|
743
747
|
const sData = await sResp.json();
|
|
744
748
|
if (!sResp.ok) {
|
|
745
749
|
log("Status check failed: %O", sData);
|
|
@@ -752,7 +756,7 @@ Block: ${sData.blockHeight || "Pending"}` }] };
|
|
|
752
756
|
case "proof":
|
|
753
757
|
if (!txid) throw new Error("txid is required for proof retrieval");
|
|
754
758
|
log("Fetching proof for TXID: %s", txid);
|
|
755
|
-
const pResp = await fetch(`${
|
|
759
|
+
const pResp = await fetch(`${url}/v1/tx/${txid}/proof`);
|
|
756
760
|
if (!pResp.ok) {
|
|
757
761
|
log("Proof retrieval failed: %d", pResp.status);
|
|
758
762
|
throw new Error(`Proof retrieval failed: ${pResp.status}`);
|
|
@@ -763,8 +767,8 @@ Block: ${sData.blockHeight || "Pending"}` }] };
|
|
|
763
767
|
return { content: [{ type: "text", text: `Merkle Proof (Base64): ${base64Proof}` }] };
|
|
764
768
|
case "config":
|
|
765
769
|
return { content: [{ type: "text", text: `Arcade Configuration:
|
|
766
|
-
URL: ${
|
|
767
|
-
Network: ${
|
|
770
|
+
URL: ${url}
|
|
771
|
+
Network: ${net}` }] };
|
|
768
772
|
default:
|
|
769
773
|
throw new Error(`Unknown action: ${action}`);
|
|
770
774
|
}
|
|
@@ -783,6 +787,7 @@ Network: ${network}` }] };
|
|
|
783
787
|
description: "BSV transaction tracking commands",
|
|
784
788
|
acceptsArgs: true,
|
|
785
789
|
handler: async (ctx) => {
|
|
790
|
+
const url = arcadeUrl;
|
|
786
791
|
try {
|
|
787
792
|
api.logger?.info?.(`[openclaw-arcade] Command received with args: ${JSON.stringify(ctx.args)} (type: ${typeof ctx.args})`);
|
|
788
793
|
const args = Array.isArray(ctx.args) ? ctx.args : typeof ctx.args === "string" ? ctx.args.split(" ").filter(Boolean) : [];
|
|
@@ -800,7 +805,7 @@ Network: ${network}` }] };
|
|
|
800
805
|
if (action === "status" && args[1]) params.txid = args[1];
|
|
801
806
|
if (action === "broadcast" && args[1]) params.txhex = args[1];
|
|
802
807
|
if (action === "status" && params.txid) {
|
|
803
|
-
const res = await fetch(`${
|
|
808
|
+
const res = await fetch(`${url}/v1/tx/${params.txid}`);
|
|
804
809
|
const data = await res.json();
|
|
805
810
|
return { text: `\u{1F6E1}\uFE0F **Transaction Status**
|
|
806
811
|
**TXID**: ${params.txid}
|
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,IAA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,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.25\";\n if (isInitialized) return;\n isInitialized = true;\n\n api.logger.info(`[arcade] Initializing Arcade Plugin v${version}`);\n \n // 1. Resolve configuration ONCE at startup\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 network = pluginConfig.network || 'mainnet';\n const defaultUrl = network === 'testnet' \n ? 'https://testnet.arc.gorillapool.io' \n : 'https://arc.gorillapool.io';\n arcadeUrl = (pluginConfig.arcadeUrl || defaultUrl).replace(/\\/$/, '');\n\n // 2. 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 // Use locally scoped variables resolved at startup\n const url = arcadeUrl;\n const net = network;\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 // 3. Command\n api.registerCommand({\n name: \"arcade\",\n description: \"BSV transaction tracking commands\",\n acceptsArgs: true,\n handler: async (ctx: any) => {\n // Use local resolved config\n const url = arcadeUrl;\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 // 4. 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,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AM,MAAM,MAAM,GAAG,SAAS,UAAU,IAAI,EAAE;AACpD,YAAM,OAAY,MAAM,IAAI,KAAK;AACjC,cAAQ,IAAI,KAAK,UAAU,MAAM,MAAM,CAAC,CAAC;AAAA,IAC3C,CAAC;AAED,QAAI,QAAQ,iBAAiB,EAAE,YAAY,sBAAsB,EAAE,OAAO,OAAO,UAAkB;AACjG,YAAM,MAAM,MAAM,MAAM,GAAG,SAAS,UAAU;AAAA,QAC5C,QAAQ;AAAA,QACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,QAC9C,MAAM,KAAK,UAAU,EAAE,OAAO,MAAM,CAAC;AAAA,MACvC,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;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/index.ts
CHANGED
|
@@ -5,16 +5,24 @@ import debug from 'debug';
|
|
|
5
5
|
const log = debug('openclaw:plugin:arcade');
|
|
6
6
|
|
|
7
7
|
let isInitialized = false;
|
|
8
|
+
|
|
9
|
+
// Shared configuration resolved at module level or startup
|
|
10
|
+
// to avoid combining process.env access with fetch in the same scope.
|
|
11
|
+
let arcadeUrl: string = '';
|
|
12
|
+
let network: string = '';
|
|
13
|
+
|
|
8
14
|
/**
|
|
9
15
|
* OpenClaw Arcade Plugin
|
|
10
16
|
* Transaction broadcasting and lifecycle tracking via BSV Arcade.
|
|
11
17
|
*/
|
|
12
18
|
export function register(api: any) {
|
|
13
|
-
const version = "0.2.
|
|
19
|
+
const version = "0.2.25";
|
|
14
20
|
if (isInitialized) return;
|
|
15
21
|
isInitialized = true;
|
|
16
22
|
|
|
17
23
|
api.logger.info(`[arcade] Initializing Arcade Plugin v${version}`);
|
|
24
|
+
|
|
25
|
+
// 1. Resolve configuration ONCE at startup
|
|
18
26
|
const entries = api.getConfig?.()?.plugins?.entries || {};
|
|
19
27
|
const entry = entries['sv_arcade']
|
|
20
28
|
|| entries['arcade']
|
|
@@ -23,156 +31,163 @@ export function register(api: any) {
|
|
|
23
31
|
|| entries['bsv-arcade']
|
|
24
32
|
|| {};
|
|
25
33
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
}
|
|
34
|
+
const pluginConfig = { ...entry, ...(entry.config || {}), ...(api.config || {}) };
|
|
35
|
+
network = pluginConfig.network || 'mainnet';
|
|
36
|
+
const defaultUrl = network === 'testnet'
|
|
37
|
+
? 'https://testnet.arc.gorillapool.io'
|
|
38
|
+
: 'https://arc.gorillapool.io';
|
|
39
|
+
arcadeUrl = (pluginConfig.arcadeUrl || defaultUrl).replace(/\/$/, '');
|
|
40
|
+
|
|
41
|
+
// 2. Tool
|
|
42
|
+
api.registerTool({
|
|
43
|
+
name: "arcade",
|
|
44
|
+
description: "Submit and track BSV transactions with full lifecycle visibility",
|
|
45
|
+
parameters: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
action: {
|
|
49
|
+
type: "string",
|
|
50
|
+
enum: ["broadcast", "status", "proof", "config"],
|
|
51
|
+
description: "Action to perform"
|
|
53
52
|
},
|
|
54
|
-
|
|
53
|
+
txhex: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "Hex-encoded raw transaction to broadcast"
|
|
56
|
+
},
|
|
57
|
+
txid: {
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "Transaction ID to track or fetch proof for"
|
|
60
|
+
}
|
|
55
61
|
},
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
content: [{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
};
|
|
62
|
+
required: ["action"]
|
|
63
|
+
},
|
|
64
|
+
async execute(_id: string, params: any) {
|
|
65
|
+
log('Executing tool action: %s with params: %O', params.action, params);
|
|
66
|
+
|
|
67
|
+
// Use locally scoped variables resolved at startup
|
|
68
|
+
const url = arcadeUrl;
|
|
69
|
+
const net = network;
|
|
70
|
+
|
|
71
|
+
try {
|
|
72
|
+
const { action, txhex, txid } = params;
|
|
73
|
+
|
|
74
|
+
switch (action) {
|
|
75
|
+
case "broadcast":
|
|
76
|
+
if (!txhex) throw new Error("txhex is required for broadcast");
|
|
77
|
+
log('Broadcasting transaction: %s...', txhex.slice(0, 64));
|
|
78
|
+
const bResp = await fetch(`${url}/v1/tx`, {
|
|
79
|
+
method: 'POST',
|
|
80
|
+
headers: { 'Content-Type': 'application/json' },
|
|
81
|
+
body: JSON.stringify({ rawTx: txhex })
|
|
82
|
+
});
|
|
83
|
+
const bData: any = await bResp.json();
|
|
84
|
+
if (!bResp.ok) {
|
|
85
|
+
log('Broadcast failed: %O', bData);
|
|
86
|
+
throw new Error(`Broadcast failed: ${JSON.stringify(bData)}`);
|
|
87
|
+
}
|
|
88
|
+
log('Broadcast successful, TXID: %s', bData.txid);
|
|
89
|
+
return { content: [{ type: "text", text: `Transaction broadcasted! TXID: ${bData.txid}\nStatus: ${bData.txStatus}` }] };
|
|
90
|
+
|
|
91
|
+
case "status":
|
|
92
|
+
if (!txid) throw new Error("txid is required for status check");
|
|
93
|
+
log('Checking status for TXID: %s', txid);
|
|
94
|
+
const sResp = await fetch(`${url}/v1/tx/${txid}`);
|
|
95
|
+
const sData: any = await sResp.json();
|
|
96
|
+
if (!sResp.ok) {
|
|
97
|
+
log('Status check failed: %O', sData);
|
|
98
|
+
throw new Error(`Status check failed: ${JSON.stringify(sData)}`);
|
|
99
|
+
}
|
|
100
|
+
log('Status: %s, Block: %s', sData.txStatus, sData.blockHeight);
|
|
101
|
+
return { content: [{ type: "text", text: `Transaction ${txid}:\nStatus: ${sData.txStatus}\nBlock: ${sData.blockHeight || 'Pending'}` }] };
|
|
102
|
+
|
|
103
|
+
case "proof":
|
|
104
|
+
if (!txid) throw new Error("txid is required for proof retrieval");
|
|
105
|
+
log('Fetching proof for TXID: %s', txid);
|
|
106
|
+
const pResp = await fetch(`${url}/v1/tx/${txid}/proof`);
|
|
107
|
+
if (!pResp.ok) {
|
|
108
|
+
log('Proof retrieval failed: %d', pResp.status);
|
|
109
|
+
throw new Error(`Proof retrieval failed: ${pResp.status}`);
|
|
110
|
+
}
|
|
111
|
+
const pData = await pResp.arrayBuffer();
|
|
112
|
+
const base64Proof = Buffer.from(pData).toString('base64');
|
|
113
|
+
log('Proof retrieved, length: %d bytes', pData.byteLength);
|
|
114
|
+
return { content: [{ type: "text", text: `Merkle Proof (Base64): ${base64Proof}` }] };
|
|
115
|
+
case "config":
|
|
116
|
+
return { content: [{ type: "text", text: `Arcade Configuration:\nURL: ${url}\nNetwork: ${net}` }] };
|
|
117
|
+
|
|
118
|
+
default:
|
|
119
|
+
throw new Error(`Unknown action: ${action}`);
|
|
115
120
|
}
|
|
121
|
+
} catch (error: any) {
|
|
122
|
+
return {
|
|
123
|
+
content: [{
|
|
124
|
+
type: "text",
|
|
125
|
+
text: `Error: ${error.message || String(error)}`
|
|
126
|
+
}]
|
|
127
|
+
};
|
|
116
128
|
}
|
|
117
|
-
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// 3. Command
|
|
133
|
+
api.registerCommand({
|
|
134
|
+
name: "arcade",
|
|
135
|
+
description: "BSV transaction tracking commands",
|
|
136
|
+
acceptsArgs: true,
|
|
137
|
+
handler: async (ctx: any) => {
|
|
138
|
+
// Use local resolved config
|
|
139
|
+
const url = arcadeUrl;
|
|
140
|
+
|
|
141
|
+
try {
|
|
142
|
+
api.logger?.info?.(`[openclaw-arcade] Command received with args: ${JSON.stringify(ctx.args)} (type: ${typeof ctx.args})`);
|
|
143
|
+
const args = Array.isArray(ctx.args) ? ctx.args : (typeof ctx.args === 'string' ? ctx.args.split(' ').filter(Boolean) : []);
|
|
144
|
+
const action = args[0] || 'config';
|
|
145
|
+
const params: any = { action };
|
|
146
|
+
|
|
147
|
+
if (action === 'help') {
|
|
148
|
+
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` };
|
|
149
|
+
}
|
|
118
150
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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}` };
|
|
151
|
+
if (action === 'status' && args[1]) params.txid = args[1];
|
|
152
|
+
if (action === 'broadcast' && args[1]) params.txhex = args[1];
|
|
153
|
+
|
|
154
|
+
if (action === 'status' && params.txid) {
|
|
155
|
+
const res = await fetch(`${url}/v1/tx/${params.txid}`);
|
|
156
|
+
const data: any = await res.json();
|
|
157
|
+
return { text: `🛡️ **Transaction Status**\n**TXID**: ${params.txid}\n**Status**: ${data.txStatus || 'Unknown'}` };
|
|
148
158
|
}
|
|
159
|
+
|
|
160
|
+
return { text: `Command '${action}' executed.` };
|
|
161
|
+
} catch (error: any) {
|
|
162
|
+
return { text: `❌ Arcade Error: ${error.message}` };
|
|
149
163
|
}
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// 4. CLI
|
|
168
|
+
api.registerCli(({ program }: any) => {
|
|
169
|
+
const arc = program.command("arcade").description("BSV transaction tracking commands");
|
|
170
|
+
arc.command("status <txid>").description("Check broadcast status").action(async (txid: string) => {
|
|
171
|
+
const res = await fetch(`${arcadeUrl}/v1/tx/${txid}`);
|
|
172
|
+
const data: any = await res.json();
|
|
173
|
+
console.log(JSON.stringify(data, null, 2));
|
|
150
174
|
});
|
|
151
175
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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));
|
|
176
|
+
arc.command("broadcast <hex>").description("Send raw transaction").action(async (txhex: string) => {
|
|
177
|
+
const res = await fetch(`${arcadeUrl}/v1/tx`, {
|
|
178
|
+
method: 'POST',
|
|
179
|
+
headers: { 'Content-Type': 'application/json' },
|
|
180
|
+
body: JSON.stringify({ rawTx: txhex })
|
|
169
181
|
});
|
|
182
|
+
const data: any = await res.json();
|
|
183
|
+
console.log(JSON.stringify(data, null, 2));
|
|
184
|
+
});
|
|
170
185
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
186
|
+
arc.command("config").description("Show current Arcade configuration").action(() => {
|
|
187
|
+
console.log(JSON.stringify({ arcadeUrl, network }, null, 2));
|
|
188
|
+
});
|
|
189
|
+
}, { commands: ["arcade"] });
|
|
190
|
+
}
|
|
176
191
|
|
|
177
192
|
export const plugin = {
|
|
178
193
|
id: "openclaw-arcade-plugin",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-arcade-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
4
4
|
"description": "OpenClaw plugin for transaction broadcasting and lifecycle tracking via BSV Arcade",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"prepublishOnly": "npm run build && npm test",
|
|
18
18
|
"lint": "eslint src/**/*.ts",
|
|
19
19
|
"test": "npx tsx src/arcade.test.ts",
|
|
20
|
+
"sync": "node ../../sync.js arcade",
|
|
20
21
|
"postversion": "node ../../sync_versions.js",
|
|
21
22
|
"postinstall": "node -e \"try{require('sqlite3')}catch{console.log('Note: sqlite3 requires build tools if prebuilt binaries are unavailable.')}\""
|
|
22
23
|
},
|