@bsv/overlay-discovery-services 1.2.0 → 1.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.
@@ -1,6 +1,5 @@
1
- import { LookupService, LookupQuestion, LookupAnswer, LookupFormula } from '@bsv/overlay';
1
+ import { LookupService, LookupQuestion, LookupAnswer, LookupFormula, AdmissionMode, OutputAdmittedByTopic, OutputSpent, SpendNotificationMode } from '@bsv/overlay';
2
2
  import { SHIPStorage } from './SHIPStorage.js';
3
- import { Script } from '@bsv/sdk';
4
3
  /**
5
4
  * Implements the SHIP lookup service
6
5
  *
@@ -9,44 +8,14 @@ import { Script } from '@bsv/sdk';
9
8
  */
10
9
  export declare class SHIPLookupService implements LookupService {
11
10
  storage: SHIPStorage;
11
+ admissionMode: AdmissionMode;
12
+ spendNotificationMode: SpendNotificationMode;
12
13
  constructor(storage: SHIPStorage);
13
- /**
14
- * Handles the addition of a new output to the topic.
15
- * @param txid - The transaction ID containing the output.
16
- * @param outputIndex - The index of the output in the transaction.
17
- * @param outputScript - The script of the output to be processed.
18
- * @param topic - The topic associated with the output.
19
- */
20
- outputAdded?(txid: string, outputIndex: number, outputScript: Script, topic: string): Promise<void>;
21
- /**
22
- * Handles the spending of an output in the topic.
23
- * @param txid - The transaction ID of the spent output.
24
- * @param outputIndex - The index of the spent output.
25
- * @param topic - The topic associated with the spent output.
26
- */
27
- outputSpent?(txid: string, outputIndex: number, topic: string): Promise<void>;
28
- /**
29
- * Handles the deletion of an output in the topic.
30
- * @param txid - The transaction ID of the deleted output.
31
- * @param outputIndex - The index of the deleted output.
32
- * @param topic - The topic associated with the deleted output.
33
- */
34
- outputDeleted?(txid: string, outputIndex: number, topic: string): Promise<void>;
35
- /**
36
- * Answers a lookup query.
37
- * @param question - The lookup question to be answered.
38
- * @returns A promise that resolves to a lookup answer or formula.
39
- */
14
+ outputAdmittedByTopic(payload: OutputAdmittedByTopic): Promise<void>;
15
+ outputSpent(payload: OutputSpent): Promise<void>;
16
+ outputEvicted(txid: string, outputIndex: number): Promise<void>;
40
17
  lookup(question: LookupQuestion): Promise<LookupAnswer | LookupFormula>;
41
- /**
42
- * Returns documentation specific to this overlay lookup service.
43
- * @returns A promise that resolves to the documentation string.
44
- */
45
18
  getDocumentation(): Promise<string>;
46
- /**
47
- * Returns metadata associated with this lookup service.
48
- * @returns A promise that resolves to an object containing metadata.
49
- */
50
19
  getMetaData(): Promise<{
51
20
  name: string;
52
21
  shortDescription: string;
@@ -1 +1 @@
1
- {"version":3,"file":"SHIPLookupService.d.ts","sourceRoot":"","sources":["../../../../src/SHIP/SHIPLookupService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAmB,MAAM,UAAU,CAAA;AAIlD;;;;;GAKG;AACH,qBAAa,iBAAkB,YAAW,aAAa;IAClC,OAAO,EAAE,WAAW;gBAApB,OAAO,EAAE,WAAW;IAEvC;;;;;;OAMG;IACG,WAAW,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWzG;;;;;OAKG;IACG,WAAW,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKnF;;;;;OAKG;IACG,aAAa,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKrF;;;;OAIG;IACG,MAAM,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,GAAG,aAAa,CAAC;I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QAChB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,cAAc,CAAC,EAAE,MAAM,CAAA;KACxB,CAAC;CAMH"}
@@ -1,6 +1,5 @@
1
- import { LookupService, LookupQuestion, LookupAnswer, LookupFormula } from '@bsv/overlay';
1
+ import { LookupService, LookupQuestion, LookupAnswer, LookupFormula, AdmissionMode, OutputAdmittedByTopic, OutputSpent, SpendNotificationMode } from '@bsv/overlay';
2
2
  import { SLAPStorage } from './SLAPStorage.js';
3
- import { Script } from '@bsv/sdk';
4
3
  /**
5
4
  * Implements the SLAP lookup service
6
5
  *
@@ -10,44 +9,14 @@ import { Script } from '@bsv/sdk';
10
9
  */
11
10
  export declare class SLAPLookupService implements LookupService {
12
11
  storage: SLAPStorage;
12
+ admissionMode: AdmissionMode;
13
+ spendNotificationMode: SpendNotificationMode;
13
14
  constructor(storage: SLAPStorage);
14
- /**
15
- * Handles the addition of a new output to the topic.
16
- * @param txid - The transaction ID containing the output.
17
- * @param outputIndex - The index of the output in the transaction.
18
- * @param outputScript - The script of the output to be processed.
19
- * @param topic - The topic associated with the output.
20
- */
21
- outputAdded?(txid: string, outputIndex: number, outputScript: Script, topic: string): Promise<void>;
22
- /**
23
- * Handles the spending of an output in the topic.
24
- * @param txid - The transaction ID of the spent output.
25
- * @param outputIndex - The index of the spent output.
26
- * @param topic - The topic associated with the spent output.
27
- */
28
- outputSpent?(txid: string, outputIndex: number, topic: string): Promise<void>;
29
- /**
30
- * Handles the deletion of an output in the topic.
31
- * @param txid - The transaction ID of the deleted output.
32
- * @param outputIndex - The index of the deleted output.
33
- * @param topic - The topic associated with the deleted output.
34
- */
35
- outputDeleted?(txid: string, outputIndex: number, topic: string): Promise<void>;
36
- /**
37
- * Answers a lookup query.
38
- * @param question - The lookup question to be answered.
39
- * @returns A promise that resolves to a lookup answer or formula.
40
- */
15
+ outputAdmittedByTopic(payload: OutputAdmittedByTopic): Promise<void>;
16
+ outputSpent(payload: OutputSpent): Promise<void>;
17
+ outputEvicted(txid: string, outputIndex: number): Promise<void>;
41
18
  lookup(question: LookupQuestion): Promise<LookupAnswer | LookupFormula>;
42
- /**
43
- * Returns documentation specific to this overlay lookup service.
44
- * @returns A promise that resolves to the documentation string.
45
- */
46
19
  getDocumentation(): Promise<string>;
47
- /**
48
- * Returns metadata associated with this lookup service.
49
- * @returns A promise that resolves to an object containing metadata.
50
- */
51
20
  getMetaData(): Promise<{
52
21
  name: string;
53
22
  shortDescription: string;
@@ -1 +1 @@
1
- {"version":3,"file":"SLAPLookupService.d.ts","sourceRoot":"","sources":["../../../../src/SLAP/SLAPLookupService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAmB,MAAM,UAAU,CAAA;AAIlD;;;;;;GAMG;AACH,qBAAa,iBAAkB,YAAW,aAAa;IAClC,OAAO,EAAE,WAAW;gBAApB,OAAO,EAAE,WAAW;IAEvC;;;;;;OAMG;IACG,WAAW,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWzG;;;;;OAKG;IACG,WAAW,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKnF;;;;;OAKG;IACG,aAAa,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKrF;;;;OAIG;IACG,MAAM,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,GAAG,aAAa,CAAC;IAqC7E;;;OAGG;IACG,gBA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