@bsv/overlay 2.2.1 → 2.3.0

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.
Files changed (151) hide show
  1. package/LICENSE.txt +57 -27
  2. package/README.md +102 -269
  3. package/dist/cjs/mod.d.ts +15 -0
  4. package/dist/cjs/mod.d.ts.map +1 -0
  5. package/dist/cjs/mod.js +4 -1
  6. package/dist/cjs/mod.js.map +1 -1
  7. package/dist/cjs/package.json +41 -13
  8. package/dist/cjs/src/Advertisement.d.ts +9 -0
  9. package/dist/cjs/src/Advertisement.d.ts.map +1 -0
  10. package/dist/cjs/src/Advertiser.d.ts +36 -0
  11. package/dist/cjs/src/Advertiser.d.ts.map +1 -0
  12. package/dist/cjs/src/BASM.d.ts +110 -0
  13. package/dist/cjs/src/BASM.d.ts.map +1 -0
  14. package/dist/cjs/src/BASM.js.map +1 -1
  15. package/dist/cjs/src/BASMRemote.d.ts +14 -0
  16. package/dist/cjs/src/BASMRemote.d.ts.map +1 -0
  17. package/dist/cjs/src/BASMRemote.js.map +1 -1
  18. package/dist/cjs/src/Engine.d.ts +379 -0
  19. package/dist/cjs/src/Engine.d.ts.map +1 -0
  20. package/dist/cjs/src/Engine.js +425 -418
  21. package/dist/cjs/src/Engine.js.map +1 -1
  22. package/dist/cjs/src/GASP/OverlayGASPRemote.d.ts +24 -0
  23. package/dist/cjs/src/GASP/OverlayGASPRemote.d.ts.map +1 -0
  24. package/dist/cjs/src/GASP/OverlayGASPRemote.js +7 -10
  25. package/dist/cjs/src/GASP/OverlayGASPRemote.js.map +1 -1
  26. package/dist/cjs/src/GASP/OverlayGASPStorage.d.ts +103 -0
  27. package/dist/cjs/src/GASP/OverlayGASPStorage.d.ts.map +1 -0
  28. package/dist/cjs/src/GASP/OverlayGASPStorage.js +32 -30
  29. package/dist/cjs/src/GASP/OverlayGASPStorage.js.map +1 -1
  30. package/dist/cjs/src/LookupFormula.d.ts +29 -0
  31. package/dist/cjs/src/LookupFormula.d.ts.map +1 -0
  32. package/dist/cjs/src/LookupService.d.ts +85 -0
  33. package/dist/cjs/src/LookupService.d.ts.map +1 -0
  34. package/dist/cjs/src/Output.d.ts +32 -0
  35. package/dist/cjs/src/Output.d.ts.map +1 -0
  36. package/dist/cjs/src/SafeLog.d.ts +14 -0
  37. package/dist/cjs/src/SafeLog.d.ts.map +1 -0
  38. package/dist/cjs/src/SafeLog.js +44 -0
  39. package/dist/cjs/src/SafeLog.js.map +1 -0
  40. package/{src/SyncConfiguration.ts → dist/cjs/src/SyncConfiguration.d.ts} +2 -1
  41. package/dist/cjs/src/SyncConfiguration.d.ts.map +1 -0
  42. package/dist/cjs/src/TopicManager.d.ts +35 -0
  43. package/dist/cjs/src/TopicManager.d.ts.map +1 -0
  44. package/dist/cjs/src/storage/Storage.d.ts +237 -0
  45. package/dist/cjs/src/storage/Storage.d.ts.map +1 -0
  46. package/dist/cjs/src/storage/knex/KnexStorage.d.ts +69 -0
  47. package/dist/cjs/src/storage/knex/KnexStorage.d.ts.map +1 -0
  48. package/dist/cjs/src/storage/knex/KnexStorage.js +7 -10
  49. package/dist/cjs/src/storage/knex/KnexStorage.js.map +1 -1
  50. package/dist/cjs/src/storage/knex/all-migrations.d.ts +11 -0
  51. package/dist/cjs/src/storage/knex/all-migrations.d.ts.map +1 -0
  52. package/dist/cjs/src/storage/knex/all-migrations.js.map +1 -1
  53. package/dist/cjs/src/storage/knex/migrations/2024-05-18-001-initial.d.ts +4 -0
  54. package/dist/cjs/src/storage/knex/migrations/2024-05-18-001-initial.d.ts.map +1 -0
  55. package/dist/cjs/src/storage/knex/migrations/2024-05-18-001-initial.js.map +1 -1
  56. package/dist/cjs/src/storage/knex/migrations/2024-07-10-001-block-height.d.ts +4 -0
  57. package/dist/cjs/src/storage/knex/migrations/2024-07-10-001-block-height.d.ts.map +1 -0
  58. package/dist/cjs/src/storage/knex/migrations/2024-07-10-001-block-height.js.map +1 -1
  59. package/dist/cjs/src/storage/knex/migrations/2024-07-17-001-transactions.d.ts +4 -0
  60. package/dist/cjs/src/storage/knex/migrations/2024-07-17-001-transactions.d.ts.map +1 -0
  61. package/dist/cjs/src/storage/knex/migrations/2024-07-17-001-transactions.js.map +1 -1
  62. package/dist/cjs/src/storage/knex/migrations/2024-07-18-001-indexes.d.ts +4 -0
  63. package/dist/cjs/src/storage/knex/migrations/2024-07-18-001-indexes.d.ts.map +1 -0
  64. package/dist/cjs/src/storage/knex/migrations/2024-07-18-001-indexes.js.map +1 -1
  65. package/dist/cjs/src/storage/knex/migrations/2025-05-28-001-enlarge.d.ts +4 -0
  66. package/dist/cjs/src/storage/knex/migrations/2025-05-28-001-enlarge.d.ts.map +1 -0
  67. package/dist/cjs/src/storage/knex/migrations/2025-05-28-001-enlarge.js.map +1 -1
  68. package/dist/cjs/src/storage/knex/migrations/2025-06-25-001-gasp-pagination-support.d.ts +4 -0
  69. package/dist/cjs/src/storage/knex/migrations/2025-06-25-001-gasp-pagination-support.d.ts.map +1 -0
  70. package/dist/cjs/src/storage/knex/migrations/2025-06-25-001-gasp-pagination-support.js.map +1 -1
  71. package/dist/cjs/src/storage/knex/migrations/2025-07-22-001-fix-score-column-type.d.ts +4 -0
  72. package/dist/cjs/src/storage/knex/migrations/2025-07-22-001-fix-score-column-type.d.ts.map +1 -0
  73. package/dist/cjs/src/storage/knex/migrations/2025-07-22-001-fix-score-column-type.js.map +1 -1
  74. package/dist/cjs/src/storage/knex/migrations/2025-11-11-001-utxo-lookup-index.d.ts +9 -0
  75. package/dist/cjs/src/storage/knex/migrations/2025-11-11-001-utxo-lookup-index.d.ts.map +1 -0
  76. package/dist/cjs/src/storage/knex/migrations/2025-11-11-001-utxo-lookup-index.js.map +1 -1
  77. package/dist/cjs/src/storage/knex/migrations/2026-05-29-001-brc136-basm.d.ts +4 -0
  78. package/dist/cjs/src/storage/knex/migrations/2026-05-29-001-brc136-basm.d.ts.map +1 -0
  79. package/dist/cjs/src/storage/knex/migrations/2026-05-29-001-brc136-basm.js.map +1 -1
  80. package/dist/esm/mod.js +2 -1
  81. package/dist/esm/mod.js.map +1 -1
  82. package/dist/esm/src/BASMRemote.js.map +1 -1
  83. package/dist/esm/src/Engine.js +404 -396
  84. package/dist/esm/src/Engine.js.map +1 -1
  85. package/dist/esm/src/GASP/OverlayGASPRemote.js +2 -2
  86. package/dist/esm/src/GASP/OverlayGASPRemote.js.map +1 -1
  87. package/dist/esm/src/GASP/OverlayGASPStorage.js +21 -18
  88. package/dist/esm/src/GASP/OverlayGASPStorage.js.map +1 -1
  89. package/dist/esm/src/SafeLog.js +40 -0
  90. package/dist/esm/src/SafeLog.js.map +1 -0
  91. package/dist/esm/src/storage/knex/KnexStorage.js.map +1 -1
  92. package/dist/types/mod.d.ts +5 -4
  93. package/dist/types/mod.d.ts.map +1 -1
  94. package/dist/types/src/BASMRemote.d.ts.map +1 -1
  95. package/dist/types/src/Engine.d.ts +18 -1
  96. package/dist/types/src/Engine.d.ts.map +1 -1
  97. package/dist/types/src/GASP/OverlayGASPRemote.d.ts +2 -2
  98. package/dist/types/src/GASP/OverlayGASPRemote.d.ts.map +1 -1
  99. package/dist/types/src/GASP/OverlayGASPStorage.d.ts +3 -1
  100. package/dist/types/src/GASP/OverlayGASPStorage.d.ts.map +1 -1
  101. package/dist/types/src/SafeLog.d.ts +14 -0
  102. package/dist/types/src/SafeLog.d.ts.map +1 -0
  103. package/dist/types/src/storage/knex/KnexStorage.d.ts.map +1 -1
  104. package/dist/types/src/storage/knex/all-migrations.d.ts.map +1 -1
  105. package/package.json +85 -28
  106. package/dist/cjs/tsconfig.cjs.tsbuildinfo +0 -1
  107. package/dist/esm/tsconfig.esm.tsbuildinfo +0 -1
  108. package/dist/types/tsconfig.types.tsbuildinfo +0 -1
  109. package/docs/API.md +0 -944
  110. package/docs/BRC-136-BASM.md +0 -327
  111. package/docs/README.md +0 -16
  112. package/docs/Synchronization.md +0 -212
  113. package/docs/concepts/00-overview.md +0 -85
  114. package/docs/concepts/01-best-practices.md +0 -202
  115. package/docs/concepts/02-query-performance.md +0 -345
  116. package/docs/concepts/03-database-monitoring.md +0 -211
  117. package/docs/concepts/04-pagination-example.md +0 -186
  118. package/docs/concepts/05-recommendations-summary.md +0 -158
  119. package/docs/concepts/README.md +0 -20
  120. package/docs/examples/README.md +0 -15
  121. package/docs/examples/gs-wip.md +0 -111
  122. package/docs/internal/README.md +0 -11
  123. package/mod.ts +0 -40
  124. package/src/Advertisement.ts +0 -8
  125. package/src/Advertiser.ts +0 -41
  126. package/src/BASM.ts +0 -208
  127. package/src/BASMRemote.ts +0 -54
  128. package/src/Engine.ts +0 -2194
  129. package/src/GASP/OverlayGASPRemote.ts +0 -108
  130. package/src/GASP/OverlayGASPStorage.ts +0 -384
  131. package/src/LookupFormula.ts +0 -31
  132. package/src/LookupService.ts +0 -136
  133. package/src/Output.ts +0 -31
  134. package/src/TopicManager.ts +0 -40
  135. package/src/__tests/BASM.test.ts +0 -44
  136. package/src/__tests/BASMChain.test.ts +0 -295
  137. package/src/__tests/Engine.test.ts +0 -1381
  138. package/src/__tests/OverlayGASPRemote.test.ts +0 -135
  139. package/src/__tests/OverlayGASPStorage.test.ts +0 -205
  140. package/src/storage/Storage.ts +0 -260
  141. package/src/storage/knex/KnexStorage.ts +0 -651
  142. package/src/storage/knex/all-migrations.ts +0 -32
  143. package/src/storage/knex/migrations/2024-05-18-001-initial.ts +0 -30
  144. package/src/storage/knex/migrations/2024-07-10-001-block-height.ts +0 -15
  145. package/src/storage/knex/migrations/2024-07-17-001-transactions.ts +0 -64
  146. package/src/storage/knex/migrations/2024-07-18-001-indexes.ts +0 -30
  147. package/src/storage/knex/migrations/2025-05-28-001-enlarge.ts +0 -42
  148. package/src/storage/knex/migrations/2025-06-25-001-gasp-pagination-support.ts +0 -46
  149. package/src/storage/knex/migrations/2025-07-22-001-fix-score-column-type.ts +0 -24
  150. package/src/storage/knex/migrations/2025-11-11-001-utxo-lookup-index.ts +0 -18
  151. package/src/storage/knex/migrations/2026-05-29-001-brc136-basm.ts +0 -123
@@ -0,0 +1,36 @@
1
+ import { Script, TaggedBEEF } from '@bsv/sdk';
2
+ import { Advertisement } from './Advertisement.js';
3
+ export interface AdvertisementData {
4
+ protocol: 'SHIP' | 'SLAP';
5
+ topicOrServiceName: string;
6
+ }
7
+ /**
8
+ * Interface for managing SHIP and SLAP advertisements.
9
+ * Provides methods for creating, finding, and revoking advertisements.
10
+ */
11
+ export interface Advertiser {
12
+ /**
13
+ * Creates a new SHIP/SLAP advertisement for a given topic.
14
+ * @param adsData - The data indicating the type of advertisement.
15
+ * @returns A promise that resolves to the created advertisement as TaggedBEEF.
16
+ */
17
+ createAdvertisements: (adsData: AdvertisementData[]) => Promise<TaggedBEEF>;
18
+ /**
19
+ * Finds all SHIP/SLAP advertisements.
20
+ * @returns A promise that resolves to an array of SHIP/SLAP advertisements.
21
+ */
22
+ findAllAdvertisements: (protocol: 'SHIP' | 'SLAP') => Promise<Advertisement[]>;
23
+ /**
24
+ * Revokes an existing advertisement, either SHIP or SLAP.
25
+ * @param advertisements - The advertisements to revoke, either SHIP or SLAP.
26
+ * @returns A promise that resolves to the revocation transaction as TaggedBEEF.
27
+ */
28
+ revokeAdvertisements: (advertisements: Advertisement[]) => Promise<TaggedBEEF>;
29
+ /**
30
+ * Parses an output script to extract an advertisement.
31
+ * @param outputScript - The script of the output to be parsed.
32
+ * @returns The parsed advertisement
33
+ */
34
+ parseAdvertisement: (outputScript: Script) => Advertisement;
35
+ }
36
+ //# sourceMappingURL=Advertiser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Advertiser.d.ts","sourceRoot":"","sources":["../../../src/Advertiser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IAEzB;;;;OAIG;IACH,oBAAoB,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IAE3E;;;OAGG;IACH,qBAAqB,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,KAAK,OAAO,CAAC,aAAa,EAAE,CAAC,CAAA;IAE9E;;;;OAIG;IACH,oBAAoB,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IAE9E;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,aAAa,CAAA;CAC5D"}
@@ -0,0 +1,110 @@
1
+ import { MerklePath } from '@bsv/sdk';
2
+ export declare const BASM_ZERO_HASH = "0000000000000000000000000000000000000000000000000000000000000000";
3
+ export interface TopicBlockAnchor {
4
+ topic: string;
5
+ blockHeight: number;
6
+ blockHash: string;
7
+ basmRoot: string;
8
+ admittedCount: number;
9
+ tac: string;
10
+ }
11
+ export interface TopicAnchorTip {
12
+ topic: string;
13
+ blockHeight: number;
14
+ blockHash?: string;
15
+ basmRoot?: string;
16
+ admittedCount?: number;
17
+ tac: string;
18
+ }
19
+ export interface AdmittedTxRef {
20
+ txid: string;
21
+ blockIndex: number;
22
+ }
23
+ export interface RawTransactionRecord {
24
+ txid: string;
25
+ rawTx: string;
26
+ }
27
+ export interface RawTransactionRequest {
28
+ txids: string[];
29
+ }
30
+ export interface RawTransactionResponse {
31
+ transactions: RawTransactionRecord[];
32
+ missing: string[];
33
+ }
34
+ export interface TopicAnchorHeader {
35
+ blockHeight: number;
36
+ blockHash: string;
37
+ merkleRoot?: string;
38
+ }
39
+ export type TopicAnchorHeaderResolver = (blockHeight: number) => Promise<TopicAnchorHeader | undefined>;
40
+ export interface TopicAnchorRangeRequest {
41
+ fromHeight: number;
42
+ toHeight: number;
43
+ }
44
+ export interface TopicAnchorRangeResponse {
45
+ topic: string;
46
+ anchors: TopicBlockAnchor[];
47
+ }
48
+ export interface AdmittedListRequest {
49
+ blockHeight: number;
50
+ blockHash?: string;
51
+ }
52
+ export interface AdmittedListResponse {
53
+ topic: string;
54
+ blockHeight: number;
55
+ blockHash?: string;
56
+ admitted: AdmittedTxRef[];
57
+ }
58
+ export interface CompoundMerklePathRequest {
59
+ blockHeight: number;
60
+ txids: string[];
61
+ }
62
+ export interface CompoundMerklePathResponse {
63
+ topic: string;
64
+ blockHeight: number;
65
+ txids: string[];
66
+ merklePath: string;
67
+ }
68
+ export interface MerkleProofMetadata {
69
+ blockHeight: number;
70
+ blockIndex: number;
71
+ merkleRoot: string;
72
+ }
73
+ export interface ReorgReport {
74
+ perTopic: Array<{
75
+ topic: string;
76
+ demotedTxids: string[];
77
+ rebuiltFrom: number;
78
+ rebuiltTo: number;
79
+ }>;
80
+ }
81
+ export interface BASMPeerSyncReport {
82
+ topic: string;
83
+ endpoint: string;
84
+ status: 'matched' | 'advanced' | 'diverged' | 'skipped' | 'error';
85
+ localTip?: TopicAnchorTip;
86
+ remoteTip?: TopicAnchorTip;
87
+ checkedHeights: number[];
88
+ missingTxids: string[];
89
+ fetchedTxCount: number;
90
+ message?: string;
91
+ }
92
+ type AdmittedTxLike = string | AdmittedTxRef;
93
+ /**
94
+ * Computes a BRC-136 BASM root from admitted topic txids.
95
+ *
96
+ * The API accepts normal display-order txid hex because that is what the BSV
97
+ * TypeScript stack exposes at its public boundaries. Hashing is performed on
98
+ * internal byte order as required by the BRC, and the returned root is display
99
+ * order for JSON/wire compatibility.
100
+ */
101
+ export declare function computeBasmRoot(admitted: AdmittedTxLike[]): string;
102
+ /**
103
+ * Computes the BRC-136 cumulative Topic Anchor Chain hash:
104
+ * SHA256d(prevTac || blockHash || basmRoot), with all inputs reversed to
105
+ * internal byte order before hashing and the output returned as display hex.
106
+ */
107
+ export declare function computeTac(prevTac: string, blockHash: string, basmRoot: string): string;
108
+ export declare function extractMerkleProofMetadata(txid: string, proof?: MerklePath): MerkleProofMetadata | undefined;
109
+ export {};
110
+ //# sourceMappingURL=BASM.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BASM.d.ts","sourceRoot":"","sources":["../../../src/BASM.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,eAAO,MAAM,cAAc,qEAAqE,CAAA;AAEhG,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,oBAAoB,EAAE,CAAA;IACpC,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,MAAM,yBAAyB,GAAG,CAA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@@ -0,0 +1,14 @@
1
+ import type { AdmittedListResponse, CompoundMerklePathResponse, RawTransactionResponse, TopicAnchorRangeResponse, TopicAnchorTip } from './BASM.js';
2
+ export declare class BASMRemote {
3
+ private readonly endpoint;
4
+ private readonly topic;
5
+ private readonly fetchImpl;
6
+ constructor(endpoint: string, topic: string, fetchImpl?: typeof fetch);
7
+ requestTopicAnchorTip(): Promise<TopicAnchorTip>;
8
+ requestTopicAnchorRange(fromHeight: number, toHeight: number): Promise<TopicAnchorRangeResponse>;
9
+ requestAdmittedList(blockHeight: number, blockHash?: string): Promise<AdmittedListResponse>;
10
+ requestCompoundMerklePath(blockHeight: number, txids: string[]): Promise<CompoundMerklePathResponse>;
11
+ requestRawTransactions(txids: string[]): Promise<RawTransactionResponse>;
12
+ private post;
13
+ }
14
+ //# sourceMappingURL=BASMRemote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BASMRemote.d.ts","sourceRoot":"","sources":["../../../src/BASMRemote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,cAAc,EACf,MAAM,WAAW,CAAA;AAElB,qBAAa,UAAU;IAEnB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAH5B,YACmB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,OAAO,KAA8B,EAC9D;IAEC,qBAAqB,IAAI,OAAO,CAAC,cAAc,CAAC,CAErD;IAEK,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAErG;IAEK,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAEhG;IAEK,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K,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAM,CAAA;IACzD,CAAC;CACF"}
@@ -0,0 +1,379 @@
1
+ import { TopicManager } from './TopicManager.js';
2
+ import { LookupService } from './LookupService.js';
3
+ import { Storage } from './storage/Storage.js';
4
+ import type { Output } from './Output.js';
5
+ import { ChainTracker, MerklePath, Broadcaster, TaggedBEEF, STEAK, LookupQuestion, LookupAnswer, OverlayBroadcastFacilitator } from '@bsv/sdk';
6
+ import { Advertiser } from './Advertiser.js';
7
+ import { GASPInitialRequest, GASPInitialResponse, GASPNode } from '@bsv/gasp';
8
+ import { SyncConfiguration } from './SyncConfiguration.js';
9
+ import { type AdmittedListResponse, type BASMPeerSyncReport, type CompoundMerklePathResponse, type RawTransactionResponse, type ReorgReport, type TopicAnchorHeaderResolver, type TopicAnchorRangeResponse, type TopicAnchorTip } from './BASM.js';
10
+ type UTXOHistoryHydrationContext = {
11
+ outputCache: Map<string, Promise<Output | null>>;
12
+ };
13
+ /**
14
+ * An engine for running BSV Overlay Services (topic managers and lookup services).
15
+ */
16
+ export declare class Engine {
17
+ managers: {
18
+ [key: string]: TopicManager;
19
+ };
20
+ lookupServices: {
21
+ [key: string]: LookupService;
22
+ };
23
+ storage: Storage;
24
+ chainTracker: ChainTracker | 'scripts only';
25
+ hostingURL?: string | undefined;
26
+ shipTrackers?: string[] | undefined;
27
+ slapTrackers?: string[] | undefined;
28
+ broadcaster?: Broadcaster | undefined;
29
+ advertiser?: Advertiser | undefined;
30
+ syncConfiguration?: SyncConfiguration | undefined;
31
+ logTime: boolean;
32
+ logPrefix: string;
33
+ throwOnBroadcastFailure: boolean;
34
+ overlayBroadcastFacilitator: OverlayBroadcastFacilitator;
35
+ logger: typeof console;
36
+ suppressDefaultSyncAdvertisements: boolean;
37
+ topicAnchorHeaderResolver?: TopicAnchorHeaderResolver | undefined;
38
+ basmSyncEnabled: boolean;
39
+ unprovenEvictionBlocks: number;
40
+ maxLookupResults: number;
41
+ /**
42
+ * Creates a new Overlay Services Engine
43
+ * @param {[key: string]: TopicManager} managers - manages topic admittance
44
+ * @param {[key: string]: LookupService} lookupServices - manages UTXO lookups
45
+ * @param {Storage} storage - for interacting with internally-managed persistent data
46
+ * @param {ChainTracker | 'scripts only'} chainTracker - Verifies SPV data associated with transactions
47
+ * @param {string} [hostingURL] - The URL this engine is hosted at. Required if going to support peer-discovery with an advertiser.
48
+ * @param {Broadcaster} [Broadcaster] - broadcaster used for broadcasting the incoming transaction
49
+ * @param {Advertiser} [Advertiser] - handles SHIP and SLAP advertisements for peer-discovery
50
+ * @param {string[]} shipTrackers - SHIP domains we know to bootstrap the system
51
+ * @param {string[]} slapTrackers - SLAP domains we know to bootstrap the system
52
+ * @param {SyncConfiguration} syncConfiguration — Configuration object describing historical synchronization of topics.
53
+ * @param {boolean} logTime - Enables / disables the timing logs for various operations in the Overlay submit route.
54
+ * @param {string} logPrefix - Supports overriding the log prefix with a custom string.
55
+ * @param {boolean} throwOnBroadcastFailure - Enables / disables throwing an error when a transaction broadcast failure is detected.
56
+ * @param {OverlayBroadcastFacilitator} overlayBroadcastFacilitator - Facilitator for propagation to other Overlay Services.
57
+ * @param {typeof console} logger - The place where log entries are written.
58
+ * @param {boolean} suppressDefaultSyncAdvertisements - Whether to suppress the default (SHIP/SLAP) sync advertisements.
59
+ * @param {TopicAnchorHeaderResolver} topicAnchorHeaderResolver - Resolves block hashes for BASM anchors.
60
+ * @param {boolean} basmSyncEnabled - Whether BASM sync should run automatically.
61
+ * @param {number} unprovenEvictionBlocks - Default block age for opt-in unproven state eviction.
62
+ * @param {number} maxLookupResults - Maximum lookup formulas hydrated per request. Use -1 to opt out.
63
+ */
64
+ constructor(managers: {
65
+ [key: string]: TopicManager;
66
+ }, lookupServices: {
67
+ [key: string]: LookupService;
68
+ }, storage: Storage, chainTracker: ChainTracker | 'scripts only', hostingURL?: string | undefined, shipTrackers?: string[] | undefined, slapTrackers?: string[] | undefined, broadcaster?: Broadcaster | undefined, advertiser?: Advertiser | undefined, syncConfiguration?: SyncConfiguration | undefined, logTime?: boolean, logPrefix?: string, throwOnBroadcastFailure?: boolean, overlayBroadcastFacilitator?: OverlayBroadcastFacilitator, logger?: typeof console, suppressDefaultSyncAdvertisements?: boolean, topicAnchorHeaderResolver?: TopicAnchorHeaderResolver | undefined, basmSyncEnabled?: boolean, unprovenEvictionBlocks?: number, maxLookupResults?: number);
69
+ private startTime;
70
+ private endTime;
71
+ private currentHeightOrUndefined;
72
+ private resolveBlockHash;
73
+ private compactBEEFForStorage;
74
+ private recordTransactionData;
75
+ private buildAppliedTransactionRecord;
76
+ private recomputeTopicBlockAnchor;
77
+ /**
78
+ * Extends every configured topic's anchor chain forward with empty Topic Block
79
+ * Anchors (basmRoot = zero hash, admittedCount = 0) up to `toHeight`, so the
80
+ * cumulative TAC advances on every block even when a topic admits nothing —
81
+ * this is what lets a peer authoritatively confirm "this block contained no
82
+ * transactions for this topic". Chains with no first admission yet are left
83
+ * unstarted (genesis is the topic's first admitted height).
84
+ */
85
+ advanceTopicAnchorChains(toHeight?: number): Promise<void>;
86
+ /**
87
+ * Rebuilds a contiguous slice of a topic's anchor chain over [fromHeight,
88
+ * toHeight]. Each height uses its admitted transactions (empty -> zero basmRoot)
89
+ * and chains the cumulative TAC from the prior height. Missing heights are
90
+ * filled rather than skipped, so the chain stays gap-free. If a block hash
91
+ * cannot be resolved for some height the extension halts there to preserve
92
+ * contiguity instead of leaving a hole.
93
+ */
94
+ private rebuildTopicAnchorChain;
95
+ /**
96
+ * Reconciles BASM anchors with a blockchain reorganization reported by the
97
+ * chain tracker (e.g. go-chaintracks `/v2/reorg/stream`). Proven topic
98
+ * transactions whose block was orphaned are demoted to unproven so they leave
99
+ * the admitted set, then every topic anchor chain intersecting the affected
100
+ * height range is rebuilt over the canonical block hashes. A reorg changes the
101
+ * canonical block hash for the affected heights, so topics with no demoted
102
+ * transaction are rebuilt too. Idempotent: a clean window demotes nothing and
103
+ * reproduces an identical TAC, so this is safe to invoke on every reorg event,
104
+ * SSE reconnect, and poll.
105
+ */
106
+ handleReorg(input: {
107
+ orphanedBlockHashes: string[];
108
+ rebuildFromHeight: number;
109
+ newTipHeight: number;
110
+ }): Promise<ReorgReport>;
111
+ /**
112
+ * Revalidation sweep: the reorg fallback for chain trackers without a reorg
113
+ * event stream, and the catch-up step on every reorg-SSE (re)connect (the
114
+ * go-chaintracks reorg stream carries no event ids, so a reconnect cannot
115
+ * replay events missed while disconnected). Scans proven applied transactions
116
+ * in `[tip - depth + 1, tip]`; any whose proof root no longer validates against
117
+ * the chain tracker, or whose block hash diverges from the canonical header, is
118
+ * treated as orphaned and reconciled via {@link handleReorg}.
119
+ */
120
+ private isProvenAnchorStale;
121
+ revalidateRecentAnchors(depth?: number): Promise<ReorgReport | undefined>;
122
+ private validateTopicSubmission;
123
+ private isTopicSubmissionAccepted;
124
+ private broadcastAcceptedSubmission;
125
+ private notifyOutputSpent;
126
+ private markPreviousOutputSpent;
127
+ private markPreviousOutputsSpent;
128
+ private classifyPreviousCoins;
129
+ private removeStaleOutputs;
130
+ private notifyOutputAdmitted;
131
+ private admitOutput;
132
+ private updateConsumedOutput;
133
+ private applyTopicStorageMutation;
134
+ private applyStorageMutations;
135
+ private propagateSubmission;
136
+ /**
137
+ * Submits a transaction for processing by Overlay Services.
138
+ * @param {TaggedBEEF} taggedBEEF - The transaction to process
139
+ * @param {function(STEAK): void} [onSTEAKReady] - Optional callback function invoked when the STEAK is ready.
140
+ * @param {string} mode — Indicates the submission behavior, whether historical or current. Historical transactions are not broadcast or propagated.
141
+ * @param {number[]} offChainValues — Values necessary to evaluate topical admittance that are not stored on-chain.
142
+ *
143
+ * The optional callback function should be used to get STEAK when ready, and avoid waiting for broadcast and transaction propagation to complete.
144
+ *
145
+ * @returns {Promise<STEAK>} The submitted transaction execution acknowledgement
146
+ */
147
+ submit(taggedBEEF: TaggedBEEF, onSteakReady?: (steak: STEAK) => void, mode?: 'historical-tx' | 'current-tx' | 'historical-tx-no-spv', offChainValues?: number[]): Promise<STEAK>;
148
+ /**
149
+ * Submit a lookup question to the Overlay Services Engine, and receive back a Lookup Answer
150
+ * @param LookupQuestion — The question to ask the Overlay Services Engine
151
+ * @returns The answer to the question
152
+ */
153
+ lookup(lookupQuestion: LookupQuestion): Promise<LookupAnswer>;
154
+ private createUTXOHistoryHydrationContext;
155
+ private toOutputCacheKey;
156
+ private preloadOutputsWithBEEF;
157
+ private loadOutputWithBEEF;
158
+ private hydrateUTXOHistoryNode;
159
+ /**
160
+ * Ensures alignment between the current SHIP/SLAP advertisements and the
161
+ * configured Topic Managers and Lookup Services in the engine.
162
+ *
163
+ * This method performs the following actions:
164
+ * 1. Retrieves the current configuration of topics and services.
165
+ * 2. Fetches the existing SHIP advertisements for each configured topic.
166
+ * 3. Fetches the existing SLAP advertisements for each configured service.
167
+ * 4. Compares the current configuration with the fetched advertisements to determine which advertisements
168
+ * need to be created or revoked.
169
+ * 5. Creates new SHIP/SLAP advertisements if they do not exist for the configured topics/services.
170
+ * 6. Revokes existing SHIP/SLAP advertisements if they are no longer required based on the current configuration.
171
+ *
172
+ * The function uses the `Advertiser` methods to create or revoke advertisements and ensures the updates are
173
+ * submitted to the SHIP/SLAP overlay networks using the engine's `submit()` method.
174
+ *
175
+ * @throws Will throw an error if there are issues during the advertisement synchronization process.
176
+ * @returns {Promise<void>} A promise that resolves when the synchronization process is complete.
177
+ */
178
+ syncAdvertisements(): Promise<void>;
179
+ /**
180
+ * This method goes through each topic that we support syncing and attempts to sync with each endpoint
181
+ * associated with that topic. If the sync configuration is 'SHIP', it will sync to all peers that support
182
+ * the topic.
183
+ *
184
+ * @throws Error if the overlay service engine is not configured for topical synchronization.
185
+ */
186
+ startGASPSync(): Promise<void>;
187
+ private syncGASPWithPeer;
188
+ private resolveSyncEndpointsForTopic;
189
+ provideTopicAnchorTip(topic: string): Promise<TopicAnchorTip>;
190
+ provideTopicAnchorRange(topic: string, fromHeight: number, toHeight: number): Promise<TopicAnchorRangeResponse>;
191
+ provideAdmittedList(topic: string, blockHeight: number, blockHash?: string): Promise<AdmittedListResponse>;
192
+ provideCompoundMerklePath(topic: string, blockHeight: number, txids: string[]): Promise<CompoundMerklePathResponse>;
193
+ provideRawTransactions(txids: string[]): Promise<RawTransactionResponse>;
194
+ startBASMSync(): Promise<BASMPeerSyncReport[]>;
195
+ private reconcileBASMWithPeer;
196
+ private reconcileRemoteAnchor;
197
+ private fetchBASMMissingTransactions;
198
+ evictUnprovenTransactions(options?: {
199
+ topic?: string;
200
+ thresholdBlocks?: number;
201
+ }): Promise<{
202
+ cutoffHeight: number;
203
+ candidates: number;
204
+ evictedTransactions: number;
205
+ evictedOutputs: number;
206
+ }>;
207
+ refreshUnprovenTransactionProofs(options: {
208
+ topic?: string;
209
+ thresholdBlocks?: number;
210
+ proofProvider: (txid: string) => Promise<{
211
+ merklePath: MerklePath;
212
+ blockHeight?: number;
213
+ } | undefined>;
214
+ }): Promise<{
215
+ cutoffHeight: number;
216
+ candidates: number;
217
+ refreshedTransactions: number;
218
+ missingProofs: number;
219
+ failedProofs: number;
220
+ failures: Array<{
221
+ txid: string;
222
+ error: string;
223
+ }>;
224
+ }>;
225
+ maintainUnprovenTransactions(options: {
226
+ topic?: string;
227
+ thresholdBlocks?: number;
228
+ proofProvider: (txid: string) => Promise<{
229
+ merklePath: MerklePath;
230
+ blockHeight?: number;
231
+ } | undefined>;
232
+ }): Promise<{
233
+ refresh: {
234
+ cutoffHeight: number;
235
+ candidates: number;
236
+ refreshedTransactions: number;
237
+ missingProofs: number;
238
+ failedProofs: number;
239
+ failures: Array<{
240
+ txid: string;
241
+ error: string;
242
+ }>;
243
+ };
244
+ eviction: {
245
+ cutoffHeight: number;
246
+ candidates: number;
247
+ evictedTransactions: number;
248
+ evictedOutputs: number;
249
+ };
250
+ }>;
251
+ evictAppliedTransaction(txid: string, options?: {
252
+ topic?: string;
253
+ reason?: string;
254
+ }): Promise<{
255
+ txid: string;
256
+ reason?: string;
257
+ evictedTransactions: number;
258
+ evictedOutputs: number;
259
+ }>;
260
+ /**
261
+ * Given a GASP request, create an initial response.
262
+ *
263
+ * This method processes an initial synchronization request by finding the relevant UTXOs for the given topic
264
+ * since the provided block height in the request. It constructs a response that includes a list of these UTXOs
265
+ * and the min block height from the initial request.
266
+ *
267
+ * @param initialRequest - The GASP initial request containing the version and the block height since the last sync.
268
+ * @param topic - The topic for which UTXOs are being requested.
269
+ * @returns A promise that resolves to a GASPInitialResponse containing the list of UTXOs and the provided min block height.
270
+ */
271
+ provideForeignSyncResponse(initialRequest: GASPInitialRequest, topic: string): Promise<GASPInitialResponse>;
272
+ /**
273
+ * Provides a GASPNode for the given graphID, transaction ID, and output index.
274
+ *
275
+ * @param graphID - The identifier for the graph to which this node belongs (in the format txid.outputIndex).
276
+ * @param txid - The transaction ID for the requested output from somewhere within the graph's history.
277
+ * @param outputIndex - The index of the output in the transaction.
278
+ * @returns A promise that resolves to a GASPNode containing the raw transaction and other optional data.
279
+ * @throws An error if no output is found for the given transaction ID and output index.
280
+ */
281
+ provideForeignGASPNode(graphID: string, txid: string, outputIndex: number): Promise<GASPNode>;
282
+ /**
283
+ * Traverse and return the history of a UTXO.
284
+ *
285
+ * This method traverses the history of a given Unspent Transaction Output (UTXO) and returns
286
+ * its historical data based on the provided history selector and current depth.
287
+ *
288
+ * @param output - The UTXO to traverse the history for.
289
+ * @param historySelector - Optionally directs the history traversal:
290
+ * - If a number, denotes how many previous spends (in terms of chain depth) to include.
291
+ * - If a function, accepts a BEEF-formatted transaction, an output index, and the current depth as parameters,
292
+ * returning a promise that resolves to a boolean indicating whether to include the output in the history.
293
+ * @param {number} [currentDepth=0] - The current depth of the traversal relative to the top-level UTXO.
294
+ *
295
+ * @returns {Promise<Output | undefined>} - A promise that resolves to the output history if found, or undefined if not.
296
+ */
297
+ getUTXOHistory(output: Output, historySelector?: ((beef: number[], outputIndex: number, currentDepth: number) => Promise<boolean>) | number, currentDepth?: number, context?: UTXOHistoryHydrationContext): Promise<Output | undefined>;
298
+ /**
299
+ * Delete a UTXO and all stale consumed inputs.
300
+ * @param output - The UTXO to be deleted.
301
+ * @returns {Promise<void>} - A promise that resolves when the deletion process is complete.
302
+ */
303
+ private deleteUTXODeep;
304
+ /**
305
+ * Given a new transaction proof (txid, proof),
306
+ * update tx.merklePath if appropriate,
307
+ * and if not, recurse through all input sourceTransactions.
308
+ *
309
+ * @param tx transaction which may benefit from new proof.
310
+ * @param txid BE hex string double hash of transaction proven by proof.
311
+ * @param proof for txid
312
+ */
313
+ private updateInputProofs;
314
+ /**
315
+ * Recursively updates beefs (merkle proofs) of this output and its consumedBy lineage.
316
+ *
317
+ * @param output - An output derived from txid which may benefit from new proof.
318
+ * @param txid - The txid for which proof is a valid merkle path.
319
+ * @param proof - The merklePath proving txid is a mined transaction hash
320
+ */
321
+ private updateMerkleProof;
322
+ /**
323
+ * Recursively prune UTXOs when an incoming Merkle Proof is received.
324
+ *
325
+ * @param txid - Transaction ID of the associated outputs to prune.
326
+ * @param proof - Merkle proof containing the Merkle path and other relevant data to verify the transaction.
327
+ * @param blockHeight - The block height associated with the incoming merkle proof.
328
+ */
329
+ handleNewMerkleProof(txid: string, proof: MerklePath, blockHeight?: number): Promise<void>;
330
+ /**
331
+ * Find a list of supported topic managers
332
+ * @public
333
+ * @returns {Promise<Record<string, { name: string; shortDescription: string; iconURL?: string; version?: string; informationURL?: string; }>>} - Supported topic managers and their metadata
334
+ */
335
+ listTopicManagers(): Promise<Record<string, {
336
+ name: string;
337
+ shortDescription: string;
338
+ iconURL?: string;
339
+ version?: string;
340
+ informationURL?: string;
341
+ }>>;
342
+ /**
343
+ * Find a list of supported lookup services
344
+ * @public
345
+ * @returns {Promise<Record<string, { name: string; shortDescription: string; iconURL?: string; version?: string; informationURL?: string; }>>} - Supported lookup services and their metadata
346
+ */
347
+ listLookupServiceProviders(): Promise<Record<string, {
348
+ name: string;
349
+ shortDescription: string;
350
+ iconURL?: string;
351
+ version?: string;
352
+ informationURL?: string;
353
+ }>>;
354
+ /**
355
+ * Run a query to get the documentation for a particular topic manager
356
+ * @public
357
+ * @returns {Promise<string>} - the documentation for the topic manager
358
+ */
359
+ getDocumentationForTopicManager(manager: any): Promise<string>;
360
+ /**
361
+ * Run a query to get the documentation for a particular lookup service
362
+ * @public
363
+ * @returns {Promise<string>} - the documentation for the lookup service
364
+ */
365
+ getDocumentationForLookupServiceProvider(provider: any): Promise<string>;
366
+ /**
367
+ * Validates a URL to ensure it does not match disallowed patterns:
368
+ * - Contains "http:" protocol
369
+ * - Contains "localhost" (with or without a port)
370
+ * - Internal or non-routable IP addresses (e.g., 192.168.x.x, 10.x.x.x, 172.16.x.x to 172.31.x.x)
371
+ * - Non-routable IPs like 127.x.x.x, 0.0.0.0, or IPv6 loopback (::1)
372
+ *
373
+ * @param url - The URL string to validate
374
+ * @returns {boolean} - Returns `false` if the URL violates any of the conditions `true` otherwise
375
+ */
376
+ private isValidUrl;
377
+ }
378
+ export {};
379
+ //# sourceMappingURL=Engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Engine.d.ts","sourceRoot":"","sources":["../../../src/Engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAEL,YAAY,EACZ,UAAU,EACV,WAAW,EAEX,UAAU,EAAE,KAAK,EACjB,cAAc,EACd,YAAY,EAMZ,2BAA2B,EAG5B,MAAM,UAAU,CAAA;AACjB,OAAO,EAAqB,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC/D,OAAO,EAAQ,kBAAkB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACnF,OAAO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