@bsv/overlay 2.0.2 → 2.0.3

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/docs/API.md CHANGED
@@ -1,9 +1,5 @@
1
1
  # API
2
2
 
3
- [🏠 Home](./README.md) | [📚 API](./API.md) | [💡 Concepts](./concepts/README.md) | [📖 Examples](./examples/README.md) | [⚙️ Internal](./internal/README.md)
4
-
5
- ---
6
-
7
3
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
8
4
 
9
5
  ## Interfaces
@@ -69,6 +65,48 @@ export interface Advertiser {
69
65
 
70
66
  See also: [Advertisement](#interface-advertisement), [AdvertisementData](#interface-advertisementdata)
71
67
 
68
+ <details>
69
+
70
+ <summary>Interface Advertiser Details</summary>
71
+
72
+ #### Property createAdvertisements
73
+
74
+ Creates a new SHIP/SLAP advertisement for a given topic.
75
+
76
+ ```ts
77
+ createAdvertisements: (adsData: AdvertisementData[]) => Promise<TaggedBEEF>
78
+ ```
79
+ See also: [AdvertisementData](#interface-advertisementdata)
80
+
81
+ #### Property findAllAdvertisements
82
+
83
+ Finds all SHIP/SLAP advertisements.
84
+
85
+ ```ts
86
+ findAllAdvertisements: (protocol: "SHIP" | "SLAP") => Promise<Advertisement[]>
87
+ ```
88
+ See also: [Advertisement](#interface-advertisement)
89
+
90
+ #### Property parseAdvertisement
91
+
92
+ Parses an output script to extract an advertisement.
93
+
94
+ ```ts
95
+ parseAdvertisement: (outputScript: Script) => Advertisement
96
+ ```
97
+ See also: [Advertisement](#interface-advertisement)
98
+
99
+ #### Property revokeAdvertisements
100
+
101
+ Revokes an existing advertisement, either SHIP or SLAP.
102
+
103
+ ```ts
104
+ revokeAdvertisements: (advertisements: Advertisement[]) => Promise<TaggedBEEF>
105
+ ```
106
+ See also: [Advertisement](#interface-advertisement)
107
+
108
+ </details>
109
+
72
110
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
73
111
 
74
112
  ---
@@ -83,6 +121,28 @@ export interface AppliedTransaction {
83
121
  }
84
122
  ```
85
123
 
124
+ <details>
125
+
126
+ <summary>Interface AppliedTransaction Details</summary>
127
+
128
+ #### Property topic
129
+
130
+ Output index of the applied transaction
131
+
132
+ ```ts
133
+ topic: string
134
+ ```
135
+
136
+ #### Property txid
137
+
138
+ TXID of the applied transaction
139
+
140
+ ```ts
141
+ txid: string
142
+ ```
143
+
144
+ </details>
145
+
86
146
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
87
147
 
88
148
  ---
@@ -129,6 +189,52 @@ export interface LookupService {
129
189
 
130
190
  See also: [AdmissionMode](#type-admissionmode), [LookupFormula](#type-lookupformula), [LookupServiceMetaData](#interface-lookupservicemetadata), [OutputAdmittedByTopic](#type-outputadmittedbytopic), [OutputSpent](#type-outputspent), [SpendNotificationMode](#type-spendnotificationmode)
131
191
 
192
+ <details>
193
+
194
+ <summary>Interface LookupService Details</summary>
195
+
196
+ #### Property outputAdmittedByTopic
197
+
198
+ Invoked when a Topic Manager admits a new UTXO.
199
+ The payload shape depends on this.admissionMode.
200
+
201
+ ```ts
202
+ outputAdmittedByTopic: (payload: OutputAdmittedByTopic) => Promise<void> | void
203
+ ```
204
+ See also: [OutputAdmittedByTopic](#type-outputadmittedbytopic)
205
+
206
+ #### Property outputEvicted
207
+
208
+ LEGAL EVICTION:
209
+ Permanently remove the referenced UTXO from all indices maintained by the
210
+ Lookup Service. After eviction the service MUST NOT reference the output
211
+ in any future lookup answer.
212
+
213
+ ```ts
214
+ outputEvicted: (txid: string, outputIndex: number) => Promise<void> | void
215
+ ```
216
+
217
+ #### Property outputNoLongerRetainedInHistory
218
+
219
+ Called when a Topic Manager decides that **historical retention** of the
220
+ specified UTXO is no longer required.
221
+
222
+ ```ts
223
+ outputNoLongerRetainedInHistory?: (txid: string, outputIndex: number, topic: string) => Promise<void> | void
224
+ ```
225
+
226
+ #### Property outputSpent
227
+
228
+ Invoked when a previously-admitted UTXO is spent.
229
+ The payload shape depends on this.spendNotificationMode.
230
+
231
+ ```ts
232
+ outputSpent?: (payload: OutputSpent) => Promise<void> | void
233
+ ```
234
+ See also: [OutputSpent](#type-outputspent)
235
+
236
+ </details>
237
+
132
238
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
133
239
 
134
240
  ---
@@ -173,6 +279,90 @@ export interface Output {
173
279
  }
174
280
  ```
175
281
 
282
+ <details>
283
+
284
+ <summary>Interface Output Details</summary>
285
+
286
+ #### Property beef
287
+
288
+ The transaction data for the output
289
+
290
+ ```ts
291
+ beef?: number[]
292
+ ```
293
+
294
+ #### Property consumedBy
295
+
296
+ Outputs consuming this output
297
+
298
+ ```ts
299
+ consumedBy: Array<{
300
+ txid: string;
301
+ outputIndex: number;
302
+ }>
303
+ ```
304
+
305
+ #### Property outputIndex
306
+
307
+ index of the output
308
+
309
+ ```ts
310
+ outputIndex: number
311
+ ```
312
+
313
+ #### Property outputScript
314
+
315
+ script of the output
316
+
317
+ ```ts
318
+ outputScript: number[]
319
+ ```
320
+
321
+ #### Property outputsConsumed
322
+
323
+ Outputs consumed by the transaction associated with the output
324
+
325
+ ```ts
326
+ outputsConsumed: Array<{
327
+ txid: string;
328
+ outputIndex: number;
329
+ }>
330
+ ```
331
+
332
+ #### Property satoshis
333
+
334
+ number of satoshis in the output
335
+
336
+ ```ts
337
+ satoshis: number
338
+ ```
339
+
340
+ #### Property spent
341
+
342
+ Whether the output is spent
343
+
344
+ ```ts
345
+ spent: boolean
346
+ ```
347
+
348
+ #### Property topic
349
+
350
+ topic to which the output belongs
351
+
352
+ ```ts
353
+ topic: string
354
+ ```
355
+
356
+ #### Property txid
357
+
358
+ TXID of the output
359
+
360
+ ```ts
361
+ txid: string
362
+ ```
363
+
364
+ </details>
365
+
176
366
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
177
367
 
178
368
  ---
@@ -184,6 +374,10 @@ Defines the Storage Engine interface used internally by the Overlay Services Eng
184
374
  export interface Storage {
185
375
  insertOutput: (utxo: Output) => Promise<void>;
186
376
  findOutput: (txid: string, outputIndex: number, topic?: string, spent?: boolean, includeBEEF?: boolean) => Promise<Output | null>;
377
+ findOutputsByOutpoints?: (outpoints: Array<{
378
+ txid: string;
379
+ outputIndex: number;
380
+ }>, includeBEEF?: boolean) => Promise<Output[]>;
187
381
  findOutputsForTransaction: (txid: string, includeBEEF?: boolean) => Promise<Output[]>;
188
382
  findUTXOsForTopic: (topic: string, since?: number, limit?: number, includeBEEF?: boolean) => Promise<Output[]>;
189
383
  deleteOutput: (txid: string, outputIndex: number, topic: string) => Promise<void>;
@@ -203,6 +397,138 @@ export interface Storage {
203
397
 
204
398
  See also: [AppliedTransaction](#interface-appliedtransaction), [Output](#interface-output)
205
399
 
400
+ <details>
401
+
402
+ <summary>Interface Storage Details</summary>
403
+
404
+ #### Property deleteOutput
405
+
406
+ Deletes an output from storage
407
+
408
+ ```ts
409
+ deleteOutput: (txid: string, outputIndex: number, topic: string) => Promise<void>
410
+ ```
411
+
412
+ #### Property doesAppliedTransactionExist
413
+
414
+ Checks if a duplicate transaction exists
415
+
416
+ ```ts
417
+ doesAppliedTransactionExist: (tx: AppliedTransaction) => Promise<boolean>
418
+ ```
419
+ See also: [AppliedTransaction](#interface-appliedtransaction)
420
+
421
+ #### Property findOutput
422
+
423
+ Finds an output from storage
424
+
425
+ ```ts
426
+ findOutput: (txid: string, outputIndex: number, topic?: string, spent?: boolean, includeBEEF?: boolean) => Promise<Output | null>
427
+ ```
428
+ See also: [Output](#interface-output)
429
+
430
+ #### Property findOutputsByOutpoints
431
+
432
+ Finds multiple outputs from storage by txid/output index pairs.
433
+ Implementations can use this to collapse many point lookups into a single query.
434
+
435
+ ```ts
436
+ findOutputsByOutpoints?: (outpoints: Array<{
437
+ txid: string;
438
+ outputIndex: number;
439
+ }>, includeBEEF?: boolean) => Promise<Output[]>
440
+ ```
441
+ See also: [Output](#interface-output)
442
+
443
+ #### Property findOutputsForTransaction
444
+
445
+ Finds outputs with a matching transaction ID from storage
446
+
447
+ ```ts
448
+ findOutputsForTransaction: (txid: string, includeBEEF?: boolean) => Promise<Output[]>
449
+ ```
450
+ See also: [Output](#interface-output)
451
+
452
+ #### Property findUTXOsForTopic
453
+
454
+ Finds current UTXOs that have been admitted into a given topic
455
+
456
+ ```ts
457
+ findUTXOsForTopic: (topic: string, since?: number, limit?: number, includeBEEF?: boolean) => Promise<Output[]>
458
+ ```
459
+ See also: [Output](#interface-output)
460
+
461
+ #### Property getLastInteraction
462
+
463
+ Retrieves the last interaction score for a given host and topic
464
+
465
+ ```ts
466
+ getLastInteraction: (host: string, topic: string) => Promise<number>
467
+ ```
468
+
469
+ #### Property insertAppliedTransaction
470
+
471
+ Inserts record of the applied transaction
472
+
473
+ ```ts
474
+ insertAppliedTransaction: (tx: AppliedTransaction) => Promise<void>
475
+ ```
476
+ See also: [AppliedTransaction](#interface-appliedtransaction)
477
+
478
+ #### Property insertOutput
479
+
480
+ Adds a new output to storage
481
+
482
+ ```ts
483
+ insertOutput: (utxo: Output) => Promise<void>
484
+ ```
485
+ See also: [Output](#interface-output)
486
+
487
+ #### Property markUTXOAsSpent
488
+
489
+ Updates a UTXO as spent
490
+
491
+ ```ts
492
+ markUTXOAsSpent: (txid: string, outputIndex: number, topic: string) => Promise<void>
493
+ ```
494
+
495
+ #### Property updateConsumedBy
496
+
497
+ Updates which outputs are consumed by this output
498
+
499
+ ```ts
500
+ updateConsumedBy: (txid: string, outputIndex: number, topic: string, consumedBy: Array<{
501
+ txid: string;
502
+ outputIndex: number;
503
+ }>) => Promise<void>
504
+ ```
505
+
506
+ #### Property updateLastInteraction
507
+
508
+ Updates the last interaction score for a given host and topic
509
+
510
+ ```ts
511
+ updateLastInteraction: (host: string, topic: string, since: number) => Promise<void>
512
+ ```
513
+
514
+ #### Property updateOutputBlockHeight
515
+
516
+ Updates the block height on an output
517
+
518
+ ```ts
519
+ updateOutputBlockHeight?: (txid: string, outputIndex: number, topic: string, blockHeight: number) => Promise<void>
520
+ ```
521
+
522
+ #### Property updateTransactionBEEF
523
+
524
+ Updates the beef data for a transaction
525
+
526
+ ```ts
527
+ updateTransactionBEEF: (txid: string, beef: number[]) => Promise<void>
528
+ ```
529
+
530
+ </details>
531
+
206
532
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
207
533
 
208
534
  ---
@@ -228,6 +554,55 @@ export interface TopicManager {
228
554
  }
229
555
  ```
230
556
 
557
+ <details>
558
+
559
+ <summary>Interface TopicManager Details</summary>
560
+
561
+ #### Property getDocumentation
562
+
563
+ Returns a Markdown-formatted documentation string for the topic manager.
564
+
565
+ ```ts
566
+ getDocumentation: () => Promise<string>
567
+ ```
568
+
569
+ #### Property getMetaData
570
+
571
+ Returns a metadata object that can be used to identify the topic manager.
572
+
573
+ ```ts
574
+ getMetaData: () => Promise<{
575
+ name: string;
576
+ shortDescription: string;
577
+ iconURL?: string;
578
+ version?: string;
579
+ informationURL?: string;
580
+ }>
581
+ ```
582
+
583
+ #### Property identifyAdmissibleOutputs
584
+
585
+ Returns instructions that denote which outputs from the provided transaction to admit into the topic, and which previous coins should be retained.
586
+ Accepts the transaction in BEEF format and an array of those input indices which spend previously-admitted outputs from the same topic.
587
+ The transaction's BEEF structure will always contain the transactions associated with previous coins for reference (if any), regardless of whether the current transaction was directly proven.
588
+
589
+ ```ts
590
+ identifyAdmissibleOutputs: (beef: number[], previousCoins: number[], offChainValues?: number[], mode?: "historical-tx" | "current-tx" | "historical-tx-no-spv") => Promise<AdmittanceInstructions>
591
+ ```
592
+
593
+ #### Property identifyNeededInputs
594
+
595
+ Identifies and returns the inputs needed to anchor any topical outputs from this transaction to their associated previous history.
596
+
597
+ ```ts
598
+ identifyNeededInputs?: (beef: number[], offChainValues?: number[]) => Promise<Array<{
599
+ txid: string;
600
+ outputIndex: number;
601
+ }>>
602
+ ```
603
+
604
+ </details>
605
+
231
606
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
232
607
 
233
608
  ---
@@ -254,31 +629,31 @@ export class Engine {
254
629
  [key: string]: TopicManager;
255
630
  }, public lookupServices: {
256
631
  [key: string]: LookupService;
257
- }, public storage: Storage, public chainTracker: ChainTracker | "scripts only", public hostingURL?: string, public shipTrackers?: string[], public slapTrackers?: string[], public broadcaster?: Broadcaster, public advertiser?: Advertiser, public syncConfiguration?: SyncConfiguration, public logTime = false, public logPrefix = "[OVERLAY_ENGINE] ", public throwOnBroadcastFailure = false, public overlayBroadcastFacilitator: OverlayBroadcastFacilitator = new HTTPSOverlayBroadcastFacilitator(), public logger: typeof console = console, public suppressDefaultSyncAdvertisements = true)
258
- async submit(taggedBEEF: TaggedBEEF, onSteakReady?: (steak: STEAK) => void, mode: "historical-tx" | "current-tx" | "historical-tx-no-spv" = "current-tx", offChainValues?: number[]): Promise<STEAK>
259
- async lookup(lookupQuestion: LookupQuestion): Promise<LookupAnswer>
260
- async syncAdvertisements(): Promise<void>
261
- async startGASPSync(): Promise<void>
262
- async provideForeignSyncResponse(initialRequest: GASPInitialRequest, topic: string): Promise<GASPInitialResponse>
263
- async provideForeignGASPNode(graphID: string, txid: string, outputIndex: number): Promise<GASPNode>
264
- async getUTXOHistory(output: Output, historySelector?: ((beef: number[], outputIndex: number, currentDepth: number) => Promise<boolean>) | number, currentDepth = 0, context: UTXOHistoryHydrationContext = this.createUTXOHistoryHydrationContext()): Promise<Output | undefined>
265
- async handleNewMerkleProof(txid: string, proof: MerklePath, blockHeight?: number): Promise<void>
632
+ }, public storage: Storage, public chainTracker: ChainTracker | "scripts only", public hostingURL?: string, public shipTrackers?: string[], public slapTrackers?: string[], public broadcaster?: Broadcaster, public advertiser?: Advertiser, public syncConfiguration?: SyncConfiguration, public logTime = false, public logPrefix = "[OVERLAY_ENGINE] ", public throwOnBroadcastFailure = false, public overlayBroadcastFacilitator: OverlayBroadcastFacilitator = new HTTPSOverlayBroadcastFacilitator(), public logger: typeof console = console, public suppressDefaultSyncAdvertisements = true)
633
+ async submit(taggedBEEF: TaggedBEEF, onSteakReady?: (steak: STEAK) => void, mode: "historical-tx" | "current-tx" | "historical-tx-no-spv" = "current-tx", offChainValues?: number[]): Promise<STEAK>
634
+ async lookup(lookupQuestion: LookupQuestion): Promise<LookupAnswer>
635
+ async syncAdvertisements(): Promise<void>
636
+ async startGASPSync(): Promise<void>
637
+ async provideForeignSyncResponse(initialRequest: GASPInitialRequest, topic: string): Promise<GASPInitialResponse>
638
+ async provideForeignGASPNode(graphID: string, txid: string, outputIndex: number): Promise<GASPNode>
639
+ async getUTXOHistory(output: Output, historySelector?: ((beef: number[], outputIndex: number, currentDepth: number) => Promise<boolean>) | number, currentDepth = 0, context: UTXOHistoryHydrationContext = this.createUTXOHistoryHydrationContext()): Promise<Output | undefined>
640
+ async handleNewMerkleProof(txid: string, proof: MerklePath, blockHeight?: number): Promise<void>
266
641
  async listTopicManagers(): Promise<Record<string, {
267
642
  name: string;
268
643
  shortDescription: string;
269
644
  iconURL?: string;
270
645
  version?: string;
271
646
  informationURL?: string;
272
- }>>
647
+ }>>
273
648
  async listLookupServiceProviders(): Promise<Record<string, {
274
649
  name: string;
275
650
  shortDescription: string;
276
651
  iconURL?: string;
277
652
  version?: string;
278
653
  informationURL?: string;
279
- }>>
280
- async getDocumentationForTopicManager(manager: any): Promise<string>
281
- async getDocumentationForLookupServiceProvider(provider: any): Promise<string>
654
+ }>>
655
+ async getDocumentationForTopicManager(manager: any): Promise<string>
656
+ async getDocumentationForLookupServiceProvider(provider: any): Promise<string>
282
657
  }
283
658
  ```
284
659
 
@@ -297,7 +672,7 @@ constructor(public managers: {
297
672
  [key: string]: TopicManager;
298
673
  }, public lookupServices: {
299
674
  [key: string]: LookupService;
300
- }, public storage: Storage, public chainTracker: ChainTracker | "scripts only", public hostingURL?: string, public shipTrackers?: string[], public slapTrackers?: string[], public broadcaster?: Broadcaster, public advertiser?: Advertiser, public syncConfiguration?: SyncConfiguration, public logTime = false, public logPrefix = "[OVERLAY_ENGINE] ", public throwOnBroadcastFailure = false, public overlayBroadcastFacilitator: OverlayBroadcastFacilitator = new HTTPSOverlayBroadcastFacilitator(), public logger: typeof console = console, public suppressDefaultSyncAdvertisements = true)
675
+ }, public storage: Storage, public chainTracker: ChainTracker | "scripts only", public hostingURL?: string, public shipTrackers?: string[], public slapTrackers?: string[], public broadcaster?: Broadcaster, public advertiser?: Advertiser, public syncConfiguration?: SyncConfiguration, public logTime = false, public logPrefix = "[OVERLAY_ENGINE] ", public throwOnBroadcastFailure = false, public overlayBroadcastFacilitator: OverlayBroadcastFacilitator = new HTTPSOverlayBroadcastFacilitator(), public logger: typeof console = console, public suppressDefaultSyncAdvertisements = true)
301
676
  ```
302
677
  See also: [Advertiser](#interface-advertiser), [LookupService](#interface-lookupservice), [Storage](#interface-storage), [SyncConfiguration](#type-syncconfiguration), [TopicManager](#interface-topicmanager)
303
678
 
@@ -341,7 +716,7 @@ Argument Details
341
716
  Run a query to get the documentation for a particular lookup service
342
717
 
343
718
  ```ts
344
- async getDocumentationForLookupServiceProvider(provider: any): Promise<string>
719
+ async getDocumentationForLookupServiceProvider(provider: any): Promise<string>
345
720
  ```
346
721
 
347
722
  Returns
@@ -353,7 +728,7 @@ Returns
353
728
  Run a query to get the documentation for a particular topic manager
354
729
 
355
730
  ```ts
356
- async getDocumentationForTopicManager(manager: any): Promise<string>
731
+ async getDocumentationForTopicManager(manager: any): Promise<string>
357
732
  ```
358
733
 
359
734
  Returns
@@ -368,7 +743,7 @@ This method traverses the history of a given Unspent Transaction Output (UTXO) a
368
743
  its historical data based on the provided history selector and current depth.
369
744
 
370
745
  ```ts
371
- async getUTXOHistory(output: Output, historySelector?: ((beef: number[], outputIndex: number, currentDepth: number) => Promise<boolean>) | number, currentDepth = 0, context: UTXOHistoryHydrationContext = this.createUTXOHistoryHydrationContext()): Promise<Output | undefined>
746
+ async getUTXOHistory(output: Output, historySelector?: ((beef: number[], outputIndex: number, currentDepth: number) => Promise<boolean>) | number, currentDepth = 0, context: UTXOHistoryHydrationContext = this.createUTXOHistoryHydrationContext()): Promise<Output | undefined>
372
747
  ```
373
748
  See also: [Output](#interface-output)
374
749
 
@@ -393,7 +768,7 @@ returning a promise that resolves to a boolean indicating whether to include the
393
768
  Recursively prune UTXOs when an incoming Merkle Proof is received.
394
769
 
395
770
  ```ts
396
- async handleNewMerkleProof(txid: string, proof: MerklePath, blockHeight?: number): Promise<void>
771
+ async handleNewMerkleProof(txid: string, proof: MerklePath, blockHeight?: number): Promise<void>
397
772
  ```
398
773
 
399
774
  Argument Details
@@ -416,7 +791,7 @@ async listLookupServiceProviders(): Promise<Record<string, {
416
791
  iconURL?: string;
417
792
  version?: string;
418
793
  informationURL?: string;
419
- }>>
794
+ }>>
420
795
  ```
421
796
 
422
797
  Returns
@@ -434,7 +809,7 @@ async listTopicManagers(): Promise<Record<string, {
434
809
  iconURL?: string;
435
810
  version?: string;
436
811
  informationURL?: string;
437
- }>>
812
+ }>>
438
813
  ```
439
814
 
440
815
  Returns
@@ -446,7 +821,7 @@ Returns
446
821
  Submit a lookup question to the Overlay Services Engine, and receive back a Lookup Answer
447
822
 
448
823
  ```ts
449
- async lookup(lookupQuestion: LookupQuestion): Promise<LookupAnswer>
824
+ async lookup(lookupQuestion: LookupQuestion): Promise<LookupAnswer>
450
825
  ```
451
826
 
452
827
  Returns
@@ -463,7 +838,7 @@ Argument Details
463
838
  Provides a GASPNode for the given graphID, transaction ID, and output index.
464
839
 
465
840
  ```ts
466
- async provideForeignGASPNode(graphID: string, txid: string, outputIndex: number): Promise<GASPNode>
841
+ async provideForeignGASPNode(graphID: string, txid: string, outputIndex: number): Promise<GASPNode>
467
842
  ```
468
843
 
469
844
  Returns
@@ -492,7 +867,7 @@ since the provided block height in the request. It constructs a response that in
492
867
  and the min block height from the initial request.
493
868
 
494
869
  ```ts
495
- async provideForeignSyncResponse(initialRequest: GASPInitialRequest, topic: string): Promise<GASPInitialResponse>
870
+ async provideForeignSyncResponse(initialRequest: GASPInitialRequest, topic: string): Promise<GASPInitialResponse>
496
871
  ```
497
872
 
498
873
  Returns
@@ -513,7 +888,7 @@ associated with that topic. If the sync configuration is 'SHIP', it will sync to
513
888
  the topic.
514
889
 
515
890
  ```ts
516
- async startGASPSync(): Promise<void>
891
+ async startGASPSync(): Promise<void>
517
892
  ```
518
893
 
519
894
  Throws
@@ -525,7 +900,7 @@ Error if the overlay service engine is not configured for topical synchronizatio
525
900
  Submits a transaction for processing by Overlay Services.
526
901
 
527
902
  ```ts
528
- async submit(taggedBEEF: TaggedBEEF, onSteakReady?: (steak: STEAK) => void, mode: "historical-tx" | "current-tx" | "historical-tx-no-spv" = "current-tx", offChainValues?: number[]): Promise<STEAK>
903
+ async submit(taggedBEEF: TaggedBEEF, onSteakReady?: (steak: STEAK) => void, mode: "historical-tx" | "current-tx" | "historical-tx-no-spv" = "current-tx", offChainValues?: number[]): Promise<STEAK>
529
904
  ```
530
905
 
531
906
  Returns
@@ -563,7 +938,7 @@ The function uses the `Advertiser` methods to create or revoke advertisements an
563
938
  submitted to the SHIP/SLAP overlay networks using the engine's `submit()` method.
564
939
 
565
940
  ```ts
566
- async syncAdvertisements(): Promise<void>
941
+ async syncAdvertisements(): Promise<void>
567
942
  ```
568
943
 
569
944
  Returns
@@ -584,29 +959,33 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
584
959
  ```ts
585
960
  export class KnexStorage implements Storage {
586
961
  knex: Knex;
587
- constructor(knex: Knex)
588
- async findOutput(txid: string, outputIndex: number, topic?: string, spent?: boolean, includeBEEF: boolean = false): Promise<Output | null>
589
- async findOutputsForTransaction(txid: string, includeBEEF: boolean = false): Promise<Output[]>
590
- async findUTXOsForTopic(topic: string, since?: number, limit?: number, includeBEEF: boolean = false): Promise<Output[]>
591
- async deleteOutput(txid: string, outputIndex: number, _: string): Promise<void>
592
- async insertOutput(output: Output): Promise<void>
593
- async markUTXOAsSpent(txid: string, outputIndex: number, topic?: string): Promise<void>
962
+ constructor(knex: Knex)
963
+ async findOutput(txid: string, outputIndex: number, topic?: string, spent?: boolean, includeBEEF: boolean = false): Promise<Output | null>
964
+ async findOutputsByOutpoints(outpoints: Array<{
965
+ txid: string;
966
+ outputIndex: number;
967
+ }>, includeBEEF: boolean = false): Promise<Output[]>
968
+ async findOutputsForTransaction(txid: string, includeBEEF: boolean = false): Promise<Output[]>
969
+ async findUTXOsForTopic(topic: string, since?: number, limit?: number, includeBEEF: boolean = false): Promise<Output[]>
970
+ async deleteOutput(txid: string, outputIndex: number, _: string): Promise<void>
971
+ async insertOutput(output: Output): Promise<void>
972
+ async markUTXOAsSpent(txid: string, outputIndex: number, topic?: string): Promise<void>
594
973
  async updateConsumedBy(txid: string, outputIndex: number, topic: string, consumedBy: Array<{
595
974
  txid: string;
596
975
  outputIndex: number;
597
- }>): Promise<void>
598
- async updateTransactionBEEF(txid: string, beef: number[]): Promise<void>
599
- async updateOutputBlockHeight(txid: string, outputIndex: number, topic: string, blockHeight: number): Promise<void>
976
+ }>): Promise<void>
977
+ async updateTransactionBEEF(txid: string, beef: number[]): Promise<void>
978
+ async updateOutputBlockHeight(txid: string, outputIndex: number, topic: string, blockHeight: number): Promise<void>
600
979
  async insertAppliedTransaction(tx: {
601
980
  txid: string;
602
981
  topic: string;
603
- }): Promise<void>
982
+ }): Promise<void>
604
983
  async doesAppliedTransactionExist(tx: {
605
984
  txid: string;
606
985
  topic: string;
607
- }): Promise<boolean>
608
- async updateLastInteraction(host: string, topic: string, since: number): Promise<void>
609
- async getLastInteraction(host: string, topic: string): Promise<number>
986
+ }): Promise<boolean>
987
+ async updateLastInteraction(host: string, topic: string, since: number): Promise<void>
988
+ async getLastInteraction(host: string, topic: string): Promise<number>
610
989
  }
611
990
  ```
612
991
 
@@ -619,11 +998,11 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
619
998
 
620
999
  ```ts
621
1000
  export class OverlayGASPRemote implements GASPRemote {
622
- constructor(public endpointURL: string, public topic: string)
623
- async getInitialResponse(request: GASPInitialRequest): Promise<GASPInitialResponse>
624
- async requestNode(graphID: string, txid: string, outputIndex: number, metadata: boolean): Promise<GASPNode>
625
- async getInitialReply(response: GASPInitialResponse): Promise<GASPInitialReply>
626
- async submitNode(node: GASPNode): Promise<GASPNodeResponse | undefined>
1001
+ constructor(public endpointURL: string, public topic: string)
1002
+ async getInitialResponse(request: GASPInitialRequest): Promise<GASPInitialResponse>
1003
+ async requestNode(graphID: string, txid: string, outputIndex: number, metadata: boolean): Promise<GASPNode>
1004
+ async getInitialReply(response: GASPInitialResponse): Promise<GASPInitialReply>
1005
+ async submitNode(node: GASPNode): Promise<GASPNodeResponse | undefined>
627
1006
  }
628
1007
  ```
629
1008
 
@@ -636,7 +1015,7 @@ export class OverlayGASPRemote implements GASPRemote {
636
1015
  Given an outgoing initial request, sends the request to the foreign instance and obtains their initial response.
637
1016
 
638
1017
  ```ts
639
- async getInitialResponse(request: GASPInitialRequest): Promise<GASPInitialResponse>
1018
+ async getInitialResponse(request: GASPInitialRequest): Promise<GASPInitialResponse>
640
1019
  ```
641
1020
 
642
1021
  #### Method requestNode
@@ -644,7 +1023,7 @@ async getInitialResponse(request: GASPInitialRequest): Promise<GASPInitialRespon
644
1023
  Given an outgoing txid, outputIndex and optional metadata, request the associated GASP node from the foreign instance.
645
1024
 
646
1025
  ```ts
647
- async requestNode(graphID: string, txid: string, outputIndex: number, metadata: boolean): Promise<GASPNode>
1026
+ async requestNode(graphID: string, txid: string, outputIndex: number, metadata: boolean): Promise<GASPNode>
648
1027
  ```
649
1028
 
650
1029
  </details>
@@ -657,14 +1036,14 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
657
1036
  ```ts
658
1037
  export class OverlayGASPStorage implements GASPStorage {
659
1038
  readonly temporaryGraphNodeRefs: Record<string, GraphNode> = {};
660
- constructor(public topic: string, public engine: Engine, public maxNodesInGraph?: number)
661
- async findKnownUTXOs(since: number): Promise<GASPOutput[]>
662
- async hydrateGASPNode(graphID: string, txid: string, outputIndex: number, metadata: boolean): Promise<GASPNode>
663
- async findNeededInputs(tx: GASPNode): Promise<GASPNodeResponse | undefined>
664
- async appendToGraph(tx: GASPNode, spentBy?: string | undefined): Promise<void>
665
- async validateGraphAnchor(graphID: string): Promise<void>
666
- async discardGraph(graphID: string): Promise<void>
667
- async finalizeGraph(graphID: string): Promise<void>
1039
+ constructor(public topic: string, public engine: Engine, public maxNodesInGraph?: number)
1040
+ async findKnownUTXOs(since: number): Promise<GASPOutput[]>
1041
+ async hydrateGASPNode(graphID: string, txid: string, outputIndex: number, metadata: boolean): Promise<GASPNode>
1042
+ async findNeededInputs(tx: GASPNode): Promise<GASPNodeResponse | undefined>
1043
+ async appendToGraph(tx: GASPNode, spentBy?: string | undefined): Promise<void>
1044
+ async validateGraphAnchor(graphID: string): Promise<void>
1045
+ async discardGraph(graphID: string): Promise<void>
1046
+ async finalizeGraph(graphID: string): Promise<void>
668
1047
  }
669
1048
  ```
670
1049
 
@@ -679,7 +1058,7 @@ See also: [Engine](#class-engine), [GraphNode](#interface-graphnode)
679
1058
  Appends a new node to a temporary graph.
680
1059
 
681
1060
  ```ts
682
- async appendToGraph(tx: GASPNode, spentBy?: string | undefined): Promise<void>
1061
+ async appendToGraph(tx: GASPNode, spentBy?: string | undefined): Promise<void>
683
1062
  ```
684
1063
 
685
1064
  Argument Details
@@ -698,7 +1077,7 @@ If the node cannot be appended to the graph, either because the graph ID is for
698
1077
  Deletes all data associated with a temporary graph that has failed to sync, if the graph exists.
699
1078
 
700
1079
  ```ts
701
- async discardGraph(graphID: string): Promise<void>
1080
+ async discardGraph(graphID: string): Promise<void>
702
1081
  ```
703
1082
 
704
1083
  Argument Details
@@ -711,7 +1090,7 @@ Argument Details
711
1090
  Finalizes a graph, solidifying the new UTXO and its ancestors so that it will appear in the list of known UTXOs.
712
1091
 
713
1092
  ```ts
714
- async finalizeGraph(graphID: string): Promise<void>
1093
+ async finalizeGraph(graphID: string): Promise<void>
715
1094
  ```
716
1095
 
717
1096
  Argument Details
@@ -724,7 +1103,7 @@ Argument Details
724
1103
  For a given node, returns the inputs needed to complete the graph, including whether updated metadata is requested for those inputs.
725
1104
 
726
1105
  ```ts
727
- async findNeededInputs(tx: GASPNode): Promise<GASPNodeResponse | undefined>
1106
+ async findNeededInputs(tx: GASPNode): Promise<GASPNodeResponse | undefined>
728
1107
  ```
729
1108
 
730
1109
  Returns
@@ -741,7 +1120,7 @@ Argument Details
741
1120
  For a given txid and output index, returns the associated transaction, a merkle proof if the transaction is in a block, and metadata if if requested. If no metadata is requested, metadata hashes on inputs are not returned.
742
1121
 
743
1122
  ```ts
744
- async hydrateGASPNode(graphID: string, txid: string, outputIndex: number, metadata: boolean): Promise<GASPNode>
1123
+ async hydrateGASPNode(graphID: string, txid: string, outputIndex: number, metadata: boolean): Promise<GASPNode>
745
1124
  ```
746
1125
 
747
1126
  #### Method validateGraphAnchor
@@ -751,7 +1130,7 @@ Additionally, in a breadth-first manner (ensuring that all inputs for any given
751
1130
  while considering any coins which the Manager had previously indicated were either valid or invalid.
752
1131
 
753
1132
  ```ts
754
- async validateGraphAnchor(graphID: string): Promise<void>
1133
+ async validateGraphAnchor(graphID: string): Promise<void>
755
1134
  ```
756
1135
 
757
1136
  Argument Details
@@ -770,10 +1149,16 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
770
1149
  ---
771
1150
  ## Functions
772
1151
 
773
- | |
774
- | --- |
775
- | [down](#function-down) |
776
- | [up](#function-up) |
1152
+ | | |
1153
+ | --- | --- |
1154
+ | [down](#function-down) | [up](#function-up) |
1155
+ | [down](#function-down) | [up](#function-up) |
1156
+ | [down](#function-down) | [up](#function-up) |
1157
+ | [down](#function-down) | [up](#function-up) |
1158
+ | [down](#function-down) | [up](#function-up) |
1159
+ | [down](#function-down) | [up](#function-up) |
1160
+ | [down](#function-down) | [up](#function-up) |
1161
+ | [down](#function-down) | [up](#function-up) |
777
1162
 
778
1163
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
779
1164
 
@@ -787,6 +1172,132 @@ export async function down(knex: Knex): Promise<void>
787
1172
 
788
1173
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
789
1174
 
1175
+ ---
1176
+ ### Function: down
1177
+
1178
+ ```ts
1179
+ export async function down(knex: Knex): Promise<void>
1180
+ ```
1181
+
1182
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1183
+
1184
+ ---
1185
+ ### Function: down
1186
+
1187
+ ```ts
1188
+ export async function down(knex: Knex): Promise<void>
1189
+ ```
1190
+
1191
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1192
+
1193
+ ---
1194
+ ### Function: down
1195
+
1196
+ ```ts
1197
+ export async function down(knex: Knex): Promise<void>
1198
+ ```
1199
+
1200
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1201
+
1202
+ ---
1203
+ ### Function: down
1204
+
1205
+ ```ts
1206
+ export async function down(knex: Knex): Promise<void>
1207
+ ```
1208
+
1209
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1210
+
1211
+ ---
1212
+ ### Function: down
1213
+
1214
+ ```ts
1215
+ export async function down(knex: Knex): Promise<void>
1216
+ ```
1217
+
1218
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1219
+
1220
+ ---
1221
+ ### Function: down
1222
+
1223
+ ```ts
1224
+ export async function down(knex: Knex): Promise<void>
1225
+ ```
1226
+
1227
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1228
+
1229
+ ---
1230
+ ### Function: down
1231
+
1232
+ ```ts
1233
+ export async function down(knex: Knex): Promise<void>
1234
+ ```
1235
+
1236
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1237
+
1238
+ ---
1239
+ ### Function: up
1240
+
1241
+ ```ts
1242
+ export async function up(knex: Knex): Promise<void>
1243
+ ```
1244
+
1245
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1246
+
1247
+ ---
1248
+ ### Function: up
1249
+
1250
+ ```ts
1251
+ export async function up(knex: Knex): Promise<void>
1252
+ ```
1253
+
1254
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1255
+
1256
+ ---
1257
+ ### Function: up
1258
+
1259
+ ```ts
1260
+ export async function up(knex: Knex): Promise<void>
1261
+ ```
1262
+
1263
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1264
+
1265
+ ---
1266
+ ### Function: up
1267
+
1268
+ ```ts
1269
+ export async function up(knex: Knex): Promise<void>
1270
+ ```
1271
+
1272
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1273
+
1274
+ ---
1275
+ ### Function: up
1276
+
1277
+ ```ts
1278
+ export async function up(knex: Knex): Promise<void>
1279
+ ```
1280
+
1281
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1282
+
1283
+ ---
1284
+ ### Function: up
1285
+
1286
+ ```ts
1287
+ export async function up(knex: Knex): Promise<void>
1288
+ ```
1289
+
1290
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1291
+
1292
+ ---
1293
+ ### Function: up
1294
+
1295
+ ```ts
1296
+ export async function up(knex: Knex): Promise<void>
1297
+ ```
1298
+
1299
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1300
+
790
1301
  ---
791
1302
  ### Function: up
792
1303
 
@@ -939,6 +1450,3 @@ export type SyncConfiguration = Record<string, string[] | "SHIP" | false>
939
1450
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
940
1451
 
941
1452
  ---
942
-
943
- [🏠 Home](./README.md) | [📚 API](./API.md) | [💡 Concepts](./concepts/README.md) | [📖 Examples](./examples/README.md) | [⚙️ Internal](./internal/README.md)
944
-