@bsv/sdk 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/cjs/package.json +1 -1
  2. package/dist/cjs/src/kvstore/GlobalKVStore.js +420 -0
  3. package/dist/cjs/src/kvstore/GlobalKVStore.js.map +1 -0
  4. package/dist/cjs/src/kvstore/LocalKVStore.js +6 -6
  5. package/dist/cjs/src/kvstore/LocalKVStore.js.map +1 -1
  6. package/dist/cjs/src/kvstore/index.js +3 -1
  7. package/dist/cjs/src/kvstore/index.js.map +1 -1
  8. package/dist/cjs/src/kvstore/kvStoreInterpreter.js +74 -0
  9. package/dist/cjs/src/kvstore/kvStoreInterpreter.js.map +1 -0
  10. package/dist/cjs/src/kvstore/types.js +11 -0
  11. package/dist/cjs/src/kvstore/types.js.map +1 -0
  12. package/dist/cjs/src/overlay-tools/Historian.js +153 -0
  13. package/dist/cjs/src/overlay-tools/Historian.js.map +1 -0
  14. package/dist/cjs/src/script/templates/PushDrop.js +2 -2
  15. package/dist/cjs/src/script/templates/PushDrop.js.map +1 -1
  16. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  17. package/dist/esm/src/kvstore/GlobalKVStore.js +416 -0
  18. package/dist/esm/src/kvstore/GlobalKVStore.js.map +1 -0
  19. package/dist/esm/src/kvstore/LocalKVStore.js +6 -6
  20. package/dist/esm/src/kvstore/LocalKVStore.js.map +1 -1
  21. package/dist/esm/src/kvstore/index.js +1 -0
  22. package/dist/esm/src/kvstore/index.js.map +1 -1
  23. package/dist/esm/src/kvstore/kvStoreInterpreter.js +47 -0
  24. package/dist/esm/src/kvstore/kvStoreInterpreter.js.map +1 -0
  25. package/dist/esm/src/kvstore/types.js +8 -0
  26. package/dist/esm/src/kvstore/types.js.map +1 -0
  27. package/dist/esm/src/overlay-tools/Historian.js +155 -0
  28. package/dist/esm/src/overlay-tools/Historian.js.map +1 -0
  29. package/dist/esm/src/script/templates/PushDrop.js +2 -2
  30. package/dist/esm/src/script/templates/PushDrop.js.map +1 -1
  31. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  32. package/dist/types/src/kvstore/GlobalKVStore.d.ts +129 -0
  33. package/dist/types/src/kvstore/GlobalKVStore.d.ts.map +1 -0
  34. package/dist/types/src/kvstore/index.d.ts +1 -0
  35. package/dist/types/src/kvstore/index.d.ts.map +1 -1
  36. package/dist/types/src/kvstore/kvStoreInterpreter.d.ts +22 -0
  37. package/dist/types/src/kvstore/kvStoreInterpreter.d.ts.map +1 -0
  38. package/dist/types/src/kvstore/types.d.ts +106 -0
  39. package/dist/types/src/kvstore/types.d.ts.map +1 -0
  40. package/dist/types/src/overlay-tools/Historian.d.ts +92 -0
  41. package/dist/types/src/overlay-tools/Historian.d.ts.map +1 -0
  42. package/dist/types/src/script/templates/PushDrop.d.ts +6 -5
  43. package/dist/types/src/script/templates/PushDrop.d.ts.map +1 -1
  44. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  45. package/dist/umd/bundle.js +3 -3
  46. package/dist/umd/bundle.js.map +1 -1
  47. package/docs/reference/compat.md +15 -27
  48. package/docs/reference/identity.md +12 -16
  49. package/docs/reference/kvstore.md +471 -4
  50. package/docs/reference/messages.md +0 -8
  51. package/docs/reference/overlay-tools.md +15 -22
  52. package/docs/reference/primitives.md +168 -168
  53. package/docs/reference/registry.md +9 -19
  54. package/docs/reference/script.md +35 -48
  55. package/docs/reference/storage.md +10 -14
  56. package/docs/reference/totp.md +5 -5
  57. package/docs/reference/transaction.md +117 -69
  58. package/docs/reference/wallet.md +131 -135
  59. package/package.json +1 -1
  60. package/src/kvstore/GlobalKVStore.ts +478 -0
  61. package/src/kvstore/LocalKVStore.ts +7 -7
  62. package/src/kvstore/__tests/GlobalKVStore.test.ts +965 -0
  63. package/src/kvstore/__tests/LocalKVStore.test.ts +72 -0
  64. package/src/kvstore/index.ts +1 -0
  65. package/src/kvstore/kvStoreInterpreter.ts +49 -0
  66. package/src/kvstore/types.ts +114 -0
  67. package/src/overlay-tools/Historian.ts +195 -0
  68. package/src/overlay-tools/__tests/Historian.test.ts +690 -0
  69. package/src/script/templates/PushDrop.ts +6 -5
@@ -32,8 +32,6 @@ export default class ECIES {
32
32
  }
33
33
  ```
34
34
 
35
- See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
36
-
37
35
  #### Method bitcoreDecrypt
38
36
 
39
37
  Decrypts a message encrypted using the Bitcore variant of ECIES.
@@ -41,7 +39,6 @@ Decrypts a message encrypted using the Bitcore variant of ECIES.
41
39
  ```ts
42
40
  public static bitcoreDecrypt(encBuf: number[], toPrivateKey: PrivateKey): number[]
43
41
  ```
44
- See also: [PrivateKey](./primitives.md#class-privatekey)
45
42
 
46
43
  Returns
47
44
 
@@ -61,7 +58,6 @@ Encrypts a given message using the Bitcore variant of ECIES.
61
58
  ```ts
62
59
  public static bitcoreEncrypt(messageBuf: number[], toPublicKey: PublicKey, fromPrivateKey?: PrivateKey, ivBuf?: number[]): number[]
63
60
  ```
64
- See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
65
61
 
66
62
  Returns
67
63
 
@@ -85,7 +81,6 @@ Decrypts a message encrypted using the Electrum ECIES method.
85
81
  ```ts
86
82
  public static electrumDecrypt(encBuf: number[], toPrivateKey: PrivateKey, fromPublicKey?: PublicKey): number[]
87
83
  ```
88
- See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
89
84
 
90
85
  Returns
91
86
 
@@ -107,7 +102,6 @@ Encrypts a given message using the Electrum ECIES method.
107
102
  ```ts
108
103
  public static electrumEncrypt(messageBuf: number[], toPublicKey: PublicKey, fromPrivateKey?: PrivateKey, noKey = false): number[]
109
104
  ```
110
- See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
111
105
 
112
106
  Returns
113
107
 
@@ -136,7 +130,6 @@ public static ivkEkM(privKey: PrivateKey, pubKey: PublicKey): {
136
130
  kM: number[];
137
131
  }
138
132
  ```
139
- See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
140
133
 
141
134
  Returns
142
135
 
@@ -185,8 +178,6 @@ export default class HD {
185
178
  }
186
179
  ```
187
180
 
188
- See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
189
-
190
181
  #### Constructor
191
182
 
192
183
  Constructor for the BIP32 HD wallet.
@@ -195,7 +186,6 @@ Initializes an HD wallet with optional parameters for version bytes, depth, pare
195
186
  ```ts
196
187
  constructor(versionBytesNum?: number, depth?: number, parentFingerPrint?: number[], childIndex?: number, chainCode?: number[], privKey?: PrivateKey, pubKey?: PublicKey)
197
188
  ```
198
- See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
199
189
 
200
190
  Argument Details
201
191
 
@@ -222,7 +212,7 @@ The path specifies the hierarchy of the child key to be derived.
222
212
  ```ts
223
213
  public derive(path: string): HD
224
214
  ```
225
- See also: [HD](./compat.md#class-hd)
215
+ See also: [HD](#class-hd)
226
216
 
227
217
  Returns
228
218
 
@@ -241,7 +231,7 @@ This method generates either a private or public child key depending on the curr
241
231
  ```ts
242
232
  public deriveChild(i: number): HD
243
233
  ```
244
- See also: [HD](./compat.md#class-hd)
234
+ See also: [HD](#class-hd)
245
235
 
246
236
  Returns
247
237
 
@@ -260,7 +250,7 @@ Parses a binary buffer to set up the wallet's properties.
260
250
  ```ts
261
251
  public static fromBinary(buf: number[]): HD
262
252
  ```
263
- See also: [HD](./compat.md#class-hd)
253
+ See also: [HD](#class-hd)
264
254
 
265
255
  Returns
266
256
 
@@ -310,7 +300,7 @@ This method creates a root HD wallet with randomly generated private and public
310
300
  ```ts
311
301
  public static fromRandom(): HD
312
302
  ```
313
- See also: [HD](./compat.md#class-hd)
303
+ See also: [HD](#class-hd)
314
304
 
315
305
  Returns
316
306
 
@@ -324,7 +314,7 @@ This method generates keys and other properties from a given seed, conforming to
324
314
  ```ts
325
315
  public static fromSeed(bytes: number[]): HD
326
316
  ```
327
- See also: [HD](./compat.md#class-hd)
317
+ See also: [HD](#class-hd)
328
318
 
329
319
  Returns
330
320
 
@@ -361,7 +351,7 @@ This method decodes a provided string to set up the HD wallet's properties.
361
351
  ```ts
362
352
  public static fromString(str: string): HD
363
353
  ```
364
- See also: [HD](./compat.md#class-hd)
354
+ See also: [HD](#class-hd)
365
355
 
366
356
  Returns
367
357
 
@@ -424,7 +414,7 @@ This method strips away the private key information, leaving only the public par
424
414
  ```ts
425
415
  public toPublic(): HD
426
416
  ```
427
- See also: [HD](./compat.md#class-hd)
417
+ See also: [HD](#class-hd)
428
418
 
429
419
  Returns
430
420
 
@@ -477,7 +467,7 @@ export default class Mnemonic {
477
467
  }
478
468
  ```
479
469
 
480
- See also: [wordList](./compat.md#variable-wordlist)
470
+ See also: [wordList](#variable-wordlist)
481
471
 
482
472
  #### Constructor
483
473
 
@@ -486,7 +476,7 @@ Constructs a Mnemonic object.
486
476
  ```ts
487
477
  constructor(mnemonic?: string, seed?: number[], wordlist = wordList)
488
478
  ```
489
- See also: [wordList](./compat.md#variable-wordlist)
479
+ See also: [wordList](#variable-wordlist)
490
480
 
491
481
  Argument Details
492
482
 
@@ -584,7 +574,7 @@ Static method to create a Mnemonic instance from a given entropy.
584
574
  ```ts
585
575
  public static fromEntropy(buf: number[]): Mnemonic
586
576
  ```
587
- See also: [Mnemonic](./compat.md#class-mnemonic)
577
+ See also: [Mnemonic](#class-mnemonic)
588
578
 
589
579
  Returns
590
580
 
@@ -623,7 +613,7 @@ Static method to generate a Mnemonic instance with a random mnemonic.
623
613
  ```ts
624
614
  public static fromRandom(bits?: number): Mnemonic
625
615
  ```
626
- See also: [Mnemonic](./compat.md#class-mnemonic)
616
+ See also: [Mnemonic](#class-mnemonic)
627
617
 
628
618
  Returns
629
619
 
@@ -658,7 +648,7 @@ Static method to create a Mnemonic instance from a mnemonic string.
658
648
  ```ts
659
649
  public static fromString(str: string): Mnemonic
660
650
  ```
661
- See also: [Mnemonic](./compat.md#class-mnemonic)
651
+ See also: [Mnemonic](#class-mnemonic)
662
652
 
663
653
  Returns
664
654
 
@@ -805,7 +795,7 @@ export default function fromUtxo(utxo: jsonUtxo, unlockingScriptTemplate: {
805
795
  }): TransactionInput
806
796
  ```
807
797
 
808
- See also: [Transaction](./transaction.md#class-transaction), [TransactionInput](./transaction.md#interface-transactioninput), [UnlockingScript](./script.md#class-unlockingscript), [sign](./compat.md#variable-sign)
798
+ See also: [sign](#variable-sign)
809
799
 
810
800
  Argument Details
811
801
 
@@ -849,8 +839,6 @@ magicHash = (messageBuf: number[]): number[] => {
849
839
  }
850
840
  ```
851
841
 
852
- See also: [Writer](./primitives.md#class-writer), [hash256](./primitives.md#variable-hash256), [toArray](./primitives.md#variable-toarray)
853
-
854
842
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
855
843
 
856
844
  ---
@@ -869,7 +857,7 @@ sign = (message: number[], privateKey: PrivateKey, mode: "raw" | "base64" = "bas
869
857
  }
870
858
  ```
871
859
 
872
- See also: [BigNumber](./primitives.md#class-bignumber), [PrivateKey](./primitives.md#class-privatekey), [Signature](./primitives.md#class-signature), [magicHash](./compat.md#variable-magichash)
860
+ See also: [magicHash](#variable-magichash)
873
861
 
874
862
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
875
863
 
@@ -883,7 +871,7 @@ verify = (message: number[], sig: Signature, pubKey: PublicKey): boolean => {
883
871
  }
884
872
  ```
885
873
 
886
- See also: [BigNumber](./primitives.md#class-bignumber), [PublicKey](./primitives.md#class-publickey), [Signature](./primitives.md#class-signature), [magicHash](./compat.md#variable-magichash)
874
+ See also: [magicHash](#variable-magichash)
887
875
 
888
876
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
889
877
 
@@ -41,8 +41,6 @@ export interface IdentityClientOptions {
41
41
  }
42
42
  ```
43
43
 
44
- See also: [WalletProtocol](./wallet.md#type-walletprotocol)
45
-
46
44
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
47
45
 
48
46
  ---
@@ -68,7 +66,7 @@ export class ContactsManager {
68
66
  }
69
67
  ```
70
68
 
71
- See also: [Contact](./identity.md#type-contact), [DisplayableIdentity](./identity.md#interface-displayableidentity), [PubKeyHex](./wallet.md#type-pubkeyhex), [WalletInterface](./wallet.md#interface-walletinterface)
69
+ See also: [Contact](#type-contact), [DisplayableIdentity](#interface-displayableidentity)
72
70
 
73
71
  #### Method getContacts
74
72
 
@@ -77,7 +75,7 @@ Load all records from the contacts basket
77
75
  ```ts
78
76
  async getContacts(identityKey?: PubKeyHex, forceRefresh = false, limit = 1000): Promise<Contact[]>
79
77
  ```
80
- See also: [Contact](./identity.md#type-contact), [PubKeyHex](./wallet.md#type-pubkeyhex)
78
+ See also: [Contact](#type-contact)
81
79
 
82
80
  Returns
83
81
 
@@ -112,7 +110,7 @@ Save or update a Metanet contact
112
110
  ```ts
113
111
  async saveContact(contact: DisplayableIdentity, metadata?: Record<string, any>): Promise<void>
114
112
  ```
115
- See also: [DisplayableIdentity](./identity.md#interface-displayableidentity)
113
+ See also: [DisplayableIdentity](#interface-displayableidentity)
116
114
 
117
115
  Argument Details
118
116
 
@@ -141,7 +139,7 @@ export class IdentityClient {
141
139
  }
142
140
  ```
143
141
 
144
- See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [Contact](./identity.md#type-contact), [DEFAULT_IDENTITY_CLIENT_OPTIONS](./identity.md#variable-default_identity_client_options), [DiscoverByAttributesArgs](./wallet.md#interface-discoverbyattributesargs), [DiscoverByIdentityKeyArgs](./wallet.md#interface-discoverbyidentitykeyargs), [DisplayableIdentity](./identity.md#interface-displayableidentity), [IdentityCertificate](./wallet.md#interface-identitycertificate), [OriginatorDomainNameStringUnder250Bytes](./wallet.md#type-originatordomainnamestringunder250bytes), [PubKeyHex](./wallet.md#type-pubkeyhex), [WalletCertificate](./wallet.md#interface-walletcertificate), [WalletInterface](./wallet.md#interface-walletinterface)
142
+ See also: [Contact](#type-contact), [DEFAULT_IDENTITY_CLIENT_OPTIONS](#variable-default_identity_client_options), [DisplayableIdentity](#interface-displayableidentity)
145
143
 
146
144
  #### Method getContacts
147
145
 
@@ -153,7 +151,7 @@ Load all records from the contacts basket
153
151
  ```ts
154
152
  public async getContacts(identityKey?: PubKeyHex, forceRefresh = false, limit = 1000): Promise<Contact[]>
155
153
  ```
156
- See also: [Contact](./identity.md#type-contact), [PubKeyHex](./wallet.md#type-pubkeyhex)
154
+ See also: [Contact](#type-contact)
157
155
 
158
156
  Returns
159
157
 
@@ -177,7 +175,7 @@ Parse out identity and certifier attributes to display from an IdentityCertifica
177
175
  ```ts
178
176
  static parseIdentity(identityToParse: IdentityCertificate): DisplayableIdentity
179
177
  ```
180
- See also: [DisplayableIdentity](./identity.md#interface-displayableidentity), [IdentityCertificate](./wallet.md#interface-identitycertificate)
178
+ See also: [DisplayableIdentity](#interface-displayableidentity)
181
179
 
182
180
  Returns
183
181
 
@@ -196,7 +194,6 @@ The publicly revealed certificate is included in a blockchain transaction and br
196
194
  ```ts
197
195
  async publiclyRevealAttributes(certificate: WalletCertificate, fieldsToReveal: CertificateFieldNameUnder50Bytes[]): Promise<BroadcastResponse | BroadcastFailure>
198
196
  ```
199
- See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [WalletCertificate](./wallet.md#interface-walletcertificate)
200
197
 
201
198
  Returns
202
199
 
@@ -220,7 +217,6 @@ Remove a contact from the contacts basket
220
217
  ```ts
221
218
  public async removeContact(identityKey: PubKeyHex): Promise<void>
222
219
  ```
223
- See also: [PubKeyHex](./wallet.md#type-pubkeyhex)
224
220
 
225
221
  Argument Details
226
222
 
@@ -234,7 +230,7 @@ Resolves displayable identity certificates by specific identity attributes, issu
234
230
  ```ts
235
231
  async resolveByAttributes(args: DiscoverByAttributesArgs, overrideWithContacts = true): Promise<DisplayableIdentity[]>
236
232
  ```
237
- See also: [DiscoverByAttributesArgs](./wallet.md#interface-discoverbyattributesargs), [DisplayableIdentity](./identity.md#interface-displayableidentity)
233
+ See also: [DisplayableIdentity](#interface-displayableidentity)
238
234
 
239
235
  Returns
240
236
 
@@ -254,7 +250,7 @@ Resolves displayable identity certificates, issued to a given identity key by a
254
250
  ```ts
255
251
  async resolveByIdentityKey(args: DiscoverByIdentityKeyArgs, overrideWithContacts = true): Promise<DisplayableIdentity[]>
256
252
  ```
257
- See also: [DiscoverByIdentityKeyArgs](./wallet.md#interface-discoverbyidentitykeyargs), [DisplayableIdentity](./identity.md#interface-displayableidentity)
253
+ See also: [DisplayableIdentity](#interface-displayableidentity)
258
254
 
259
255
  Returns
260
256
 
@@ -274,7 +270,7 @@ Save or update a Metanet contact
274
270
  ```ts
275
271
  public async saveContact(contact: DisplayableIdentity, metadata?: Record<string, any>): Promise<void>
276
272
  ```
277
- See also: [DisplayableIdentity](./identity.md#interface-displayableidentity)
273
+ See also: [DisplayableIdentity](#interface-displayableidentity)
278
274
 
279
275
  Argument Details
280
276
 
@@ -298,7 +294,7 @@ export type Contact = DisplayableIdentity & {
298
294
  }
299
295
  ```
300
296
 
301
- See also: [DisplayableIdentity](./identity.md#interface-displayableidentity)
297
+ See also: [DisplayableIdentity](#interface-displayableidentity)
302
298
 
303
299
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
304
300
 
@@ -328,7 +324,7 @@ DEFAULT_IDENTITY_CLIENT_OPTIONS: IdentityClientOptions = {
328
324
  }
329
325
  ```
330
326
 
331
- See also: [IdentityClientOptions](./identity.md#interface-identityclientoptions)
327
+ See also: [IdentityClientOptions](#interface-identityclientoptions)
332
328
 
333
329
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
334
330
 
@@ -366,7 +362,7 @@ defaultIdentity: DisplayableIdentity = {
366
362
  }
367
363
  ```
368
364
 
369
- See also: [DisplayableIdentity](./identity.md#interface-displayableidentity)
365
+ See also: [DisplayableIdentity](#interface-displayableidentity)
370
366
 
371
367
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
372
368