@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.
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/kvstore/GlobalKVStore.js +420 -0
- package/dist/cjs/src/kvstore/GlobalKVStore.js.map +1 -0
- package/dist/cjs/src/kvstore/LocalKVStore.js +6 -6
- package/dist/cjs/src/kvstore/LocalKVStore.js.map +1 -1
- package/dist/cjs/src/kvstore/index.js +3 -1
- package/dist/cjs/src/kvstore/index.js.map +1 -1
- package/dist/cjs/src/kvstore/kvStoreInterpreter.js +74 -0
- package/dist/cjs/src/kvstore/kvStoreInterpreter.js.map +1 -0
- package/dist/cjs/src/kvstore/types.js +11 -0
- package/dist/cjs/src/kvstore/types.js.map +1 -0
- package/dist/cjs/src/overlay-tools/Historian.js +153 -0
- package/dist/cjs/src/overlay-tools/Historian.js.map +1 -0
- package/dist/cjs/src/script/templates/PushDrop.js +2 -2
- package/dist/cjs/src/script/templates/PushDrop.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/kvstore/GlobalKVStore.js +416 -0
- package/dist/esm/src/kvstore/GlobalKVStore.js.map +1 -0
- package/dist/esm/src/kvstore/LocalKVStore.js +6 -6
- package/dist/esm/src/kvstore/LocalKVStore.js.map +1 -1
- package/dist/esm/src/kvstore/index.js +1 -0
- package/dist/esm/src/kvstore/index.js.map +1 -1
- package/dist/esm/src/kvstore/kvStoreInterpreter.js +47 -0
- package/dist/esm/src/kvstore/kvStoreInterpreter.js.map +1 -0
- package/dist/esm/src/kvstore/types.js +8 -0
- package/dist/esm/src/kvstore/types.js.map +1 -0
- package/dist/esm/src/overlay-tools/Historian.js +155 -0
- package/dist/esm/src/overlay-tools/Historian.js.map +1 -0
- package/dist/esm/src/script/templates/PushDrop.js +2 -2
- package/dist/esm/src/script/templates/PushDrop.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/kvstore/GlobalKVStore.d.ts +129 -0
- package/dist/types/src/kvstore/GlobalKVStore.d.ts.map +1 -0
- package/dist/types/src/kvstore/index.d.ts +1 -0
- package/dist/types/src/kvstore/index.d.ts.map +1 -1
- package/dist/types/src/kvstore/kvStoreInterpreter.d.ts +22 -0
- package/dist/types/src/kvstore/kvStoreInterpreter.d.ts.map +1 -0
- package/dist/types/src/kvstore/types.d.ts +106 -0
- package/dist/types/src/kvstore/types.d.ts.map +1 -0
- package/dist/types/src/overlay-tools/Historian.d.ts +92 -0
- package/dist/types/src/overlay-tools/Historian.d.ts.map +1 -0
- package/dist/types/src/script/templates/PushDrop.d.ts +6 -5
- package/dist/types/src/script/templates/PushDrop.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +3 -3
- package/dist/umd/bundle.js.map +1 -1
- package/docs/reference/compat.md +15 -27
- package/docs/reference/identity.md +12 -16
- package/docs/reference/kvstore.md +471 -4
- package/docs/reference/messages.md +0 -8
- package/docs/reference/overlay-tools.md +15 -22
- package/docs/reference/primitives.md +168 -168
- package/docs/reference/registry.md +9 -19
- package/docs/reference/script.md +35 -48
- package/docs/reference/storage.md +10 -14
- package/docs/reference/totp.md +5 -5
- package/docs/reference/transaction.md +117 -69
- package/docs/reference/wallet.md +131 -135
- package/package.json +1 -1
- package/src/kvstore/GlobalKVStore.ts +478 -0
- package/src/kvstore/LocalKVStore.ts +7 -7
- package/src/kvstore/__tests/GlobalKVStore.test.ts +965 -0
- package/src/kvstore/__tests/LocalKVStore.test.ts +72 -0
- package/src/kvstore/index.ts +1 -0
- package/src/kvstore/kvStoreInterpreter.ts +49 -0
- package/src/kvstore/types.ts +114 -0
- package/src/overlay-tools/Historian.ts +195 -0
- package/src/overlay-tools/__tests/Historian.test.ts +690 -0
- package/src/script/templates/PushDrop.ts +6 -5
package/docs/reference/compat.md
CHANGED
|
@@ -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](
|
|
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](
|
|
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](
|
|
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](
|
|
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](
|
|
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](
|
|
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](
|
|
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](
|
|
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](
|
|
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](
|
|
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](
|
|
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](
|
|
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: [
|
|
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: [
|
|
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: [
|
|
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](
|
|
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](
|
|
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](
|
|
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: [
|
|
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](
|
|
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](
|
|
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: [
|
|
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: [
|
|
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](
|
|
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](
|
|
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](
|
|
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](
|
|
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
|
|