@1sat/wallet-toolbox 0.0.31 → 0.0.32
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/services/OneSatServices.d.ts +3 -1
- package/dist/services/OneSatServices.js +4 -1
- package/dist/services/client/OverlayClient.d.ts +31 -0
- package/dist/services/client/OverlayClient.js +37 -0
- package/dist/services/client/index.d.ts +1 -0
- package/dist/services/client/index.js +1 -0
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ type GetUtxoStatusResult = toolboxSdk.GetUtxoStatusResult;
|
|
|
11
11
|
type PostBeefResult = toolboxSdk.PostBeefResult;
|
|
12
12
|
type ServicesCallHistory = toolboxSdk.ServicesCallHistory;
|
|
13
13
|
type WalletServices = toolboxSdk.WalletServices;
|
|
14
|
-
import { ArcadeClient, BeefClient, Bsv21Client, ChaintracksClient, OrdfsClient, OwnerClient, TxoClient } from "./client";
|
|
14
|
+
import { ArcadeClient, BeefClient, Bsv21Client, ChaintracksClient, OrdfsClient, OverlayClient, OwnerClient, TxoClient } from "./client";
|
|
15
15
|
import type { Capability, SyncOutput } from "./types";
|
|
16
16
|
export type { SyncOutput };
|
|
17
17
|
/**
|
|
@@ -28,6 +28,7 @@ export type { SyncOutput };
|
|
|
28
28
|
* - /1sat/txo/* - Transaction outputs
|
|
29
29
|
* - /1sat/owner/* - Address queries and sync
|
|
30
30
|
* - /1sat/ordfs/* - Content/inscription serving
|
|
31
|
+
* - /overlay/* - Overlay services (topic managers, lookups)
|
|
31
32
|
*/
|
|
32
33
|
export declare class OneSatServices implements WalletServices {
|
|
33
34
|
chain: Chain;
|
|
@@ -39,6 +40,7 @@ export declare class OneSatServices implements WalletServices {
|
|
|
39
40
|
readonly owner: OwnerClient;
|
|
40
41
|
readonly ordfs: OrdfsClient;
|
|
41
42
|
readonly bsv21: Bsv21Client;
|
|
43
|
+
readonly overlay: OverlayClient;
|
|
42
44
|
private fallbackServices?;
|
|
43
45
|
/**
|
|
44
46
|
* URL for wallet storage sync endpoint (BRC-100 JSON-RPC).
|
|
@@ -13,7 +13,7 @@ class ServiceError extends Error {
|
|
|
13
13
|
this.name = code;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
import { ArcadeClient, BeefClient, Bsv21Client, ChaintracksClient, OrdfsClient, OwnerClient, TxoClient, } from "./client";
|
|
16
|
+
import { ArcadeClient, BeefClient, Bsv21Client, ChaintracksClient, OrdfsClient, OverlayClient, OwnerClient, TxoClient, } from "./client";
|
|
17
17
|
/**
|
|
18
18
|
* WalletServices implementation for 1Sat ecosystem.
|
|
19
19
|
*
|
|
@@ -28,6 +28,7 @@ import { ArcadeClient, BeefClient, Bsv21Client, ChaintracksClient, OrdfsClient,
|
|
|
28
28
|
* - /1sat/txo/* - Transaction outputs
|
|
29
29
|
* - /1sat/owner/* - Address queries and sync
|
|
30
30
|
* - /1sat/ordfs/* - Content/inscription serving
|
|
31
|
+
* - /overlay/* - Overlay services (topic managers, lookups)
|
|
31
32
|
*/
|
|
32
33
|
export class OneSatServices {
|
|
33
34
|
chain;
|
|
@@ -40,6 +41,7 @@ export class OneSatServices {
|
|
|
40
41
|
owner;
|
|
41
42
|
ordfs;
|
|
42
43
|
bsv21;
|
|
44
|
+
overlay;
|
|
43
45
|
// Optional fallback to wallet-toolbox Services for methods we don't implement
|
|
44
46
|
fallbackServices;
|
|
45
47
|
/**
|
|
@@ -65,6 +67,7 @@ export class OneSatServices {
|
|
|
65
67
|
this.owner = new OwnerClient(this.baseUrl, opts);
|
|
66
68
|
this.ordfs = new OrdfsClient(this.baseUrl, opts);
|
|
67
69
|
this.bsv21 = new Bsv21Client(this.baseUrl, opts);
|
|
70
|
+
this.overlay = new OverlayClient(this.baseUrl, opts);
|
|
68
71
|
}
|
|
69
72
|
// ===== Utility Methods =====
|
|
70
73
|
/**
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseClient } from "./BaseClient";
|
|
2
|
+
import type { ClientOptions } from "../types";
|
|
3
|
+
/** Topic manager metadata returned by listTopicManagers */
|
|
4
|
+
export interface TopicManagerInfo {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
/** Lookup service provider metadata returned by listLookupServiceProviders */
|
|
8
|
+
export interface LookupServiceInfo {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Client for overlay service routes.
|
|
13
|
+
* Handles topic manager queries and overlay lookups.
|
|
14
|
+
*/
|
|
15
|
+
export declare class OverlayClient extends BaseClient {
|
|
16
|
+
constructor(baseUrl: string, options?: ClientOptions);
|
|
17
|
+
/**
|
|
18
|
+
* List all registered topic managers.
|
|
19
|
+
* BSV-21 tokens have topic managers named `tm_{tokenId}`.
|
|
20
|
+
*/
|
|
21
|
+
listTopicManagers(): Promise<Record<string, TopicManagerInfo>>;
|
|
22
|
+
/**
|
|
23
|
+
* List all registered lookup service providers.
|
|
24
|
+
*/
|
|
25
|
+
listLookupServiceProviders(): Promise<Record<string, LookupServiceInfo>>;
|
|
26
|
+
/**
|
|
27
|
+
* Get list of active BSV-21 token IDs from topic managers.
|
|
28
|
+
* Extracts tokenIds from topics matching the `tm_{tokenId}` pattern.
|
|
29
|
+
*/
|
|
30
|
+
getActiveBsv21TokenIds(): Promise<string[]>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BaseClient } from "./BaseClient";
|
|
2
|
+
/**
|
|
3
|
+
* Client for overlay service routes.
|
|
4
|
+
* Handles topic manager queries and overlay lookups.
|
|
5
|
+
*/
|
|
6
|
+
export class OverlayClient extends BaseClient {
|
|
7
|
+
constructor(baseUrl, options = {}) {
|
|
8
|
+
super(baseUrl, options);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* List all registered topic managers.
|
|
12
|
+
* BSV-21 tokens have topic managers named `tm_{tokenId}`.
|
|
13
|
+
*/
|
|
14
|
+
async listTopicManagers() {
|
|
15
|
+
return this.request("/overlay/listTopicManagers");
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* List all registered lookup service providers.
|
|
19
|
+
*/
|
|
20
|
+
async listLookupServiceProviders() {
|
|
21
|
+
return this.request("/overlay/listLookupServiceProviders");
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get list of active BSV-21 token IDs from topic managers.
|
|
25
|
+
* Extracts tokenIds from topics matching the `tm_{tokenId}` pattern.
|
|
26
|
+
*/
|
|
27
|
+
async getActiveBsv21TokenIds() {
|
|
28
|
+
const topicManagers = await this.listTopicManagers();
|
|
29
|
+
const tokenIds = [];
|
|
30
|
+
for (const topic of Object.keys(topicManagers)) {
|
|
31
|
+
if (topic.startsWith("tm_")) {
|
|
32
|
+
tokenIds.push(topic.slice(3));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return tokenIds;
|
|
36
|
+
}
|
|
37
|
+
}
|