openclaw-overlay-plugin 0.7.23 → 0.7.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@
8
8
  * Run with: npx tsx src/test/overlay-submit.test.ts
9
9
  */
10
10
  import { Beef, Transaction, PrivateKey, P2PKH, LockingScript, OP, PushDrop } from '@bsv/sdk';
11
- const PROTOCOL_ID = 'clawdbot-overlay-v1';
11
+ const PROTOCOL_ID = 'openclaw-overlay-v1';
12
12
  /**
13
13
  * Extract data fields from a PushDrop script using the SDK's decode method.
14
14
  */
@@ -8,7 +8,7 @@
8
8
  * Updated to use PushDrop tokens instead of plain OP_RETURN.
9
9
  */
10
10
  import { Script, LockingScript } from '@bsv/sdk';
11
- export declare const PROTOCOL_ID = "clawdbot-overlay-v1";
11
+ export declare const PROTOCOL_ID = "openclaw-overlay-v1";
12
12
  export interface OpenclawIdentityData {
13
13
  protocol: string;
14
14
  type: 'identity';
@@ -8,7 +8,7 @@
8
8
  * Updated to use PushDrop tokens instead of plain OP_RETURN.
9
9
  */
10
10
  import { OP, Beef, PushDrop } from '@bsv/sdk';
11
- export const PROTOCOL_ID = 'clawdbot-overlay-v1';
11
+ export const PROTOCOL_ID = 'openclaw-overlay-v1';
12
12
  // ============================================================================
13
13
  // Script Parsing using PushDrop.decode()
14
14
  // ============================================================================
package/index.ts CHANGED
@@ -94,10 +94,11 @@ async function startAutoImport(env, cliPath, logger) {
94
94
  const network = env.BSV_NETWORK === 'testnet' ? 'test' : 'main';
95
95
  const controller = new AbortController();
96
96
  const timeout = setTimeout(() => controller.abort(), 15000);
97
- const resp = await fetch(`https://api.whatsonchain.com/v1/bsv/${network}/address/${address}/unspent`, { signal: controller.signal });
97
+ const resp = await fetch(`https://api.whatsonchain.com/v1/bsv/${network}/address/${address}/unspent/all`, { signal: controller.signal });
98
98
  clearTimeout(timeout);
99
99
  if (!resp.ok) return;
100
- const utxos = await resp.json();
100
+ const data = await resp.json();
101
+ const utxos = data.result || [];
101
102
 
102
103
  for (const utxo of utxos) {
103
104
  const key = `${utxo.tx_hash}:${utxo.tx_pos}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-overlay-plugin",
3
- "version": "0.7.23",
3
+ "version": "0.7.26",
4
4
  "description": "Openclaw BSV Overlay — agent discovery, service marketplace, and micropayments on the BSV blockchain",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -67,7 +67,7 @@
67
67
  "node": ">=20.0.0"
68
68
  },
69
69
  "openclaw": {
70
- "hooks": [
70
+ "extensions": [
71
71
  "./index.ts"
72
72
  ]
73
73
  }
@@ -241,8 +241,9 @@ export async function cmdBaemailRefund(requestId: string | undefined): Promise<n
241
241
  try {
242
242
  // Load UTXOs
243
243
  const address = walletIdentity.address;
244
- const utxosResp = await fetchWithTimeout(`https://api.whatsonchain.com/v1/bsv/main/address/${address}/unspent`);
245
- const utxos = await utxosResp.json();
244
+ const utxosResp = await fetchWithTimeout(`https://api.whatsonchain.com/v1/bsv/main/address/${address}/unspent/all`);
245
+ const data = await utxosResp.json();
246
+ const utxos = data.result || [];
246
247
 
247
248
  if (!utxos || utxos.length === 0) {
248
249
  return fail('No UTXOs available for refund');
@@ -10,13 +10,13 @@
10
10
 
11
11
  import { Beef, Transaction, PrivateKey, P2PKH, LockingScript, OP, PushDrop } from '@bsv/sdk';
12
12
 
13
- const PROTOCOL_ID = 'clawdbot-overlay-v1';
13
+ const PROTOCOL_ID = 'openclaw-overlay-v1';
14
14
 
15
15
  // ============================================================================
16
16
  // Server-side logic (using PushDrop for validation)
17
17
  // ============================================================================
18
18
 
19
- interface ClawdbotIdentityData {
19
+ interface OpenclawIdentityData {
20
20
  protocol: string;
21
21
  type: 'identity';
22
22
  identityKey: string;
@@ -27,7 +27,7 @@ interface ClawdbotIdentityData {
27
27
  timestamp: string;
28
28
  }
29
29
 
30
- interface ClawdbotServiceData {
30
+ interface OpenclawServiceData {
31
31
  protocol: string;
32
32
  type: 'service';
33
33
  identityKey: string;
@@ -53,14 +53,14 @@ function extractPushDropFields(script: LockingScript): number[][] | null {
53
53
  /**
54
54
  * Parse identity output using PushDrop decode and server's validation logic.
55
55
  */
56
- function parseIdentityOutput(script: LockingScript): ClawdbotIdentityData | null {
56
+ function parseIdentityOutput(script: LockingScript): OpenclawIdentityData | null {
57
57
  const fields = extractPushDropFields(script);
58
58
  if (!fields || fields.length < 1) return null;
59
59
 
60
60
  try {
61
61
  const payload = JSON.parse(
62
62
  new TextDecoder().decode(new Uint8Array(fields[0]))
63
- ) as ClawdbotIdentityData;
63
+ ) as OpenclawIdentityData;
64
64
 
65
65
  // Server validation rules
66
66
  if (payload.protocol !== PROTOCOL_ID) return null;
@@ -79,14 +79,14 @@ function parseIdentityOutput(script: LockingScript): ClawdbotIdentityData | null
79
79
  /**
80
80
  * Parse service output using PushDrop decode and server's validation logic.
81
81
  */
82
- function parseServiceOutput(script: LockingScript): ClawdbotServiceData | null {
82
+ function parseServiceOutput(script: LockingScript): OpenclawServiceData | null {
83
83
  const fields = extractPushDropFields(script);
84
84
  if (!fields || fields.length < 1) return null;
85
85
 
86
86
  try {
87
87
  const payload = JSON.parse(
88
88
  new TextDecoder().decode(new Uint8Array(fields[0]))
89
- ) as ClawdbotServiceData;
89
+ ) as OpenclawServiceData;
90
90
 
91
91
  // Server validation rules
92
92
  if (payload.protocol !== PROTOCOL_ID) return null;
@@ -276,7 +276,7 @@ async function testIdentityPayload(): Promise<void> {
276
276
  const identityKey = privKey.toPublicKey().toString();
277
277
 
278
278
  // Valid identity payload
279
- const validPayload: ClawdbotIdentityData = {
279
+ const validPayload: OpenclawIdentityData = {
280
280
  protocol: PROTOCOL_ID,
281
281
  type: 'identity',
282
282
  identityKey,
@@ -332,7 +332,7 @@ async function testServicePayload(): Promise<void> {
332
332
  const identityKey = privKey.toPublicKey().toString();
333
333
 
334
334
  // Valid service payload
335
- const validPayload: ClawdbotServiceData = {
335
+ const validPayload: OpenclawServiceData = {
336
336
  protocol: PROTOCOL_ID,
337
337
  type: 'service',
338
338
  identityKey,
@@ -380,7 +380,7 @@ async function testBeefSubmission(): Promise<void> {
380
380
  });
381
381
 
382
382
  // Valid identity registration
383
- const identityPayload: ClawdbotIdentityData = {
383
+ const identityPayload: OpenclawIdentityData = {
384
384
  protocol: PROTOCOL_ID,
385
385
  type: 'identity',
386
386
  identityKey,
@@ -10,7 +10,7 @@
10
10
 
11
11
  import { Script, OP, Beef, PushDrop, LockingScript } from '@bsv/sdk';
12
12
 
13
- export const PROTOCOL_ID = 'clawdbot-overlay-v1';
13
+ export const PROTOCOL_ID = 'openclaw-overlay-v1';
14
14
 
15
15
  // ============================================================================
16
16
  // Type Definitions (mirrored from server)
package/HOOK.md DELETED
@@ -1,12 +0,0 @@
1
- ---
2
- name: bsv-overlay-hooks
3
- description: Background automation for BSV Overlay Network — handles auto-import, registration, and service request notifications.
4
- metadata: '{"openclaw": {"events": ["gateway:start"]}}'
5
- ---
6
-
7
- # BSV Overlay Hooks
8
- This hook pack enables background automation for the BSV Overlay Network.
9
- It automatically:
10
- 1. Monitors the BSV blockchain for incoming funds.
11
- 2. Registers the agent on the overlay network once funded.
12
- 3. Wakes the agent when new service requests arrive.