@bsv/overlay 2.2.0 → 2.2.7
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/LICENSE.txt +57 -27
- package/README.md +102 -266
- package/dist/cjs/mod.d.ts +15 -0
- package/dist/cjs/mod.d.ts.map +1 -0
- package/dist/cjs/mod.js +4 -1
- package/dist/cjs/mod.js.map +1 -1
- package/dist/cjs/package.json +46 -18
- package/dist/cjs/src/Advertisement.d.ts +9 -0
- package/dist/cjs/src/Advertisement.d.ts.map +1 -0
- package/dist/cjs/src/Advertiser.d.ts +36 -0
- package/dist/cjs/src/Advertiser.d.ts.map +1 -0
- package/dist/cjs/src/BASM.d.ts +110 -0
- package/dist/cjs/src/BASM.d.ts.map +1 -0
- package/dist/cjs/src/BASM.js.map +1 -1
- package/dist/cjs/src/BASMRemote.d.ts +14 -0
- package/dist/cjs/src/BASMRemote.d.ts.map +1 -0
- package/dist/cjs/src/BASMRemote.js.map +1 -1
- package/dist/cjs/src/Engine.d.ts +377 -0
- package/dist/cjs/src/Engine.d.ts.map +1 -0
- package/dist/cjs/src/Engine.js +430 -436
- package/dist/cjs/src/Engine.js.map +1 -1
- package/dist/cjs/src/GASP/OverlayGASPRemote.d.ts +24 -0
- package/dist/cjs/src/GASP/OverlayGASPRemote.d.ts.map +1 -0
- package/dist/cjs/src/GASP/OverlayGASPRemote.js +7 -10
- package/dist/cjs/src/GASP/OverlayGASPRemote.js.map +1 -1
- package/dist/cjs/src/GASP/OverlayGASPStorage.d.ts +103 -0
- package/dist/cjs/src/GASP/OverlayGASPStorage.d.ts.map +1 -0
- package/dist/cjs/src/GASP/OverlayGASPStorage.js +34 -31
- package/dist/cjs/src/GASP/OverlayGASPStorage.js.map +1 -1
- package/dist/cjs/src/LookupFormula.d.ts +29 -0
- package/dist/cjs/src/LookupFormula.d.ts.map +1 -0
- package/dist/cjs/src/LookupService.d.ts +85 -0
- package/dist/cjs/src/LookupService.d.ts.map +1 -0
- package/dist/cjs/src/Output.d.ts +32 -0
- package/dist/cjs/src/Output.d.ts.map +1 -0
- package/dist/cjs/src/SafeLog.d.ts +14 -0
- package/dist/cjs/src/SafeLog.d.ts.map +1 -0
- package/dist/cjs/src/SafeLog.js +44 -0
- package/dist/cjs/src/SafeLog.js.map +1 -0
- package/{src/SyncConfiguration.ts → dist/cjs/src/SyncConfiguration.d.ts} +2 -1
- package/dist/cjs/src/SyncConfiguration.d.ts.map +1 -0
- package/dist/cjs/src/TopicManager.d.ts +35 -0
- package/dist/cjs/src/TopicManager.d.ts.map +1 -0
- package/dist/cjs/src/storage/Storage.d.ts +237 -0
- package/dist/cjs/src/storage/Storage.d.ts.map +1 -0
- package/dist/cjs/src/storage/knex/KnexStorage.d.ts +69 -0
- package/dist/cjs/src/storage/knex/KnexStorage.d.ts.map +1 -0
- package/dist/cjs/src/storage/knex/KnexStorage.js +7 -10
- package/dist/cjs/src/storage/knex/KnexStorage.js.map +1 -1
- package/dist/cjs/src/storage/knex/all-migrations.d.ts +11 -0
- package/dist/cjs/src/storage/knex/all-migrations.d.ts.map +1 -0
- package/dist/cjs/src/storage/knex/all-migrations.js.map +1 -1
- package/dist/cjs/src/storage/knex/migrations/2024-05-18-001-initial.d.ts +4 -0
- package/dist/cjs/src/storage/knex/migrations/2024-05-18-001-initial.d.ts.map +1 -0
- package/dist/cjs/src/storage/knex/migrations/2024-05-18-001-initial.js.map +1 -1
- package/dist/cjs/src/storage/knex/migrations/2024-07-10-001-block-height.d.ts +4 -0
- package/dist/cjs/src/storage/knex/migrations/2024-07-10-001-block-height.d.ts.map +1 -0
- package/dist/cjs/src/storage/knex/migrations/2024-07-10-001-block-height.js.map +1 -1
- package/dist/cjs/src/storage/knex/migrations/2024-07-17-001-transactions.d.ts +4 -0
- package/dist/cjs/src/storage/knex/migrations/2024-07-17-001-transactions.d.ts.map +1 -0
- package/dist/cjs/src/storage/knex/migrations/2024-07-17-001-transactions.js +36 -12
- package/dist/cjs/src/storage/knex/migrations/2024-07-17-001-transactions.js.map +1 -1
- package/dist/cjs/src/storage/knex/migrations/2024-07-18-001-indexes.d.ts +4 -0
- package/dist/cjs/src/storage/knex/migrations/2024-07-18-001-indexes.d.ts.map +1 -0
- package/dist/cjs/src/storage/knex/migrations/2024-07-18-001-indexes.js.map +1 -1
- package/dist/cjs/src/storage/knex/migrations/2025-05-28-001-enlarge.d.ts +4 -0
- package/dist/cjs/src/storage/knex/migrations/2025-05-28-001-enlarge.d.ts.map +1 -0
- package/dist/cjs/src/storage/knex/migrations/2025-05-28-001-enlarge.js.map +1 -1
- package/dist/cjs/src/storage/knex/migrations/2025-06-25-001-gasp-pagination-support.d.ts +4 -0
- package/dist/cjs/src/storage/knex/migrations/2025-06-25-001-gasp-pagination-support.d.ts.map +1 -0
- package/dist/cjs/src/storage/knex/migrations/2025-06-25-001-gasp-pagination-support.js.map +1 -1
- package/dist/cjs/src/storage/knex/migrations/2025-07-22-001-fix-score-column-type.d.ts +4 -0
- package/dist/cjs/src/storage/knex/migrations/2025-07-22-001-fix-score-column-type.d.ts.map +1 -0
- package/dist/cjs/src/storage/knex/migrations/2025-07-22-001-fix-score-column-type.js.map +1 -1
- package/dist/cjs/src/storage/knex/migrations/2025-11-11-001-utxo-lookup-index.d.ts +9 -0
- package/dist/cjs/src/storage/knex/migrations/2025-11-11-001-utxo-lookup-index.d.ts.map +1 -0
- package/dist/cjs/src/storage/knex/migrations/2025-11-11-001-utxo-lookup-index.js.map +1 -1
- package/dist/cjs/src/storage/knex/migrations/2026-05-29-001-brc136-basm.d.ts +4 -0
- package/dist/cjs/src/storage/knex/migrations/2026-05-29-001-brc136-basm.d.ts.map +1 -0
- package/dist/cjs/src/storage/knex/migrations/2026-05-29-001-brc136-basm.js.map +1 -1
- package/dist/esm/mod.js +2 -1
- package/dist/esm/mod.js.map +1 -1
- package/dist/esm/src/BASMRemote.js.map +1 -1
- package/dist/esm/src/Engine.js +408 -414
- package/dist/esm/src/Engine.js.map +1 -1
- package/dist/esm/src/GASP/OverlayGASPRemote.js +2 -2
- package/dist/esm/src/GASP/OverlayGASPRemote.js.map +1 -1
- package/dist/esm/src/GASP/OverlayGASPStorage.js +23 -19
- package/dist/esm/src/GASP/OverlayGASPStorage.js.map +1 -1
- package/dist/esm/src/SafeLog.js +40 -0
- package/dist/esm/src/SafeLog.js.map +1 -0
- package/dist/esm/src/storage/knex/KnexStorage.js.map +1 -1
- package/dist/esm/src/storage/knex/migrations/2024-07-17-001-transactions.js +36 -12
- package/dist/esm/src/storage/knex/migrations/2024-07-17-001-transactions.js.map +1 -1
- package/dist/types/mod.d.ts +5 -4
- package/dist/types/mod.d.ts.map +1 -1
- package/dist/types/src/BASMRemote.d.ts.map +1 -1
- package/dist/types/src/Engine.d.ts +15 -0
- package/dist/types/src/Engine.d.ts.map +1 -1
- package/dist/types/src/GASP/OverlayGASPRemote.d.ts +2 -2
- package/dist/types/src/GASP/OverlayGASPRemote.d.ts.map +1 -1
- package/dist/types/src/GASP/OverlayGASPStorage.d.ts +3 -1
- package/dist/types/src/GASP/OverlayGASPStorage.d.ts.map +1 -1
- package/dist/types/src/SafeLog.d.ts +14 -0
- package/dist/types/src/SafeLog.d.ts.map +1 -0
- package/dist/types/src/storage/knex/KnexStorage.d.ts.map +1 -1
- package/dist/types/src/storage/knex/all-migrations.d.ts.map +1 -1
- package/dist/types/src/storage/knex/migrations/2024-07-17-001-transactions.d.ts.map +1 -1
- package/package.json +87 -30
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +0 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +0 -1
- package/dist/types/tsconfig.types.tsbuildinfo +0 -1
- package/docs/API.md +0 -944
- package/docs/BRC-136-BASM.md +0 -327
- package/docs/README.md +0 -16
- package/docs/Synchronization.md +0 -212
- package/docs/concepts/00-overview.md +0 -85
- package/docs/concepts/01-best-practices.md +0 -202
- package/docs/concepts/02-query-performance.md +0 -345
- package/docs/concepts/03-database-monitoring.md +0 -211
- package/docs/concepts/04-pagination-example.md +0 -186
- package/docs/concepts/05-recommendations-summary.md +0 -158
- package/docs/concepts/README.md +0 -20
- package/docs/examples/README.md +0 -15
- package/docs/examples/gs-wip.md +0 -111
- package/docs/internal/README.md +0 -11
- package/mod.ts +0 -40
- package/src/Advertisement.ts +0 -8
- package/src/Advertiser.ts +0 -41
- package/src/BASM.ts +0 -208
- package/src/BASMRemote.ts +0 -54
- package/src/Engine.ts +0 -2199
- package/src/GASP/OverlayGASPRemote.ts +0 -108
- package/src/GASP/OverlayGASPStorage.ts +0 -383
- package/src/LookupFormula.ts +0 -31
- package/src/LookupService.ts +0 -136
- package/src/Output.ts +0 -31
- package/src/TopicManager.ts +0 -40
- package/src/__tests/BASM.test.ts +0 -44
- package/src/__tests/BASMChain.test.ts +0 -290
- package/src/__tests/Engine.test.ts +0 -1345
- package/src/__tests/OverlayGASPRemote.test.ts +0 -135
- package/src/__tests/OverlayGASPStorage.test.ts +0 -171
- package/src/storage/Storage.ts +0 -260
- package/src/storage/knex/KnexStorage.ts +0 -651
- package/src/storage/knex/all-migrations.ts +0 -32
- package/src/storage/knex/migrations/2024-05-18-001-initial.ts +0 -30
- package/src/storage/knex/migrations/2024-07-10-001-block-height.ts +0 -15
- package/src/storage/knex/migrations/2024-07-17-001-transactions.ts +0 -40
- package/src/storage/knex/migrations/2024-07-18-001-indexes.ts +0 -30
- package/src/storage/knex/migrations/2025-05-28-001-enlarge.ts +0 -42
- package/src/storage/knex/migrations/2025-06-25-001-gasp-pagination-support.ts +0 -46
- package/src/storage/knex/migrations/2025-07-22-001-fix-score-column-type.ts +0 -24
- package/src/storage/knex/migrations/2025-11-11-001-utxo-lookup-index.ts +0 -18
- 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;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A;AAkC5C;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,MAAM,CAuBlE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOvF;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,mBAAmB,GAAG,SAAS,CAe5G"}
|
package/dist/cjs/src/BASM.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BASM.js","sourceRoot":"","sources":["../../../src/BASM.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BASM.js","sourceRoot":"","sources":["../../../src/BASM.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAwC;AAG3B,QAAA,cAAc,GAAG,kEAAkE,CAAA;AA8GhG,SAAS,OAAO,CAAC,MAAc;IAC7B,MAAM,KAAK,GAAG,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAA;IAC1D,OAAO,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAA;AACpD,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,KAAa;IAChD,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,0BAA0B,CAAC,CAAA;IACrD,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAY;IACxC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAC3B,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,EAAE,CAAA;AAC3C,CAAC;AAED,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B,UAAU,EAAE,IAAI,CAAC,MAAM;QACvB,UAAU,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC;KACpC,CAAA;AACH,CAAC"}
|
|
@@ -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,yBAAyB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAEzG;IAEK,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAE7E;YAEa,IAAI;CAkBnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BASMRemote.js","sourceRoot":"","sources":["../../../src/BASMRemote.ts"],"names":[],"mappings":";;;AAQA
|
|
1
|
+
{"version":3,"file":"BASMRemote.js","sourceRoot":"","sources":["../../../src/BASMRemote.ts"],"names":[],"mappings":";;;AAQA;IACE,YACmB,QAAgB,EAChB,KAAa,EACb,SAAS,GAAiB,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;wBAFhD,QAAQ;qBACR,KAAK;yBACL,SAAS;IACxB,CAAC;IAEL,KAAK,CAAC,qBAAqB;QACzB,OAAO,MAAM,IAAI,CAAC,IAAI,CAAiB,wBAAwB,EAAE,EAAE,CAAC,CAAA;IACtE,CAAC;IAED,KAAK,CAAC,uBAAuB,CAAC,UAAkB,EAAE,QAAgB;QAChE,OAAO,MAAM,IAAI,CAAC,IAAI,CAA2B,0BAA0B,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAA;IACxG,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,WAAmB,EAAE,SAAkB;QAC/D,OAAO,MAAM,IAAI,CAAC,IAAI,CAAuB,sBAAsB,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,CAAA;IAClG,CAAC;IAED,KAAK,CAAC,yBAAyB,CAAC,WAAmB,EAAE,KAAe;QAClE,OAAO,MAAM,IAAI,CAAC,IAAI,CAA6B,4BAA4B,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAA;IAC1G,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,KAAe;QAC1C,OAAO,MAAM,IAAI,CAAC,IAAI,CAAyB,yBAAyB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;IACtF,CAAC;IAEO,KAAK,CAAC,IAAI,CAAI,IAAY,EAAE,IAAa;QAC/C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,EAAE;YAC7E,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;gBAC1B,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,IAAI,CAAC,KAAK;aAC1B;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;SAC3B,CAAC,CAAA;QAEF,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;QAClC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,aAAa,IAAI,CAAC,QAAQ,aAAa,QAAQ,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC,CAAA;QACpF,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAM,CAAA;IACzD,CAAC;CACF"}
|
|
@@ -0,0 +1,377 @@
|
|
|
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
|
+
/**
|
|
41
|
+
* Creates a new Overlay Services Engine
|
|
42
|
+
* @param {[key: string]: TopicManager} managers - manages topic admittance
|
|
43
|
+
* @param {[key: string]: LookupService} lookupServices - manages UTXO lookups
|
|
44
|
+
* @param {Storage} storage - for interacting with internally-managed persistent data
|
|
45
|
+
* @param {ChainTracker | 'scripts only'} chainTracker - Verifies SPV data associated with transactions
|
|
46
|
+
* @param {string} [hostingURL] - The URL this engine is hosted at. Required if going to support peer-discovery with an advertiser.
|
|
47
|
+
* @param {Broadcaster} [Broadcaster] - broadcaster used for broadcasting the incoming transaction
|
|
48
|
+
* @param {Advertiser} [Advertiser] - handles SHIP and SLAP advertisements for peer-discovery
|
|
49
|
+
* @param {string[]} shipTrackers - SHIP domains we know to bootstrap the system
|
|
50
|
+
* @param {string[]} slapTrackers - SLAP domains we know to bootstrap the system
|
|
51
|
+
* @param {SyncConfiguration} syncConfiguration — Configuration object describing historical synchronization of topics.
|
|
52
|
+
* @param {boolean} logTime - Enables / disables the timing logs for various operations in the Overlay submit route.
|
|
53
|
+
* @param {string} logPrefix - Supports overriding the log prefix with a custom string.
|
|
54
|
+
* @param {boolean} throwOnBroadcastFailure - Enables / disables throwing an error when a transaction broadcast failure is detected.
|
|
55
|
+
* @param {OverlayBroadcastFacilitator} overlayBroadcastFacilitator - Facilitator for propagation to other Overlay Services.
|
|
56
|
+
* @param {typeof console} logger - The place where log entries are written.
|
|
57
|
+
* @param {boolean} suppressDefaultSyncAdvertisements - Whether to suppress the default (SHIP/SLAP) sync advertisements.
|
|
58
|
+
* @param {TopicAnchorHeaderResolver} topicAnchorHeaderResolver - Resolves block hashes for BASM anchors.
|
|
59
|
+
* @param {boolean} basmSyncEnabled - Whether BASM sync should run automatically.
|
|
60
|
+
* @param {number} unprovenEvictionBlocks - Default block age for opt-in unproven state eviction.
|
|
61
|
+
*/
|
|
62
|
+
constructor(managers: {
|
|
63
|
+
[key: string]: TopicManager;
|
|
64
|
+
}, lookupServices: {
|
|
65
|
+
[key: string]: LookupService;
|
|
66
|
+
}, 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);
|
|
67
|
+
private startTime;
|
|
68
|
+
private endTime;
|
|
69
|
+
private currentHeightOrUndefined;
|
|
70
|
+
private resolveBlockHash;
|
|
71
|
+
private compactBEEFForStorage;
|
|
72
|
+
private recordTransactionData;
|
|
73
|
+
private buildAppliedTransactionRecord;
|
|
74
|
+
private recomputeTopicBlockAnchor;
|
|
75
|
+
/**
|
|
76
|
+
* Extends every configured topic's anchor chain forward with empty Topic Block
|
|
77
|
+
* Anchors (basmRoot = zero hash, admittedCount = 0) up to `toHeight`, so the
|
|
78
|
+
* cumulative TAC advances on every block even when a topic admits nothing —
|
|
79
|
+
* this is what lets a peer authoritatively confirm "this block contained no
|
|
80
|
+
* transactions for this topic". Chains with no first admission yet are left
|
|
81
|
+
* unstarted (genesis is the topic's first admitted height).
|
|
82
|
+
*/
|
|
83
|
+
advanceTopicAnchorChains(toHeight?: number): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Rebuilds a contiguous slice of a topic's anchor chain over [fromHeight,
|
|
86
|
+
* toHeight]. Each height uses its admitted transactions (empty -> zero basmRoot)
|
|
87
|
+
* and chains the cumulative TAC from the prior height. Missing heights are
|
|
88
|
+
* filled rather than skipped, so the chain stays gap-free. If a block hash
|
|
89
|
+
* cannot be resolved for some height the extension halts there to preserve
|
|
90
|
+
* contiguity instead of leaving a hole.
|
|
91
|
+
*/
|
|
92
|
+
private rebuildTopicAnchorChain;
|
|
93
|
+
/**
|
|
94
|
+
* Reconciles BASM anchors with a blockchain reorganization reported by the
|
|
95
|
+
* chain tracker (e.g. go-chaintracks `/v2/reorg/stream`). Proven topic
|
|
96
|
+
* transactions whose block was orphaned are demoted to unproven so they leave
|
|
97
|
+
* the admitted set, then every topic anchor chain intersecting the affected
|
|
98
|
+
* height range is rebuilt over the canonical block hashes. A reorg changes the
|
|
99
|
+
* canonical block hash for the affected heights, so topics with no demoted
|
|
100
|
+
* transaction are rebuilt too. Idempotent: a clean window demotes nothing and
|
|
101
|
+
* reproduces an identical TAC, so this is safe to invoke on every reorg event,
|
|
102
|
+
* SSE reconnect, and poll.
|
|
103
|
+
*/
|
|
104
|
+
handleReorg(input: {
|
|
105
|
+
orphanedBlockHashes: string[];
|
|
106
|
+
rebuildFromHeight: number;
|
|
107
|
+
newTipHeight: number;
|
|
108
|
+
}): Promise<ReorgReport>;
|
|
109
|
+
/**
|
|
110
|
+
* Revalidation sweep: the reorg fallback for chain trackers without a reorg
|
|
111
|
+
* event stream, and the catch-up step on every reorg-SSE (re)connect (the
|
|
112
|
+
* go-chaintracks reorg stream carries no event ids, so a reconnect cannot
|
|
113
|
+
* replay events missed while disconnected). Scans proven applied transactions
|
|
114
|
+
* in `[tip - depth + 1, tip]`; any whose proof root no longer validates against
|
|
115
|
+
* the chain tracker, or whose block hash diverges from the canonical header, is
|
|
116
|
+
* treated as orphaned and reconciled via {@link handleReorg}.
|
|
117
|
+
*/
|
|
118
|
+
private isProvenAnchorStale;
|
|
119
|
+
revalidateRecentAnchors(depth?: number): Promise<ReorgReport | undefined>;
|
|
120
|
+
private validateTopicSubmission;
|
|
121
|
+
private isTopicSubmissionAccepted;
|
|
122
|
+
private broadcastAcceptedSubmission;
|
|
123
|
+
private notifyOutputSpent;
|
|
124
|
+
private markPreviousOutputSpent;
|
|
125
|
+
private markPreviousOutputsSpent;
|
|
126
|
+
private classifyPreviousCoins;
|
|
127
|
+
private removeStaleOutputs;
|
|
128
|
+
private notifyOutputAdmitted;
|
|
129
|
+
private admitOutput;
|
|
130
|
+
private updateConsumedOutput;
|
|
131
|
+
private applyTopicStorageMutation;
|
|
132
|
+
private applyStorageMutations;
|
|
133
|
+
private propagateSubmission;
|
|
134
|
+
/**
|
|
135
|
+
* Submits a transaction for processing by Overlay Services.
|
|
136
|
+
* @param {TaggedBEEF} taggedBEEF - The transaction to process
|
|
137
|
+
* @param {function(STEAK): void} [onSTEAKReady] - Optional callback function invoked when the STEAK is ready.
|
|
138
|
+
* @param {string} mode — Indicates the submission behavior, whether historical or current. Historical transactions are not broadcast or propagated.
|
|
139
|
+
* @param {number[]} offChainValues — Values necessary to evaluate topical admittance that are not stored on-chain.
|
|
140
|
+
*
|
|
141
|
+
* The optional callback function should be used to get STEAK when ready, and avoid waiting for broadcast and transaction propagation to complete.
|
|
142
|
+
*
|
|
143
|
+
* @returns {Promise<STEAK>} The submitted transaction execution acknowledgement
|
|
144
|
+
*/
|
|
145
|
+
submit(taggedBEEF: TaggedBEEF, onSteakReady?: (steak: STEAK) => void, mode?: 'historical-tx' | 'current-tx' | 'historical-tx-no-spv', offChainValues?: number[]): Promise<STEAK>;
|
|
146
|
+
/**
|
|
147
|
+
* Submit a lookup question to the Overlay Services Engine, and receive back a Lookup Answer
|
|
148
|
+
* @param LookupQuestion — The question to ask the Overlay Services Engine
|
|
149
|
+
* @returns The answer to the question
|
|
150
|
+
*/
|
|
151
|
+
lookup(lookupQuestion: LookupQuestion): Promise<LookupAnswer>;
|
|
152
|
+
private createUTXOHistoryHydrationContext;
|
|
153
|
+
private toOutputCacheKey;
|
|
154
|
+
private preloadOutputsWithBEEF;
|
|
155
|
+
private loadOutputWithBEEF;
|
|
156
|
+
private hydrateUTXOHistoryNode;
|
|
157
|
+
/**
|
|
158
|
+
* Ensures alignment between the current SHIP/SLAP advertisements and the
|
|
159
|
+
* configured Topic Managers and Lookup Services in the engine.
|
|
160
|
+
*
|
|
161
|
+
* This method performs the following actions:
|
|
162
|
+
* 1. Retrieves the current configuration of topics and services.
|
|
163
|
+
* 2. Fetches the existing SHIP advertisements for each configured topic.
|
|
164
|
+
* 3. Fetches the existing SLAP advertisements for each configured service.
|
|
165
|
+
* 4. Compares the current configuration with the fetched advertisements to determine which advertisements
|
|
166
|
+
* need to be created or revoked.
|
|
167
|
+
* 5. Creates new SHIP/SLAP advertisements if they do not exist for the configured topics/services.
|
|
168
|
+
* 6. Revokes existing SHIP/SLAP advertisements if they are no longer required based on the current configuration.
|
|
169
|
+
*
|
|
170
|
+
* The function uses the `Advertiser` methods to create or revoke advertisements and ensures the updates are
|
|
171
|
+
* submitted to the SHIP/SLAP overlay networks using the engine's `submit()` method.
|
|
172
|
+
*
|
|
173
|
+
* @throws Will throw an error if there are issues during the advertisement synchronization process.
|
|
174
|
+
* @returns {Promise<void>} A promise that resolves when the synchronization process is complete.
|
|
175
|
+
*/
|
|
176
|
+
syncAdvertisements(): Promise<void>;
|
|
177
|
+
/**
|
|
178
|
+
* This method goes through each topic that we support syncing and attempts to sync with each endpoint
|
|
179
|
+
* associated with that topic. If the sync configuration is 'SHIP', it will sync to all peers that support
|
|
180
|
+
* the topic.
|
|
181
|
+
*
|
|
182
|
+
* @throws Error if the overlay service engine is not configured for topical synchronization.
|
|
183
|
+
*/
|
|
184
|
+
startGASPSync(): Promise<void>;
|
|
185
|
+
private syncGASPWithPeer;
|
|
186
|
+
private resolveSyncEndpointsForTopic;
|
|
187
|
+
provideTopicAnchorTip(topic: string): Promise<TopicAnchorTip>;
|
|
188
|
+
provideTopicAnchorRange(topic: string, fromHeight: number, toHeight: number): Promise<TopicAnchorRangeResponse>;
|
|
189
|
+
provideAdmittedList(topic: string, blockHeight: number, blockHash?: string): Promise<AdmittedListResponse>;
|
|
190
|
+
provideCompoundMerklePath(topic: string, blockHeight: number, txids: string[]): Promise<CompoundMerklePathResponse>;
|
|
191
|
+
provideRawTransactions(txids: string[]): Promise<RawTransactionResponse>;
|
|
192
|
+
startBASMSync(): Promise<BASMPeerSyncReport[]>;
|
|
193
|
+
private reconcileBASMWithPeer;
|
|
194
|
+
private reconcileRemoteAnchor;
|
|
195
|
+
private fetchBASMMissingTransactions;
|
|
196
|
+
evictUnprovenTransactions(options?: {
|
|
197
|
+
topic?: string;
|
|
198
|
+
thresholdBlocks?: number;
|
|
199
|
+
}): Promise<{
|
|
200
|
+
cutoffHeight: number;
|
|
201
|
+
candidates: number;
|
|
202
|
+
evictedTransactions: number;
|
|
203
|
+
evictedOutputs: number;
|
|
204
|
+
}>;
|
|
205
|
+
refreshUnprovenTransactionProofs(options: {
|
|
206
|
+
topic?: string;
|
|
207
|
+
thresholdBlocks?: number;
|
|
208
|
+
proofProvider: (txid: string) => Promise<{
|
|
209
|
+
merklePath: MerklePath;
|
|
210
|
+
blockHeight?: number;
|
|
211
|
+
} | undefined>;
|
|
212
|
+
}): Promise<{
|
|
213
|
+
cutoffHeight: number;
|
|
214
|
+
candidates: number;
|
|
215
|
+
refreshedTransactions: number;
|
|
216
|
+
missingProofs: number;
|
|
217
|
+
failedProofs: number;
|
|
218
|
+
failures: Array<{
|
|
219
|
+
txid: string;
|
|
220
|
+
error: string;
|
|
221
|
+
}>;
|
|
222
|
+
}>;
|
|
223
|
+
maintainUnprovenTransactions(options: {
|
|
224
|
+
topic?: string;
|
|
225
|
+
thresholdBlocks?: number;
|
|
226
|
+
proofProvider: (txid: string) => Promise<{
|
|
227
|
+
merklePath: MerklePath;
|
|
228
|
+
blockHeight?: number;
|
|
229
|
+
} | undefined>;
|
|
230
|
+
}): Promise<{
|
|
231
|
+
refresh: {
|
|
232
|
+
cutoffHeight: number;
|
|
233
|
+
candidates: number;
|
|
234
|
+
refreshedTransactions: number;
|
|
235
|
+
missingProofs: number;
|
|
236
|
+
failedProofs: number;
|
|
237
|
+
failures: Array<{
|
|
238
|
+
txid: string;
|
|
239
|
+
error: string;
|
|
240
|
+
}>;
|
|
241
|
+
};
|
|
242
|
+
eviction: {
|
|
243
|
+
cutoffHeight: number;
|
|
244
|
+
candidates: number;
|
|
245
|
+
evictedTransactions: number;
|
|
246
|
+
evictedOutputs: number;
|
|
247
|
+
};
|
|
248
|
+
}>;
|
|
249
|
+
evictAppliedTransaction(txid: string, options?: {
|
|
250
|
+
topic?: string;
|
|
251
|
+
reason?: string;
|
|
252
|
+
}): Promise<{
|
|
253
|
+
txid: string;
|
|
254
|
+
reason?: string;
|
|
255
|
+
evictedTransactions: number;
|
|
256
|
+
evictedOutputs: number;
|
|
257
|
+
}>;
|
|
258
|
+
/**
|
|
259
|
+
* Given a GASP request, create an initial response.
|
|
260
|
+
*
|
|
261
|
+
* This method processes an initial synchronization request by finding the relevant UTXOs for the given topic
|
|
262
|
+
* since the provided block height in the request. It constructs a response that includes a list of these UTXOs
|
|
263
|
+
* and the min block height from the initial request.
|
|
264
|
+
*
|
|
265
|
+
* @param initialRequest - The GASP initial request containing the version and the block height since the last sync.
|
|
266
|
+
* @param topic - The topic for which UTXOs are being requested.
|
|
267
|
+
* @returns A promise that resolves to a GASPInitialResponse containing the list of UTXOs and the provided min block height.
|
|
268
|
+
*/
|
|
269
|
+
provideForeignSyncResponse(initialRequest: GASPInitialRequest, topic: string): Promise<GASPInitialResponse>;
|
|
270
|
+
/**
|
|
271
|
+
* Provides a GASPNode for the given graphID, transaction ID, and output index.
|
|
272
|
+
*
|
|
273
|
+
* @param graphID - The identifier for the graph to which this node belongs (in the format txid.outputIndex).
|
|
274
|
+
* @param txid - The transaction ID for the requested output from somewhere within the graph's history.
|
|
275
|
+
* @param outputIndex - The index of the output in the transaction.
|
|
276
|
+
* @returns A promise that resolves to a GASPNode containing the raw transaction and other optional data.
|
|
277
|
+
* @throws An error if no output is found for the given transaction ID and output index.
|
|
278
|
+
*/
|
|
279
|
+
provideForeignGASPNode(graphID: string, txid: string, outputIndex: number): Promise<GASPNode>;
|
|
280
|
+
/**
|
|
281
|
+
* Traverse and return the history of a UTXO.
|
|
282
|
+
*
|
|
283
|
+
* This method traverses the history of a given Unspent Transaction Output (UTXO) and returns
|
|
284
|
+
* its historical data based on the provided history selector and current depth.
|
|
285
|
+
*
|
|
286
|
+
* @param output - The UTXO to traverse the history for.
|
|
287
|
+
* @param historySelector - Optionally directs the history traversal:
|
|
288
|
+
* - If a number, denotes how many previous spends (in terms of chain depth) to include.
|
|
289
|
+
* - If a function, accepts a BEEF-formatted transaction, an output index, and the current depth as parameters,
|
|
290
|
+
* returning a promise that resolves to a boolean indicating whether to include the output in the history.
|
|
291
|
+
* @param {number} [currentDepth=0] - The current depth of the traversal relative to the top-level UTXO.
|
|
292
|
+
*
|
|
293
|
+
* @returns {Promise<Output | undefined>} - A promise that resolves to the output history if found, or undefined if not.
|
|
294
|
+
*/
|
|
295
|
+
getUTXOHistory(output: Output, historySelector?: ((beef: number[], outputIndex: number, currentDepth: number) => Promise<boolean>) | number, currentDepth?: number, context?: UTXOHistoryHydrationContext): Promise<Output | undefined>;
|
|
296
|
+
/**
|
|
297
|
+
* Delete a UTXO and all stale consumed inputs.
|
|
298
|
+
* @param output - The UTXO to be deleted.
|
|
299
|
+
* @returns {Promise<void>} - A promise that resolves when the deletion process is complete.
|
|
300
|
+
*/
|
|
301
|
+
private deleteUTXODeep;
|
|
302
|
+
/**
|
|
303
|
+
* Given a new transaction proof (txid, proof),
|
|
304
|
+
* update tx.merklePath if appropriate,
|
|
305
|
+
* and if not, recurse through all input sourceTransactions.
|
|
306
|
+
*
|
|
307
|
+
* @param tx transaction which may benefit from new proof.
|
|
308
|
+
* @param txid BE hex string double hash of transaction proven by proof.
|
|
309
|
+
* @param proof for txid
|
|
310
|
+
*/
|
|
311
|
+
private updateInputProofs;
|
|
312
|
+
/**
|
|
313
|
+
* Recursively updates beefs (merkle proofs) of this output and its consumedBy lineage.
|
|
314
|
+
*
|
|
315
|
+
* @param output - An output derived from txid which may benefit from new proof.
|
|
316
|
+
* @param txid - The txid for which proof is a valid merkle path.
|
|
317
|
+
* @param proof - The merklePath proving txid is a mined transaction hash
|
|
318
|
+
*/
|
|
319
|
+
private updateMerkleProof;
|
|
320
|
+
/**
|
|
321
|
+
* Recursively prune UTXOs when an incoming Merkle Proof is received.
|
|
322
|
+
*
|
|
323
|
+
* @param txid - Transaction ID of the associated outputs to prune.
|
|
324
|
+
* @param proof - Merkle proof containing the Merkle path and other relevant data to verify the transaction.
|
|
325
|
+
* @param blockHeight - The block height associated with the incoming merkle proof.
|
|
326
|
+
*/
|
|
327
|
+
handleNewMerkleProof(txid: string, proof: MerklePath, blockHeight?: number): Promise<void>;
|
|
328
|
+
/**
|
|
329
|
+
* Find a list of supported topic managers
|
|
330
|
+
* @public
|
|
331
|
+
* @returns {Promise<Record<string, { name: string; shortDescription: string; iconURL?: string; version?: string; informationURL?: string; }>>} - Supported topic managers and their metadata
|
|
332
|
+
*/
|
|
333
|
+
listTopicManagers(): Promise<Record<string, {
|
|
334
|
+
name: string;
|
|
335
|
+
shortDescription: string;
|
|
336
|
+
iconURL?: string;
|
|
337
|
+
version?: string;
|
|
338
|
+
informationURL?: string;
|
|
339
|
+
}>>;
|
|
340
|
+
/**
|
|
341
|
+
* Find a list of supported lookup services
|
|
342
|
+
* @public
|
|
343
|
+
* @returns {Promise<Record<string, { name: string; shortDescription: string; iconURL?: string; version?: string; informationURL?: string; }>>} - Supported lookup services and their metadata
|
|
344
|
+
*/
|
|
345
|
+
listLookupServiceProviders(): Promise<Record<string, {
|
|
346
|
+
name: string;
|
|
347
|
+
shortDescription: string;
|
|
348
|
+
iconURL?: string;
|
|
349
|
+
version?: string;
|
|
350
|
+
informationURL?: string;
|
|
351
|
+
}>>;
|
|
352
|
+
/**
|
|
353
|
+
* Run a query to get the documentation for a particular topic manager
|
|
354
|
+
* @public
|
|
355
|
+
* @returns {Promise<string>} - the documentation for the topic manager
|
|
356
|
+
*/
|
|
357
|
+
getDocumentationForTopicManager(manager: any): Promise<string>;
|
|
358
|
+
/**
|
|
359
|
+
* Run a query to get the documentation for a particular lookup service
|
|
360
|
+
* @public
|
|
361
|
+
* @returns {Promise<string>} - the documentation for the lookup service
|
|
362
|
+
*/
|
|
363
|
+
getDocumentationForLookupServiceProvider(provider: any): Promise<string>;
|
|
364
|
+
/**
|
|
365
|
+
* Validates a URL to ensure it does not match disallowed patterns:
|
|
366
|
+
* - Contains "http:" protocol
|
|
367
|
+
* - Contains "localhost" (with or without a port)
|
|
368
|
+
* - 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)
|
|
369
|
+
* - Non-routable IPs like 127.x.x.x, 0.0.0.0, or IPv6 loopback (::1)
|
|
370
|
+
*
|
|
371
|
+
* @param url - The URL string to validate
|
|
372
|
+
* @returns {boolean} - Returns `false` if the URL violates any of the conditions `true` otherwise
|
|
373
|
+
*/
|
|
374
|
+
private isValidUrl;
|
|
375
|
+
}
|
|
376
|
+
export {};
|
|
377
|
+
//# 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,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;A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