openclaw-overlay-plugin 0.8.2 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +137 -315
- package/dist/src/cli.js +1 -1
- package/dist/src/scripts/baemail/commands.d.ts +6 -6
- package/dist/src/scripts/messaging/inbox.d.ts +2 -2
- package/dist/src/scripts/messaging/poll.d.ts +1 -1
- package/dist/src/scripts/messaging/send.d.ts +1 -1
- package/dist/src/scripts/output.d.ts +5 -4
- package/dist/src/scripts/output.js +11 -2
- package/dist/src/scripts/overlay/advertisement.d.ts +2 -2
- package/dist/src/scripts/overlay/discover.d.ts +1 -1
- package/dist/src/scripts/overlay/registration.d.ts +2 -2
- package/dist/src/scripts/overlay/services.d.ts +4 -4
- package/dist/src/scripts/payment/commands.d.ts +3 -3
- package/dist/src/scripts/services/queue.d.ts +2 -2
- package/dist/src/scripts/services/request.d.ts +1 -1
- package/dist/src/scripts/services/respond.d.ts +2 -2
- package/dist/src/scripts/wallet/balance.d.ts +2 -2
- package/dist/src/scripts/wallet/setup.d.ts +4 -4
- package/dist/src/scripts/x-verification/commands.d.ts +6 -6
- package/index.ts +178 -383
- package/openclaw.plugin.json +4 -4
- package/package.json +1 -1
- package/src/cli.ts +1 -1
- package/src/scripts/baemail/commands.ts +6 -6
- package/src/scripts/messaging/inbox.ts +2 -2
- package/src/scripts/messaging/poll.ts +1 -1
- package/src/scripts/messaging/send.ts +1 -1
- package/src/scripts/output.ts +13 -4
- package/src/scripts/overlay/advertisement.ts +2 -2
- package/src/scripts/overlay/discover.ts +1 -1
- package/src/scripts/overlay/registration.ts +2 -2
- package/src/scripts/overlay/services.ts +4 -4
- package/src/scripts/payment/commands.ts +3 -3
- package/src/scripts/services/queue.ts +2 -2
- package/src/scripts/services/request.ts +1 -1
- package/src/scripts/services/respond.ts +2 -2
- package/src/scripts/wallet/balance.ts +2 -2
- package/src/scripts/wallet/setup.ts +4 -4
- package/src/scripts/x-verification/commands.ts +6 -6
package/openclaw.plugin.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
2
|
+
"id": "openclaw-overlay-plugin",
|
|
3
3
|
"name": "BSV Overlay Network",
|
|
4
4
|
"description": "OpenClaw Overlay — decentralized agent marketplace with BSV micropayments",
|
|
5
|
-
"version": "0.8.
|
|
5
|
+
"version": "0.8.6",
|
|
6
6
|
"skills": [
|
|
7
7
|
"./SKILL.md"
|
|
8
8
|
],
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"commands": [
|
|
22
22
|
{
|
|
23
|
-
"name": "
|
|
23
|
+
"name": "overlay",
|
|
24
24
|
"description": "BSV Overlay Network management",
|
|
25
25
|
"isAutoreply": true
|
|
26
26
|
}
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"configSchema": {
|
|
37
37
|
"type": "object",
|
|
38
|
-
"additionalProperties":
|
|
38
|
+
"additionalProperties": true,
|
|
39
39
|
"properties": {
|
|
40
40
|
"overlayUrl": {
|
|
41
41
|
"type": "string",
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
(process as any)['en' + 'v'].DOTENV_CONFIG_QUIET = 'true';
|
|
11
11
|
|
|
12
12
|
// Dynamic import to ensure env var is set first
|
|
13
|
-
import('./cli-main.js');
|
|
13
|
+
await import('./cli-main.js');
|
|
14
14
|
|
|
15
15
|
// Before importing the library
|
|
16
16
|
(globalThis as any).window = { fetch: globalThis.fetch };
|
|
@@ -95,7 +95,7 @@ async function fetchWithTimeout(url: string, options: any = {}) {
|
|
|
95
95
|
/**
|
|
96
96
|
* List recent baemail deliveries.
|
|
97
97
|
*/
|
|
98
|
-
export async function cmdBaemailLog(limitStr?: string): Promise<
|
|
98
|
+
export async function cmdBaemailLog(limitStr?: string): Promise<any> {
|
|
99
99
|
const limit = parseInt(limitStr || '20', 10) || 20;
|
|
100
100
|
|
|
101
101
|
if (!fs.existsSync(PATHS.baemailLog)) {
|
|
@@ -111,7 +111,7 @@ export async function cmdBaemailLog(limitStr?: string): Promise<never> {
|
|
|
111
111
|
return ok({ log: recent, count: entries.length, showing: recent.length });
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
export async function cmdBaemailSetup(priceSatsStr: string, prioritySats?: string, urgentSats?: string, channel?: string): Promise<
|
|
114
|
+
export async function cmdBaemailSetup(priceSatsStr: string, prioritySats?: string, urgentSats?: string, channel?: string): Promise<any> {
|
|
115
115
|
const standard = parseInt(priceSatsStr, 10) || 100;
|
|
116
116
|
const priority = parseInt(prioritySats || '', 10) || (standard * 5);
|
|
117
117
|
const urgent = parseInt(urgentSats || '', 10) || (standard * 10);
|
|
@@ -130,12 +130,12 @@ export async function cmdBaemailSetup(priceSatsStr: string, prioritySats?: strin
|
|
|
130
130
|
return ok({ message: `Baemail setup complete.`, config });
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
export async function cmdBaemailConfig(): Promise<
|
|
133
|
+
export async function cmdBaemailConfig(): Promise<any> {
|
|
134
134
|
const config = await loadBaemailConfig();
|
|
135
135
|
return ok(config);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
export async function cmdBaemailBlock(pubkey: string): Promise<
|
|
138
|
+
export async function cmdBaemailBlock(pubkey: string): Promise<any> {
|
|
139
139
|
if (!pubkey) return fail('Usage: baemail-block <pubkey>');
|
|
140
140
|
let blocklist: string[] = [];
|
|
141
141
|
if (fs.existsSync(PATHS.baemailBlocklist)) {
|
|
@@ -146,7 +146,7 @@ export async function cmdBaemailBlock(pubkey: string): Promise<never> {
|
|
|
146
146
|
return ok({ blocked: true, pubkey, count: blocklist.length });
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
export async function cmdBaemailUnblock(pubkey: string): Promise<
|
|
149
|
+
export async function cmdBaemailUnblock(pubkey: string): Promise<any> {
|
|
150
150
|
if (!pubkey) return fail('Usage: baemail-unblock <pubkey>');
|
|
151
151
|
let blocklist: string[] = [];
|
|
152
152
|
if (fs.existsSync(PATHS.baemailBlocklist)) {
|
|
@@ -160,7 +160,7 @@ export async function cmdBaemailUnblock(pubkey: string): Promise<never> {
|
|
|
160
160
|
/**
|
|
161
161
|
* Refund a failed baemail delivery.
|
|
162
162
|
*/
|
|
163
|
-
export async function cmdBaemailRefund(requestId: string | undefined): Promise<
|
|
163
|
+
export async function cmdBaemailRefund(requestId: string | undefined): Promise<any> {
|
|
164
164
|
if (!requestId) return fail('Usage: baemail-refund <requestId>');
|
|
165
165
|
|
|
166
166
|
if (!fs.existsSync(PATHS.baemailLog)) {
|
|
@@ -9,7 +9,7 @@ import { loadIdentity, verifyRelaySignature } from '../wallet/identity.js';
|
|
|
9
9
|
/**
|
|
10
10
|
* Inbox command: fetch pending messages.
|
|
11
11
|
*/
|
|
12
|
-
export async function cmdInbox(args: string[]): Promise<
|
|
12
|
+
export async function cmdInbox(args: string[]): Promise<any> {
|
|
13
13
|
const { identityKey } = await loadIdentity();
|
|
14
14
|
|
|
15
15
|
let since = '';
|
|
@@ -41,7 +41,7 @@ export async function cmdInbox(args: string[]): Promise<never> {
|
|
|
41
41
|
/**
|
|
42
42
|
* Ack command: acknowledge processed messages.
|
|
43
43
|
*/
|
|
44
|
-
export async function cmdAck(messageIds: string[]): Promise<
|
|
44
|
+
export async function cmdAck(messageIds: string[]): Promise<any> {
|
|
45
45
|
if (!messageIds || messageIds.length === 0) {
|
|
46
46
|
return fail('Usage: ack <messageId> [messageId2 ...]');
|
|
47
47
|
}
|
|
@@ -10,7 +10,7 @@ import { processMessage } from './handlers.js';
|
|
|
10
10
|
/**
|
|
11
11
|
* Poll command: fetch all pending messages and process them.
|
|
12
12
|
*/
|
|
13
|
-
export async function cmdPoll(): Promise<
|
|
13
|
+
export async function cmdPoll(): Promise<any> {
|
|
14
14
|
const { identityKey, privKey } = await loadIdentity();
|
|
15
15
|
|
|
16
16
|
// Fetch inbox
|
|
@@ -13,7 +13,7 @@ export async function cmdSend(
|
|
|
13
13
|
targetKey: string | undefined,
|
|
14
14
|
type: string | undefined,
|
|
15
15
|
payloadStr: string | undefined
|
|
16
|
-
): Promise<
|
|
16
|
+
): Promise<any> {
|
|
17
17
|
if (!targetKey || !type || !payloadStr) {
|
|
18
18
|
return fail('Usage: send <identityKey> <type> <json_payload>');
|
|
19
19
|
}
|
package/src/scripts/output.ts
CHANGED
|
@@ -3,19 +3,28 @@
|
|
|
3
3
|
* All CLI output follows the { success, data/error } wrapper format.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
// Global flag to prevent exit when used as a library
|
|
7
|
+
let noExitFlag = false;
|
|
8
|
+
|
|
9
|
+
export function setNoExit(value: boolean) {
|
|
10
|
+
noExitFlag = value;
|
|
11
|
+
}
|
|
12
|
+
|
|
6
13
|
/**
|
|
7
|
-
* Output a successful result and exit.
|
|
14
|
+
* Output a successful result and exit (unless noExit is set).
|
|
8
15
|
*/
|
|
9
|
-
export function ok<T>(data: T):
|
|
16
|
+
export function ok<T>(data: T): any {
|
|
17
|
+
if (noExitFlag) return { success: true, data };
|
|
10
18
|
console.log(JSON.stringify({ success: true, data }));
|
|
11
19
|
process.exit(0);
|
|
12
20
|
}
|
|
13
21
|
|
|
14
22
|
/**
|
|
15
|
-
* Output an error and exit.
|
|
23
|
+
* Output an error and exit (unless noExit is set).
|
|
16
24
|
*/
|
|
17
|
-
export function fail(error: string | Error):
|
|
25
|
+
export function fail(error: string | Error): any {
|
|
18
26
|
const message = error instanceof Error ? error.message : String(error);
|
|
27
|
+
if (noExitFlag) return { success: false, error: message };
|
|
19
28
|
console.log(JSON.stringify({ success: false, error: message }));
|
|
20
29
|
process.exit(1);
|
|
21
30
|
}
|
|
@@ -14,7 +14,7 @@ import { ok, fail } from '../output.js';
|
|
|
14
14
|
* Advertise a SHIP record.
|
|
15
15
|
* Announce that you host a specific Topic Manager (tm_).
|
|
16
16
|
*/
|
|
17
|
-
export async function cmdAdvertiseSHIP(domain?: string, topic?: string): Promise<
|
|
17
|
+
export async function cmdAdvertiseSHIP(domain?: string, topic?: string): Promise<any> {
|
|
18
18
|
if (!domain || !topic) {
|
|
19
19
|
return fail('Usage: advertise-ship <domain> <topic>');
|
|
20
20
|
}
|
|
@@ -65,7 +65,7 @@ export async function cmdAdvertiseSHIP(domain?: string, topic?: string): Promise
|
|
|
65
65
|
* Advertise a SLAP record.
|
|
66
66
|
* Announce that you host a specific Lookup Service (ls_).
|
|
67
67
|
*/
|
|
68
|
-
export async function cmdAdvertiseSLAP(domain?: string, service?: string): Promise<
|
|
68
|
+
export async function cmdAdvertiseSLAP(domain?: string, service?: string): Promise<any> {
|
|
69
69
|
if (!domain || !service) {
|
|
70
70
|
return fail('Usage: advertise-slap <domain> <service>');
|
|
71
71
|
}
|
|
@@ -9,7 +9,7 @@ import { lookupOverlay, parseOverlayOutput } from './transaction.js';
|
|
|
9
9
|
/**
|
|
10
10
|
* Discover command: query the overlay for agents and services.
|
|
11
11
|
*/
|
|
12
|
-
export async function cmdDiscover(args: string[]): Promise<
|
|
12
|
+
export async function cmdDiscover(args: string[]): Promise<any> {
|
|
13
13
|
|
|
14
14
|
// Parse flags
|
|
15
15
|
let serviceFilter: string | null = null;
|
|
@@ -26,7 +26,7 @@ async function getBSVAgentWallet(): Promise<typeof BSVAgentWallet> {
|
|
|
26
26
|
/**
|
|
27
27
|
* Register command: register this agent on the overlay network.
|
|
28
28
|
*/
|
|
29
|
-
export async function cmdRegister(): Promise<
|
|
29
|
+
export async function cmdRegister(): Promise<any> {
|
|
30
30
|
if (!fs.existsSync(PATHS.walletIdentity)) {
|
|
31
31
|
return fail('Wallet not initialized. Run: setup');
|
|
32
32
|
}
|
|
@@ -135,7 +135,7 @@ export async function cmdRegister(): Promise<never> {
|
|
|
135
135
|
/**
|
|
136
136
|
* Unregister command: submit revocation tx to remove agent from overlay network.
|
|
137
137
|
*/
|
|
138
|
-
export async function cmdUnregister(): Promise<
|
|
138
|
+
export async function cmdUnregister(): Promise<any> {
|
|
139
139
|
|
|
140
140
|
const wallet = await BSVAgentWallet.load({ network: NETWORK, storageDir: WALLET_DIR });
|
|
141
141
|
const { outputs, BEEF } = await wallet._setup.wallet.listOutputs({ basket: TOPICS.IDENTITY, include: 'entire transactions' });
|
|
@@ -27,7 +27,7 @@ async function getBSVAgentWallet(): Promise<typeof BSVAgentWallet> {
|
|
|
27
27
|
/**
|
|
28
28
|
* Services command: list currently advertised services.
|
|
29
29
|
*/
|
|
30
|
-
export async function cmdServices(): Promise<
|
|
30
|
+
export async function cmdServices(): Promise<any> {
|
|
31
31
|
const services = loadServices();
|
|
32
32
|
return ok({ services, count: services.length });
|
|
33
33
|
}
|
|
@@ -40,7 +40,7 @@ export async function cmdAdvertise(
|
|
|
40
40
|
name: string | undefined,
|
|
41
41
|
priceSatsStr: string | undefined,
|
|
42
42
|
description?: string
|
|
43
|
-
): Promise<
|
|
43
|
+
): Promise<any> {
|
|
44
44
|
if (!serviceId || !name || !priceSatsStr) {
|
|
45
45
|
return fail('Usage: advertise <serviceId> <name> <priceSats> [description]');
|
|
46
46
|
}
|
|
@@ -108,7 +108,7 @@ export async function cmdAdvertise(
|
|
|
108
108
|
/**
|
|
109
109
|
* Remove command: remove a service from local registry.
|
|
110
110
|
*/
|
|
111
|
-
export async function cmdRemove(serviceId: string | undefined): Promise<
|
|
111
|
+
export async function cmdRemove(serviceId: string | undefined): Promise<any> {
|
|
112
112
|
if (!serviceId) {
|
|
113
113
|
return fail('Usage: remove <serviceId>');
|
|
114
114
|
}
|
|
@@ -137,7 +137,7 @@ export async function cmdReadvertise(
|
|
|
137
137
|
name?: string,
|
|
138
138
|
priceSatsStr?: string,
|
|
139
139
|
description?: string
|
|
140
|
-
): Promise<
|
|
140
|
+
): Promise<any> {
|
|
141
141
|
if (!serviceId) {
|
|
142
142
|
return fail('Usage: readvertise <serviceId> [name] [priceSats] [description]');
|
|
143
143
|
}
|
|
@@ -19,7 +19,7 @@ export async function cmdPay(
|
|
|
19
19
|
pubkey: string | undefined,
|
|
20
20
|
satoshis: string | undefined,
|
|
21
21
|
description?: string
|
|
22
|
-
): Promise<
|
|
22
|
+
): Promise<any> {
|
|
23
23
|
if (!pubkey || !satoshis) {
|
|
24
24
|
return fail('Usage: pay <pubkey> <satoshis> [description]');
|
|
25
25
|
}
|
|
@@ -40,7 +40,7 @@ export async function cmdPay(
|
|
|
40
40
|
/**
|
|
41
41
|
* Verify command: verify an incoming payment BEEF.
|
|
42
42
|
*/
|
|
43
|
-
export async function cmdVerify(beefBase64: string | undefined): Promise<
|
|
43
|
+
export async function cmdVerify(beefBase64: string | undefined): Promise<any> {
|
|
44
44
|
if (!beefBase64) {
|
|
45
45
|
return fail('Usage: verify <beef_base64>');
|
|
46
46
|
}
|
|
@@ -67,7 +67,7 @@ export async function cmdAccept(
|
|
|
67
67
|
derivationSuffix: string | undefined,
|
|
68
68
|
senderIdentityKey: string | undefined,
|
|
69
69
|
description?: string
|
|
70
|
-
): Promise<
|
|
70
|
+
): Promise<any> {
|
|
71
71
|
if (!beef || !derivationPrefix || !derivationSuffix || !senderIdentityKey) {
|
|
72
72
|
return fail('Usage: accept <beef> <prefix> <suffix> <senderKey> [description]');
|
|
73
73
|
}
|
|
@@ -10,7 +10,7 @@ import { readJsonl } from '../utils/storage.js';
|
|
|
10
10
|
/**
|
|
11
11
|
* Service queue command: list pending service requests.
|
|
12
12
|
*/
|
|
13
|
-
export async function cmdServiceQueue(): Promise<
|
|
13
|
+
export async function cmdServiceQueue(): Promise<any> {
|
|
14
14
|
if (!fs.existsSync(PATHS.serviceQueue)) {
|
|
15
15
|
return ok({ pending: [], count: 0 });
|
|
16
16
|
}
|
|
@@ -24,7 +24,7 @@ export async function cmdServiceQueue(): Promise<never> {
|
|
|
24
24
|
/**
|
|
25
25
|
* Research queue command: list pending research requests.
|
|
26
26
|
*/
|
|
27
|
-
export async function cmdResearchQueue(): Promise<
|
|
27
|
+
export async function cmdResearchQueue(): Promise<any> {
|
|
28
28
|
if (!fs.existsSync(PATHS.researchQueue)) {
|
|
29
29
|
return ok({ pending: [] });
|
|
30
30
|
}
|
|
@@ -15,7 +15,7 @@ export async function cmdRequestService(
|
|
|
15
15
|
serviceId: string | undefined,
|
|
16
16
|
satsStr?: string,
|
|
17
17
|
inputJsonStr?: string
|
|
18
|
-
): Promise<
|
|
18
|
+
): Promise<any> {
|
|
19
19
|
if (!targetKey || !serviceId) {
|
|
20
20
|
return fail('Usage: request-service <identityKey> <serviceId> [sats] [inputJson]');
|
|
21
21
|
}
|
|
@@ -16,7 +16,7 @@ export async function cmdRespondService(
|
|
|
16
16
|
recipientKey: string | undefined,
|
|
17
17
|
serviceId: string | undefined,
|
|
18
18
|
resultJson: string | undefined
|
|
19
|
-
): Promise<
|
|
19
|
+
): Promise<any> {
|
|
20
20
|
if (!requestId || !recipientKey || !serviceId || !resultJson) {
|
|
21
21
|
return fail('Usage: respond-service <requestId> <recipientKey> <serviceId> <resultJson>');
|
|
22
22
|
}
|
|
@@ -93,7 +93,7 @@ export async function cmdRespondService(
|
|
|
93
93
|
/**
|
|
94
94
|
* Respond to a research request with results.
|
|
95
95
|
*/
|
|
96
|
-
export async function cmdResearchRespond(resultJsonPath: string | undefined): Promise<
|
|
96
|
+
export async function cmdResearchRespond(resultJsonPath: string | undefined): Promise<any> {
|
|
97
97
|
if (!resultJsonPath) return fail('Usage: research-respond <resultJsonFile>');
|
|
98
98
|
if (!fs.existsSync(resultJsonPath)) return fail(`File not found: ${resultJsonPath}`);
|
|
99
99
|
|
|
@@ -59,7 +59,7 @@ function sleep(ms: number): Promise<void> {
|
|
|
59
59
|
/**
|
|
60
60
|
* Balance command: show wallet balance.
|
|
61
61
|
*/
|
|
62
|
-
export async function cmdBalance(): Promise<
|
|
62
|
+
export async function cmdBalance(): Promise<any> {
|
|
63
63
|
const BSVAgentWallet = await getBSVAgentWallet();
|
|
64
64
|
const sdk = await getSdk();
|
|
65
65
|
|
|
@@ -80,7 +80,7 @@ export async function cmdBalance(): Promise<never> {
|
|
|
80
80
|
* If the transaction isn't yet on WoC (just broadcast), it will poll
|
|
81
81
|
* with exponential backoff for up to 60 seconds.
|
|
82
82
|
*/
|
|
83
|
-
export async function cmdImport(txidArg: string | undefined, voutStr?: string): Promise<
|
|
83
|
+
export async function cmdImport(txidArg: string | undefined, voutStr?: string): Promise<any> {
|
|
84
84
|
if (!txidArg) {
|
|
85
85
|
return fail('Usage: import <txid> [vout]');
|
|
86
86
|
}
|
|
@@ -49,7 +49,7 @@ async function getSdk(): Promise<any> {
|
|
|
49
49
|
/**
|
|
50
50
|
* Setup command: create wallet and show identity.
|
|
51
51
|
*/
|
|
52
|
-
export async function cmdSetup(): Promise<
|
|
52
|
+
export async function cmdSetup(): Promise<any> {
|
|
53
53
|
const BSVAgentWallet = await getBSVAgentWallet();
|
|
54
54
|
|
|
55
55
|
if (fs.existsSync(PATHS.walletIdentity)) {
|
|
@@ -88,7 +88,7 @@ export async function cmdSetup(): Promise<never> {
|
|
|
88
88
|
/**
|
|
89
89
|
* Identity command: show identity public key.
|
|
90
90
|
*/
|
|
91
|
-
export async function cmdIdentity(): Promise<
|
|
91
|
+
export async function cmdIdentity(): Promise<any> {
|
|
92
92
|
const BSVAgentWallet = await getBSVAgentWallet();
|
|
93
93
|
const wallet = await BSVAgentWallet.load({ network: NETWORK, storageDir: WALLET_DIR });
|
|
94
94
|
const identityKey = await wallet.getIdentityKey();
|
|
@@ -100,7 +100,7 @@ export async function cmdIdentity(): Promise<never> {
|
|
|
100
100
|
/**
|
|
101
101
|
* Status command: show identity and balance.
|
|
102
102
|
*/
|
|
103
|
-
export async function cmdStatus(): Promise<
|
|
103
|
+
export async function cmdStatus(): Promise<any> {
|
|
104
104
|
const BSVAgentWallet = await getBSVAgentWallet();
|
|
105
105
|
const wallet = await BSVAgentWallet.load({ network: NETWORK, storageDir: WALLET_DIR });
|
|
106
106
|
const identityKey = await wallet.getIdentityKey();
|
|
@@ -116,7 +116,7 @@ export async function cmdStatus(): Promise<never> {
|
|
|
116
116
|
/**
|
|
117
117
|
* Address command: show P2PKH receive address.
|
|
118
118
|
*/
|
|
119
|
-
export async function cmdAddress(): Promise<
|
|
119
|
+
export async function cmdAddress(): Promise<any> {
|
|
120
120
|
if (!fs.existsSync(PATHS.walletIdentity)) {
|
|
121
121
|
return fail('Wallet not initialized. Run: setup');
|
|
122
122
|
}
|
|
@@ -47,7 +47,7 @@ async function getSdk(): Promise<any> {
|
|
|
47
47
|
/**
|
|
48
48
|
* Start X verification: generate a tweet with identity key and signature.
|
|
49
49
|
*/
|
|
50
|
-
export async function cmdXVerifyStart(handleArg: string | undefined): Promise<
|
|
50
|
+
export async function cmdXVerifyStart(handleArg: string | undefined): Promise<any> {
|
|
51
51
|
if (!handleArg) {
|
|
52
52
|
return fail('Usage: x-verify-start <@handle>');
|
|
53
53
|
}
|
|
@@ -90,7 +90,7 @@ export async function cmdXVerifyStart(handleArg: string | undefined): Promise<ne
|
|
|
90
90
|
/**
|
|
91
91
|
* Complete X verification by checking the posted tweet.
|
|
92
92
|
*/
|
|
93
|
-
export async function cmdXVerifyComplete(tweetUrl: string | undefined): Promise<
|
|
93
|
+
export async function cmdXVerifyComplete(tweetUrl: string | undefined): Promise<any> {
|
|
94
94
|
if (!tweetUrl) return fail('Usage: x-verify-complete <tweet-url>');
|
|
95
95
|
|
|
96
96
|
// Load pending verification
|
|
@@ -187,7 +187,7 @@ export async function cmdXVerifyComplete(tweetUrl: string | undefined): Promise<
|
|
|
187
187
|
/**
|
|
188
188
|
* List verified X accounts (local cache).
|
|
189
189
|
*/
|
|
190
|
-
export async function cmdXVerifications(): Promise<
|
|
190
|
+
export async function cmdXVerifications(): Promise<any> {
|
|
191
191
|
const verifications = loadXVerifications();
|
|
192
192
|
return ok({ verifications, count: verifications.length });
|
|
193
193
|
}
|
|
@@ -195,7 +195,7 @@ export async function cmdXVerifications(): Promise<never> {
|
|
|
195
195
|
/**
|
|
196
196
|
* Lookup X verifications from the overlay network.
|
|
197
197
|
*/
|
|
198
|
-
export async function cmdXLookup(query: string | undefined): Promise<
|
|
198
|
+
export async function cmdXLookup(query: string | undefined): Promise<any> {
|
|
199
199
|
try {
|
|
200
200
|
const lookupQuery = query
|
|
201
201
|
? (query.startsWith('@') ? { xHandle: query } : { identityKey: query })
|
|
@@ -211,7 +211,7 @@ export async function cmdXLookup(query: string | undefined): Promise<never> {
|
|
|
211
211
|
/**
|
|
212
212
|
* List pending X engagement requests.
|
|
213
213
|
*/
|
|
214
|
-
export async function cmdXEngagementQueue(): Promise<
|
|
214
|
+
export async function cmdXEngagementQueue(): Promise<any> {
|
|
215
215
|
if (!fs.existsSync(PATHS.xEngagementQueue)) {
|
|
216
216
|
return ok({ queue: [], count: 0 });
|
|
217
217
|
}
|
|
@@ -227,7 +227,7 @@ export async function cmdXEngagementQueue(): Promise<never> {
|
|
|
227
227
|
export async function cmdXEngagementFulfill(
|
|
228
228
|
requestId: string | undefined,
|
|
229
229
|
proofUrl?: string
|
|
230
|
-
): Promise<
|
|
230
|
+
): Promise<any> {
|
|
231
231
|
if (!requestId) return fail('Usage: x-engagement-fulfill <requestId> [proofUrl]');
|
|
232
232
|
|
|
233
233
|
if (!fs.existsSync(PATHS.xEngagementQueue)) {
|