@bsv/overlay 0.6.0 → 0.6.1

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,5 +1,9 @@
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
+
3
7
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
4
8
 
5
9
  ## Interfaces
@@ -65,48 +69,6 @@ export interface Advertiser {
65
69
 
66
70
  See also: [Advertisement](#interface-advertisement), [AdvertisementData](#interface-advertisementdata)
67
71
 
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
-
110
72
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
111
73
 
112
74
  ---
@@ -121,28 +83,6 @@ export interface AppliedTransaction {
121
83
  }
122
84
  ```
123
85
 
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
-
146
86
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
147
87
 
148
88
  ---
@@ -189,52 +129,6 @@ export interface LookupService {
189
129
 
190
130
  See also: [AdmissionMode](#type-admissionmode), [LookupFormula](#type-lookupformula), [LookupServiceMetaData](#interface-lookupservicemetadata), [OutputAdmittedByTopic](#type-outputadmittedbytopic), [OutputSpent](#type-outputspent), [SpendNotificationMode](#type-spendnotificationmode)
191
131
 
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
-
238
132
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
239
133
 
240
134
  ---
@@ -279,90 +173,6 @@ export interface Output {
279
173
  }
280
174
  ```
281
175
 
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
-
366
176
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
367
177
 
368
178
  ---
@@ -393,125 +203,6 @@ export interface Storage {
393
203
 
394
204
  See also: [AppliedTransaction](#interface-appliedtransaction), [Output](#interface-output)
395
205
 
396
- <details>
397
-
398
- <summary>Interface Storage Details</summary>
399
-
400
- #### Property deleteOutput
401
-
402
- Deletes an output from storage
403
-
404
- ```ts
405
- deleteOutput: (txid: string, outputIndex: number, topic: string) => Promise<void>
406
- ```
407
-
408
- #### Property doesAppliedTransactionExist
409
-
410
- Checks if a duplicate transaction exists
411
-
412
- ```ts
413
- doesAppliedTransactionExist: (tx: AppliedTransaction) => Promise<boolean>
414
- ```
415
- See also: [AppliedTransaction](#interface-appliedtransaction)
416
-
417
- #### Property findOutput
418
-
419
- Finds an output from storage
420
-
421
- ```ts
422
- findOutput: (txid: string, outputIndex: number, topic?: string, spent?: boolean, includeBEEF?: boolean) => Promise<Output | null>
423
- ```
424
- See also: [Output](#interface-output)
425
-
426
- #### Property findOutputsForTransaction
427
-
428
- Finds outputs with a matching transaction ID from storage
429
-
430
- ```ts
431
- findOutputsForTransaction: (txid: string, includeBEEF?: boolean) => Promise<Output[]>
432
- ```
433
- See also: [Output](#interface-output)
434
-
435
- #### Property findUTXOsForTopic
436
-
437
- Finds current UTXOs that have been admitted into a given topic
438
-
439
- ```ts
440
- findUTXOsForTopic: (topic: string, since?: number, limit?: number, includeBEEF?: boolean) => Promise<Output[]>
441
- ```
442
- See also: [Output](#interface-output)
443
-
444
- #### Property getLastInteraction
445
-
446
- Retrieves the last interaction score for a given host and topic
447
-
448
- ```ts
449
- getLastInteraction: (host: string, topic: string) => Promise<number>
450
- ```
451
-
452
- #### Property insertAppliedTransaction
453
-
454
- Inserts record of the applied transaction
455
-
456
- ```ts
457
- insertAppliedTransaction: (tx: AppliedTransaction) => Promise<void>
458
- ```
459
- See also: [AppliedTransaction](#interface-appliedtransaction)
460
-
461
- #### Property insertOutput
462
-
463
- Adds a new output to storage
464
-
465
- ```ts
466
- insertOutput: (utxo: Output) => Promise<void>
467
- ```
468
- See also: [Output](#interface-output)
469
-
470
- #### Property markUTXOAsSpent
471
-
472
- Updates a UTXO as spent
473
-
474
- ```ts
475
- markUTXOAsSpent: (txid: string, outputIndex: number, topic: string) => Promise<void>
476
- ```
477
-
478
- #### Property updateConsumedBy
479
-
480
- Updates which outputs are consumed by this output
481
-
482
- ```ts
483
- updateConsumedBy: (txid: string, outputIndex: number, topic: string, consumedBy: Array<{
484
- txid: string;
485
- outputIndex: number;
486
- }>) => Promise<void>
487
- ```
488
-
489
- #### Property updateLastInteraction
490
-
491
- Updates the last interaction score for a given host and topic
492
-
493
- ```ts
494
- updateLastInteraction: (host: string, topic: string, since: number) => Promise<void>
495
- ```
496
-
497
- #### Property updateOutputBlockHeight
498
-
499
- Updates the block height on an output
500
-
501
- ```ts
502
- updateOutputBlockHeight?: (txid: string, outputIndex: number, topic: string, blockHeight: number) => Promise<void>
503
- ```
504
-
505
- #### Property updateTransactionBEEF
506
-
507
- Updates the beef data for a transaction
508
-
509
- ```ts
510
- updateTransactionBEEF: (txid: string, beef: number[]) => Promise<void>
511
- ```
512
-
513
- </details>
514
-
515
206
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
516
207
 
517
208
  ---
@@ -537,55 +228,6 @@ export interface TopicManager {
537
228
  }
538
229
  ```
539
230
 
540
- <details>
541
-
542
- <summary>Interface TopicManager Details</summary>
543
-
544
- #### Property getDocumentation
545
-
546
- Returns a Markdown-formatted documentation string for the topic manager.
547
-
548
- ```ts
549
- getDocumentation: () => Promise<string>
550
- ```
551
-
552
- #### Property getMetaData
553
-
554
- Returns a metadata object that can be used to identify the topic manager.
555
-
556
- ```ts
557
- getMetaData: () => Promise<{
558
- name: string;
559
- shortDescription: string;
560
- iconURL?: string;
561
- version?: string;
562
- informationURL?: string;
563
- }>
564
- ```
565
-
566
- #### Property identifyAdmissibleOutputs
567
-
568
- Returns instructions that denote which outputs from the provided transaction to admit into the topic, and which previous coins should be retained.
569
- Accepts the transaction in BEEF format and an array of those input indices which spend previously-admitted outputs from the same topic.
570
- 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.
571
-
572
- ```ts
573
- identifyAdmissibleOutputs: (beef: number[], previousCoins: number[], offChainValues?: number[], mode?: "historical-tx" | "current-tx" | "historical-tx-no-spv") => Promise<AdmittanceInstructions>
574
- ```
575
-
576
- #### Property identifyNeededInputs
577
-
578
- Identifies and returns the inputs needed to anchor any topical outputs from this transaction to their associated previous history.
579
-
580
- ```ts
581
- identifyNeededInputs?: (beef: number[], offChainValues?: number[]) => Promise<Array<{
582
- txid: string;
583
- outputIndex: number;
584
- }>>
585
- ```
586
-
587
- </details>
588
-
589
231
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
590
232
 
591
233
  ---
@@ -1128,151 +770,19 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
1128
770
  ---
1129
771
  ## Functions
1130
772
 
1131
- | | |
1132
- | --- | --- |
1133
- | [down](#function-down) | [up](#function-up) |
1134
- | [down](#function-down) | [up](#function-up) |
1135
- | [down](#function-down) | [up](#function-up) |
1136
- | [down](#function-down) | [up](#function-up) |
1137
- | [down](#function-down) | [up](#function-up) |
1138
- | [down](#function-down) | [up](#function-up) |
1139
- | [down](#function-down) | [up](#function-up) |
1140
- | [down](#function-down) | [up](#function-up) |
1141
-
1142
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1143
-
1144
- ---
1145
-
1146
- ### Function: down
1147
-
1148
- ```ts
1149
- export async function down(knex: Knex): Promise<void>
1150
- ```
1151
-
1152
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1153
-
1154
- ---
1155
- ### Function: down
1156
-
1157
- ```ts
1158
- export async function down(knex: Knex): Promise<void>
1159
- ```
1160
-
1161
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1162
-
1163
- ---
1164
- ### Function: down
1165
-
1166
- ```ts
1167
- export async function down(knex: Knex): Promise<void>
1168
- ```
1169
-
1170
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1171
-
1172
- ---
1173
- ### Function: down
1174
-
1175
- ```ts
1176
- export async function down(knex: Knex): Promise<void>
1177
- ```
1178
-
1179
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1180
-
1181
- ---
1182
- ### Function: down
1183
-
1184
- ```ts
1185
- export async function down(knex: Knex): Promise<void>
1186
- ```
1187
-
1188
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1189
-
1190
- ---
1191
- ### Function: down
1192
-
1193
- ```ts
1194
- export async function down(knex: Knex): Promise<void>
1195
- ```
773
+ | |
774
+ | --- |
775
+ | [down](#function-down) |
776
+ | [up](#function-up) |
1196
777
 
1197
778
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1198
779
 
1199
780
  ---
1200
- ### Function: down
1201
-
1202
- ```ts
1203
- export async function down(knex: Knex): Promise<void>
1204
- ```
1205
-
1206
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1207
781
 
1208
- ---
1209
782
  ### Function: down
1210
783
 
1211
784
  ```ts
1212
- export async function down(knex: Knex): Promise<void>
1213
- ```
1214
-
1215
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1216
-
1217
- ---
1218
- ### Function: up
1219
-
1220
- ```ts
1221
- export async function up(knex: Knex): Promise<void>
1222
- ```
1223
-
1224
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1225
-
1226
- ---
1227
- ### Function: up
1228
-
1229
- ```ts
1230
- export async function up(knex: Knex): Promise<void>
1231
- ```
1232
-
1233
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1234
-
1235
- ---
1236
- ### Function: up
1237
-
1238
- ```ts
1239
- export async function up(knex: Knex): Promise<void>
1240
- ```
1241
-
1242
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1243
-
1244
- ---
1245
- ### Function: up
1246
-
1247
- ```ts
1248
- export async function up(knex: Knex): Promise<void>
1249
- ```
1250
-
1251
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1252
-
1253
- ---
1254
- ### Function: up
1255
-
1256
- ```ts
1257
- export async function up(knex: Knex): Promise<void>
1258
- ```
1259
-
1260
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1261
-
1262
- ---
1263
- ### Function: up
1264
-
1265
- ```ts
1266
- export async function up(knex: Knex): Promise<void>
1267
- ```
1268
-
1269
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1270
-
1271
- ---
1272
- ### Function: up
1273
-
1274
- ```ts
1275
- export async function up(knex: Knex): Promise<void>
785
+ export async function down(knex: Knex): Promise<void>
1276
786
  ```
1277
787
 
1278
788
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
@@ -1285,7 +795,7 @@ This query pattern is: WHERE topic = ? AND spent = false ORDER BY score
1285
795
  The composite index (topic, spent, score) enables efficient range scans.
1286
796
 
1287
797
  ```ts
1288
- export async function up(knex: Knex): Promise<void>
798
+ export async function up(knex: Knex): Promise<void>
1289
799
  ```
1290
800
 
1291
801
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
@@ -1429,3 +939,6 @@ export type SyncConfiguration = Record<string, string[] | "SHIP" | false>
1429
939
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types)
1430
940
 
1431
941
  ---
942
+
943
+ [🏠 Home](./README.md) | [📚 API](./API.md) | [💡 Concepts](./concepts/README.md) | [📖 Examples](./examples/README.md) | [⚙️ Internal](./internal/README.md)
944
+
package/docs/README.md CHANGED
@@ -2,7 +2,13 @@
2
2
 
3
3
  The documentation is split into various pages, each covering a set of related functionality. The pages are as follows:
4
4
 
5
+ ## Main Documentation
6
+
5
7
  - [API](./API.md) — How to interact with the Overlay Services Engine
6
- - [Concepts](./concepts) — High-level concepts
7
- - [Examples](./examples) — Guides, tutorials and examples of using the Engine
8
- - [Internal](./internal) — References for working with internal system components
8
+ - [Concepts](./concepts/README.md) — High-level concepts
9
+ - [Examples](./examples/README.md) — Guides, tutorials and examples of using the Engine
10
+ - [Internal](./internal/README.md) — References for working with internal system components
11
+
12
+ ---
13
+
14
+ [🏠 Home](./README.md) | [📚 API](./API.md) | [💡 Concepts](./concepts/README.md) | [📖 Examples](./examples/README.md) | [⚙️ Internal](./internal/README.md)