@bsv/sdk 1.8.2 → 1.8.4
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/overlay-tools/LookupResolver.js +10 -1
- package/dist/cjs/src/overlay-tools/LookupResolver.js.map +1 -1
- package/dist/cjs/src/primitives/Random.js +78 -19
- package/dist/cjs/src/primitives/Random.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/overlay-tools/LookupResolver.js +10 -1
- package/dist/esm/src/overlay-tools/LookupResolver.js.map +1 -1
- package/dist/esm/src/primitives/Random.js +78 -19
- package/dist/esm/src/primitives/Random.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/overlay-tools/LookupResolver.d.ts +1 -0
- package/dist/types/src/overlay-tools/LookupResolver.d.ts.map +1 -1
- package/dist/types/src/primitives/Random.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 +27 -15
- package/docs/reference/identity.md +16 -12
- package/docs/reference/kvstore.md +25 -7
- package/docs/reference/messages.md +8 -0
- package/docs/reference/overlay-tools.md +22 -15
- package/docs/reference/primitives.md +168 -168
- package/docs/reference/registry.md +19 -9
- package/docs/reference/script.md +32 -31
- package/docs/reference/storage.md +14 -10
- package/docs/reference/totp.md +5 -5
- package/docs/reference/transaction.md +70 -67
- package/docs/reference/wallet.md +135 -131
- package/package.json +1 -1
- package/src/overlay-tools/LookupResolver.ts +11 -1
- package/src/primitives/Random.ts +86 -17
- package/src/primitives/__tests/Random.test.ts +21 -0
package/docs/reference/compat.md
CHANGED
|
@@ -32,6 +32,8 @@ export default class ECIES {
|
|
|
32
32
|
}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
|
|
36
|
+
|
|
35
37
|
#### Method bitcoreDecrypt
|
|
36
38
|
|
|
37
39
|
Decrypts a message encrypted using the Bitcore variant of ECIES.
|
|
@@ -39,6 +41,7 @@ Decrypts a message encrypted using the Bitcore variant of ECIES.
|
|
|
39
41
|
```ts
|
|
40
42
|
public static bitcoreDecrypt(encBuf: number[], toPrivateKey: PrivateKey): number[]
|
|
41
43
|
```
|
|
44
|
+
See also: [PrivateKey](./primitives.md#class-privatekey)
|
|
42
45
|
|
|
43
46
|
Returns
|
|
44
47
|
|
|
@@ -58,6 +61,7 @@ Encrypts a given message using the Bitcore variant of ECIES.
|
|
|
58
61
|
```ts
|
|
59
62
|
public static bitcoreEncrypt(messageBuf: number[], toPublicKey: PublicKey, fromPrivateKey?: PrivateKey, ivBuf?: number[]): number[]
|
|
60
63
|
```
|
|
64
|
+
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
|
|
61
65
|
|
|
62
66
|
Returns
|
|
63
67
|
|
|
@@ -81,6 +85,7 @@ Decrypts a message encrypted using the Electrum ECIES method.
|
|
|
81
85
|
```ts
|
|
82
86
|
public static electrumDecrypt(encBuf: number[], toPrivateKey: PrivateKey, fromPublicKey?: PublicKey): number[]
|
|
83
87
|
```
|
|
88
|
+
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
|
|
84
89
|
|
|
85
90
|
Returns
|
|
86
91
|
|
|
@@ -102,6 +107,7 @@ Encrypts a given message using the Electrum ECIES method.
|
|
|
102
107
|
```ts
|
|
103
108
|
public static electrumEncrypt(messageBuf: number[], toPublicKey: PublicKey, fromPrivateKey?: PrivateKey, noKey = false): number[]
|
|
104
109
|
```
|
|
110
|
+
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
|
|
105
111
|
|
|
106
112
|
Returns
|
|
107
113
|
|
|
@@ -130,6 +136,7 @@ public static ivkEkM(privKey: PrivateKey, pubKey: PublicKey): {
|
|
|
130
136
|
kM: number[];
|
|
131
137
|
}
|
|
132
138
|
```
|
|
139
|
+
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
|
|
133
140
|
|
|
134
141
|
Returns
|
|
135
142
|
|
|
@@ -178,6 +185,8 @@ export default class HD {
|
|
|
178
185
|
}
|
|
179
186
|
```
|
|
180
187
|
|
|
188
|
+
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
|
|
189
|
+
|
|
181
190
|
#### Constructor
|
|
182
191
|
|
|
183
192
|
Constructor for the BIP32 HD wallet.
|
|
@@ -186,6 +195,7 @@ Initializes an HD wallet with optional parameters for version bytes, depth, pare
|
|
|
186
195
|
```ts
|
|
187
196
|
constructor(versionBytesNum?: number, depth?: number, parentFingerPrint?: number[], childIndex?: number, chainCode?: number[], privKey?: PrivateKey, pubKey?: PublicKey)
|
|
188
197
|
```
|
|
198
|
+
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
|
|
189
199
|
|
|
190
200
|
Argument Details
|
|
191
201
|
|
|
@@ -212,7 +222,7 @@ The path specifies the hierarchy of the child key to be derived.
|
|
|
212
222
|
```ts
|
|
213
223
|
public derive(path: string): HD
|
|
214
224
|
```
|
|
215
|
-
See also: [HD](#class-hd)
|
|
225
|
+
See also: [HD](./compat.md#class-hd)
|
|
216
226
|
|
|
217
227
|
Returns
|
|
218
228
|
|
|
@@ -231,7 +241,7 @@ This method generates either a private or public child key depending on the curr
|
|
|
231
241
|
```ts
|
|
232
242
|
public deriveChild(i: number): HD
|
|
233
243
|
```
|
|
234
|
-
See also: [HD](#class-hd)
|
|
244
|
+
See also: [HD](./compat.md#class-hd)
|
|
235
245
|
|
|
236
246
|
Returns
|
|
237
247
|
|
|
@@ -250,7 +260,7 @@ Parses a binary buffer to set up the wallet's properties.
|
|
|
250
260
|
```ts
|
|
251
261
|
public static fromBinary(buf: number[]): HD
|
|
252
262
|
```
|
|
253
|
-
See also: [HD](#class-hd)
|
|
263
|
+
See also: [HD](./compat.md#class-hd)
|
|
254
264
|
|
|
255
265
|
Returns
|
|
256
266
|
|
|
@@ -300,7 +310,7 @@ This method creates a root HD wallet with randomly generated private and public
|
|
|
300
310
|
```ts
|
|
301
311
|
public static fromRandom(): HD
|
|
302
312
|
```
|
|
303
|
-
See also: [HD](#class-hd)
|
|
313
|
+
See also: [HD](./compat.md#class-hd)
|
|
304
314
|
|
|
305
315
|
Returns
|
|
306
316
|
|
|
@@ -314,7 +324,7 @@ This method generates keys and other properties from a given seed, conforming to
|
|
|
314
324
|
```ts
|
|
315
325
|
public static fromSeed(bytes: number[]): HD
|
|
316
326
|
```
|
|
317
|
-
See also: [HD](#class-hd)
|
|
327
|
+
See also: [HD](./compat.md#class-hd)
|
|
318
328
|
|
|
319
329
|
Returns
|
|
320
330
|
|
|
@@ -351,7 +361,7 @@ This method decodes a provided string to set up the HD wallet's properties.
|
|
|
351
361
|
```ts
|
|
352
362
|
public static fromString(str: string): HD
|
|
353
363
|
```
|
|
354
|
-
See also: [HD](#class-hd)
|
|
364
|
+
See also: [HD](./compat.md#class-hd)
|
|
355
365
|
|
|
356
366
|
Returns
|
|
357
367
|
|
|
@@ -414,7 +424,7 @@ This method strips away the private key information, leaving only the public par
|
|
|
414
424
|
```ts
|
|
415
425
|
public toPublic(): HD
|
|
416
426
|
```
|
|
417
|
-
See also: [HD](#class-hd)
|
|
427
|
+
See also: [HD](./compat.md#class-hd)
|
|
418
428
|
|
|
419
429
|
Returns
|
|
420
430
|
|
|
@@ -467,7 +477,7 @@ export default class Mnemonic {
|
|
|
467
477
|
}
|
|
468
478
|
```
|
|
469
479
|
|
|
470
|
-
See also: [wordList](#variable-wordlist)
|
|
480
|
+
See also: [wordList](./compat.md#variable-wordlist)
|
|
471
481
|
|
|
472
482
|
#### Constructor
|
|
473
483
|
|
|
@@ -476,7 +486,7 @@ Constructs a Mnemonic object.
|
|
|
476
486
|
```ts
|
|
477
487
|
constructor(mnemonic?: string, seed?: number[], wordlist = wordList)
|
|
478
488
|
```
|
|
479
|
-
See also: [wordList](#variable-wordlist)
|
|
489
|
+
See also: [wordList](./compat.md#variable-wordlist)
|
|
480
490
|
|
|
481
491
|
Argument Details
|
|
482
492
|
|
|
@@ -574,7 +584,7 @@ Static method to create a Mnemonic instance from a given entropy.
|
|
|
574
584
|
```ts
|
|
575
585
|
public static fromEntropy(buf: number[]): Mnemonic
|
|
576
586
|
```
|
|
577
|
-
See also: [Mnemonic](#class-mnemonic)
|
|
587
|
+
See also: [Mnemonic](./compat.md#class-mnemonic)
|
|
578
588
|
|
|
579
589
|
Returns
|
|
580
590
|
|
|
@@ -613,7 +623,7 @@ Static method to generate a Mnemonic instance with a random mnemonic.
|
|
|
613
623
|
```ts
|
|
614
624
|
public static fromRandom(bits?: number): Mnemonic
|
|
615
625
|
```
|
|
616
|
-
See also: [Mnemonic](#class-mnemonic)
|
|
626
|
+
See also: [Mnemonic](./compat.md#class-mnemonic)
|
|
617
627
|
|
|
618
628
|
Returns
|
|
619
629
|
|
|
@@ -648,7 +658,7 @@ Static method to create a Mnemonic instance from a mnemonic string.
|
|
|
648
658
|
```ts
|
|
649
659
|
public static fromString(str: string): Mnemonic
|
|
650
660
|
```
|
|
651
|
-
See also: [Mnemonic](#class-mnemonic)
|
|
661
|
+
See also: [Mnemonic](./compat.md#class-mnemonic)
|
|
652
662
|
|
|
653
663
|
Returns
|
|
654
664
|
|
|
@@ -795,7 +805,7 @@ export default function fromUtxo(utxo: jsonUtxo, unlockingScriptTemplate: {
|
|
|
795
805
|
}): TransactionInput
|
|
796
806
|
```
|
|
797
807
|
|
|
798
|
-
See also: [sign](#variable-sign)
|
|
808
|
+
See also: [Transaction](./transaction.md#class-transaction), [TransactionInput](./transaction.md#interface-transactioninput), [UnlockingScript](./script.md#class-unlockingscript), [sign](./compat.md#variable-sign)
|
|
799
809
|
|
|
800
810
|
Argument Details
|
|
801
811
|
|
|
@@ -839,6 +849,8 @@ magicHash = (messageBuf: number[]): number[] => {
|
|
|
839
849
|
}
|
|
840
850
|
```
|
|
841
851
|
|
|
852
|
+
See also: [Writer](./primitives.md#class-writer), [hash256](./primitives.md#variable-hash256), [toArray](./primitives.md#variable-toarray)
|
|
853
|
+
|
|
842
854
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
843
855
|
|
|
844
856
|
---
|
|
@@ -857,7 +869,7 @@ sign = (message: number[], privateKey: PrivateKey, mode: "raw" | "base64" = "bas
|
|
|
857
869
|
}
|
|
858
870
|
```
|
|
859
871
|
|
|
860
|
-
See also: [magicHash](#variable-magichash)
|
|
872
|
+
See also: [BigNumber](./primitives.md#class-bignumber), [PrivateKey](./primitives.md#class-privatekey), [Signature](./primitives.md#class-signature), [magicHash](./compat.md#variable-magichash)
|
|
861
873
|
|
|
862
874
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
863
875
|
|
|
@@ -871,7 +883,7 @@ verify = (message: number[], sig: Signature, pubKey: PublicKey): boolean => {
|
|
|
871
883
|
}
|
|
872
884
|
```
|
|
873
885
|
|
|
874
|
-
See also: [magicHash](#variable-magichash)
|
|
886
|
+
See also: [BigNumber](./primitives.md#class-bignumber), [PublicKey](./primitives.md#class-publickey), [Signature](./primitives.md#class-signature), [magicHash](./compat.md#variable-magichash)
|
|
875
887
|
|
|
876
888
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
877
889
|
|
|
@@ -41,6 +41,8 @@ export interface IdentityClientOptions {
|
|
|
41
41
|
}
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
See also: [WalletProtocol](./wallet.md#type-walletprotocol)
|
|
45
|
+
|
|
44
46
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
45
47
|
|
|
46
48
|
---
|
|
@@ -66,7 +68,7 @@ export class ContactsManager {
|
|
|
66
68
|
}
|
|
67
69
|
```
|
|
68
70
|
|
|
69
|
-
See also: [Contact](#type-contact), [DisplayableIdentity](#interface-displayableidentity)
|
|
71
|
+
See also: [Contact](./identity.md#type-contact), [DisplayableIdentity](./identity.md#interface-displayableidentity), [PubKeyHex](./wallet.md#type-pubkeyhex), [WalletInterface](./wallet.md#interface-walletinterface)
|
|
70
72
|
|
|
71
73
|
#### Method getContacts
|
|
72
74
|
|
|
@@ -75,7 +77,7 @@ Load all records from the contacts basket
|
|
|
75
77
|
```ts
|
|
76
78
|
async getContacts(identityKey?: PubKeyHex, forceRefresh = false, limit = 1000): Promise<Contact[]>
|
|
77
79
|
```
|
|
78
|
-
See also: [Contact](#type-contact)
|
|
80
|
+
See also: [Contact](./identity.md#type-contact), [PubKeyHex](./wallet.md#type-pubkeyhex)
|
|
79
81
|
|
|
80
82
|
Returns
|
|
81
83
|
|
|
@@ -110,7 +112,7 @@ Save or update a Metanet contact
|
|
|
110
112
|
```ts
|
|
111
113
|
async saveContact(contact: DisplayableIdentity, metadata?: Record<string, any>): Promise<void>
|
|
112
114
|
```
|
|
113
|
-
See also: [DisplayableIdentity](#interface-displayableidentity)
|
|
115
|
+
See also: [DisplayableIdentity](./identity.md#interface-displayableidentity)
|
|
114
116
|
|
|
115
117
|
Argument Details
|
|
116
118
|
|
|
@@ -139,7 +141,7 @@ export class IdentityClient {
|
|
|
139
141
|
}
|
|
140
142
|
```
|
|
141
143
|
|
|
142
|
-
See also: [Contact](#type-contact), [DEFAULT_IDENTITY_CLIENT_OPTIONS](#variable-default_identity_client_options), [DisplayableIdentity](#interface-displayableidentity)
|
|
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)
|
|
143
145
|
|
|
144
146
|
#### Method getContacts
|
|
145
147
|
|
|
@@ -151,7 +153,7 @@ Load all records from the contacts basket
|
|
|
151
153
|
```ts
|
|
152
154
|
public async getContacts(identityKey?: PubKeyHex, forceRefresh = false, limit = 1000): Promise<Contact[]>
|
|
153
155
|
```
|
|
154
|
-
See also: [Contact](#type-contact)
|
|
156
|
+
See also: [Contact](./identity.md#type-contact), [PubKeyHex](./wallet.md#type-pubkeyhex)
|
|
155
157
|
|
|
156
158
|
Returns
|
|
157
159
|
|
|
@@ -175,7 +177,7 @@ Parse out identity and certifier attributes to display from an IdentityCertifica
|
|
|
175
177
|
```ts
|
|
176
178
|
static parseIdentity(identityToParse: IdentityCertificate): DisplayableIdentity
|
|
177
179
|
```
|
|
178
|
-
See also: [DisplayableIdentity](#interface-displayableidentity)
|
|
180
|
+
See also: [DisplayableIdentity](./identity.md#interface-displayableidentity), [IdentityCertificate](./wallet.md#interface-identitycertificate)
|
|
179
181
|
|
|
180
182
|
Returns
|
|
181
183
|
|
|
@@ -194,6 +196,7 @@ The publicly revealed certificate is included in a blockchain transaction and br
|
|
|
194
196
|
```ts
|
|
195
197
|
async publiclyRevealAttributes(certificate: WalletCertificate, fieldsToReveal: CertificateFieldNameUnder50Bytes[]): Promise<BroadcastResponse | BroadcastFailure>
|
|
196
198
|
```
|
|
199
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [WalletCertificate](./wallet.md#interface-walletcertificate)
|
|
197
200
|
|
|
198
201
|
Returns
|
|
199
202
|
|
|
@@ -217,6 +220,7 @@ Remove a contact from the contacts basket
|
|
|
217
220
|
```ts
|
|
218
221
|
public async removeContact(identityKey: PubKeyHex): Promise<void>
|
|
219
222
|
```
|
|
223
|
+
See also: [PubKeyHex](./wallet.md#type-pubkeyhex)
|
|
220
224
|
|
|
221
225
|
Argument Details
|
|
222
226
|
|
|
@@ -230,7 +234,7 @@ Resolves displayable identity certificates by specific identity attributes, issu
|
|
|
230
234
|
```ts
|
|
231
235
|
async resolveByAttributes(args: DiscoverByAttributesArgs, overrideWithContacts = true): Promise<DisplayableIdentity[]>
|
|
232
236
|
```
|
|
233
|
-
See also: [DisplayableIdentity](#interface-displayableidentity)
|
|
237
|
+
See also: [DiscoverByAttributesArgs](./wallet.md#interface-discoverbyattributesargs), [DisplayableIdentity](./identity.md#interface-displayableidentity)
|
|
234
238
|
|
|
235
239
|
Returns
|
|
236
240
|
|
|
@@ -250,7 +254,7 @@ Resolves displayable identity certificates, issued to a given identity key by a
|
|
|
250
254
|
```ts
|
|
251
255
|
async resolveByIdentityKey(args: DiscoverByIdentityKeyArgs, overrideWithContacts = true): Promise<DisplayableIdentity[]>
|
|
252
256
|
```
|
|
253
|
-
See also: [DisplayableIdentity](#interface-displayableidentity)
|
|
257
|
+
See also: [DiscoverByIdentityKeyArgs](./wallet.md#interface-discoverbyidentitykeyargs), [DisplayableIdentity](./identity.md#interface-displayableidentity)
|
|
254
258
|
|
|
255
259
|
Returns
|
|
256
260
|
|
|
@@ -270,7 +274,7 @@ Save or update a Metanet contact
|
|
|
270
274
|
```ts
|
|
271
275
|
public async saveContact(contact: DisplayableIdentity, metadata?: Record<string, any>): Promise<void>
|
|
272
276
|
```
|
|
273
|
-
See also: [DisplayableIdentity](#interface-displayableidentity)
|
|
277
|
+
See also: [DisplayableIdentity](./identity.md#interface-displayableidentity)
|
|
274
278
|
|
|
275
279
|
Argument Details
|
|
276
280
|
|
|
@@ -294,7 +298,7 @@ export type Contact = DisplayableIdentity & {
|
|
|
294
298
|
}
|
|
295
299
|
```
|
|
296
300
|
|
|
297
|
-
See also: [DisplayableIdentity](#interface-displayableidentity)
|
|
301
|
+
See also: [DisplayableIdentity](./identity.md#interface-displayableidentity)
|
|
298
302
|
|
|
299
303
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
300
304
|
|
|
@@ -324,7 +328,7 @@ DEFAULT_IDENTITY_CLIENT_OPTIONS: IdentityClientOptions = {
|
|
|
324
328
|
}
|
|
325
329
|
```
|
|
326
330
|
|
|
327
|
-
See also: [IdentityClientOptions](#interface-identityclientoptions)
|
|
331
|
+
See also: [IdentityClientOptions](./identity.md#interface-identityclientoptions)
|
|
328
332
|
|
|
329
333
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
330
334
|
|
|
@@ -362,7 +366,7 @@ defaultIdentity: DisplayableIdentity = {
|
|
|
362
366
|
}
|
|
363
367
|
```
|
|
364
368
|
|
|
365
|
-
See also: [DisplayableIdentity](#interface-displayableidentity)
|
|
369
|
+
See also: [DisplayableIdentity](./identity.md#interface-displayableidentity)
|
|
366
370
|
|
|
367
371
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
368
372
|
|
|
@@ -29,6 +29,8 @@ export interface KVContext {
|
|
|
29
29
|
}
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
See also: [WalletProtocol](./wallet.md#type-walletprotocol)
|
|
33
|
+
|
|
32
34
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
33
35
|
|
|
34
36
|
---
|
|
@@ -54,6 +56,8 @@ export interface KVStoreConfig {
|
|
|
54
56
|
}
|
|
55
57
|
```
|
|
56
58
|
|
|
59
|
+
See also: [WalletInterface](./wallet.md#interface-walletinterface), [WalletProtocol](./wallet.md#type-walletprotocol)
|
|
60
|
+
|
|
57
61
|
#### Property acceptDelayedBroadcast
|
|
58
62
|
|
|
59
63
|
Whether to accept delayed broadcast
|
|
@@ -93,6 +97,7 @@ Protocol ID for the KVStore protocol
|
|
|
93
97
|
```ts
|
|
94
98
|
protocolID?: WalletProtocol
|
|
95
99
|
```
|
|
100
|
+
See also: [WalletProtocol](./wallet.md#type-walletprotocol)
|
|
96
101
|
|
|
97
102
|
#### Property serviceName
|
|
98
103
|
|
|
@@ -149,6 +154,7 @@ Wallet interface for operations
|
|
|
149
154
|
```ts
|
|
150
155
|
wallet?: WalletInterface
|
|
151
156
|
```
|
|
157
|
+
See also: [WalletInterface](./wallet.md#interface-walletinterface)
|
|
152
158
|
|
|
153
159
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
154
160
|
|
|
@@ -168,7 +174,7 @@ export interface KVStoreEntry {
|
|
|
168
174
|
}
|
|
169
175
|
```
|
|
170
176
|
|
|
171
|
-
See also: [KVStoreToken](#interface-kvstoretoken)
|
|
177
|
+
See also: [KVStoreToken](./kvstore.md#interface-kvstoretoken), [PubKeyHex](./wallet.md#type-pubkeyhex), [WalletProtocol](./wallet.md#type-walletprotocol)
|
|
172
178
|
|
|
173
179
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
174
180
|
|
|
@@ -246,6 +252,8 @@ export interface KVStoreQuery {
|
|
|
246
252
|
}
|
|
247
253
|
```
|
|
248
254
|
|
|
255
|
+
See also: [PubKeyHex](./wallet.md#type-pubkeyhex), [WalletProtocol](./wallet.md#type-walletprotocol)
|
|
256
|
+
|
|
249
257
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
250
258
|
|
|
251
259
|
---
|
|
@@ -258,6 +266,8 @@ export interface KVStoreRemoveOptions {
|
|
|
258
266
|
}
|
|
259
267
|
```
|
|
260
268
|
|
|
269
|
+
See also: [WalletProtocol](./wallet.md#type-walletprotocol)
|
|
270
|
+
|
|
261
271
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
262
272
|
|
|
263
273
|
---
|
|
@@ -272,6 +282,8 @@ export interface KVStoreSetOptions {
|
|
|
272
282
|
}
|
|
273
283
|
```
|
|
274
284
|
|
|
285
|
+
See also: [WalletProtocol](./wallet.md#type-walletprotocol)
|
|
286
|
+
|
|
275
287
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
276
288
|
|
|
277
289
|
---
|
|
@@ -289,6 +301,8 @@ export interface KVStoreToken {
|
|
|
289
301
|
}
|
|
290
302
|
```
|
|
291
303
|
|
|
304
|
+
See also: [Beef](./transaction.md#class-beef)
|
|
305
|
+
|
|
292
306
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
293
307
|
|
|
294
308
|
---
|
|
@@ -318,7 +332,7 @@ export class GlobalKVStore {
|
|
|
318
332
|
}
|
|
319
333
|
```
|
|
320
334
|
|
|
321
|
-
See also: [KVStoreConfig](#interface-kvstoreconfig), [KVStoreEntry](#interface-kvstoreentry), [KVStoreGetOptions](#interface-kvstoregetoptions), [KVStoreQuery](#interface-kvstorequery), [KVStoreRemoveOptions](#interface-kvstoreremoveoptions), [KVStoreSetOptions](#interface-kvstoresetoptions)
|
|
335
|
+
See also: [CreateActionOutput](./wallet.md#interface-createactionoutput), [HexString](./wallet.md#type-hexstring), [KVStoreConfig](./kvstore.md#interface-kvstoreconfig), [KVStoreEntry](./kvstore.md#interface-kvstoreentry), [KVStoreGetOptions](./kvstore.md#interface-kvstoregetoptions), [KVStoreQuery](./kvstore.md#interface-kvstorequery), [KVStoreRemoveOptions](./kvstore.md#interface-kvstoreremoveoptions), [KVStoreSetOptions](./kvstore.md#interface-kvstoresetoptions), [OutpointString](./wallet.md#type-outpointstring)
|
|
322
336
|
|
|
323
337
|
#### Constructor
|
|
324
338
|
|
|
@@ -327,7 +341,7 @@ Creates an instance of the GlobalKVStore.
|
|
|
327
341
|
```ts
|
|
328
342
|
constructor(config: KVStoreConfig = {})
|
|
329
343
|
```
|
|
330
|
-
See also: [KVStoreConfig](#interface-kvstoreconfig)
|
|
344
|
+
See also: [KVStoreConfig](./kvstore.md#interface-kvstoreconfig)
|
|
331
345
|
|
|
332
346
|
Argument Details
|
|
333
347
|
|
|
@@ -348,7 +362,7 @@ Can query by key+controller (single result), protocolID, controller, or key (mul
|
|
|
348
362
|
```ts
|
|
349
363
|
async get(query: KVStoreQuery, options: KVStoreGetOptions = {}): Promise<KVStoreEntry | KVStoreEntry[] | undefined>
|
|
350
364
|
```
|
|
351
|
-
See also: [KVStoreEntry](#interface-kvstoreentry), [KVStoreGetOptions](#interface-kvstoregetoptions), [KVStoreQuery](#interface-kvstorequery)
|
|
365
|
+
See also: [KVStoreEntry](./kvstore.md#interface-kvstoreentry), [KVStoreGetOptions](./kvstore.md#interface-kvstoregetoptions), [KVStoreQuery](./kvstore.md#interface-kvstorequery)
|
|
352
366
|
|
|
353
367
|
Returns
|
|
354
368
|
|
|
@@ -368,7 +382,7 @@ Removes the key-value pair associated with the given key from the overlay servic
|
|
|
368
382
|
```ts
|
|
369
383
|
async remove(key: string, outputs?: CreateActionOutput[], options: KVStoreRemoveOptions = {}): Promise<HexString>
|
|
370
384
|
```
|
|
371
|
-
See also: [KVStoreRemoveOptions](#interface-kvstoreremoveoptions)
|
|
385
|
+
See also: [CreateActionOutput](./wallet.md#interface-createactionoutput), [HexString](./wallet.md#type-hexstring), [KVStoreRemoveOptions](./kvstore.md#interface-kvstoreremoveoptions)
|
|
372
386
|
|
|
373
387
|
Returns
|
|
374
388
|
|
|
@@ -400,7 +414,7 @@ Sets a key-value pair. The current user (wallet identity) becomes the controller
|
|
|
400
414
|
```ts
|
|
401
415
|
async set(key: string, value: string, options: KVStoreSetOptions = {}): Promise<OutpointString>
|
|
402
416
|
```
|
|
403
|
-
See also: [KVStoreSetOptions](#interface-kvstoresetoptions)
|
|
417
|
+
See also: [KVStoreSetOptions](./kvstore.md#interface-kvstoresetoptions), [OutpointString](./wallet.md#type-outpointstring)
|
|
404
418
|
|
|
405
419
|
Returns
|
|
406
420
|
|
|
@@ -434,6 +448,8 @@ export default class LocalKVStore {
|
|
|
434
448
|
}
|
|
435
449
|
```
|
|
436
450
|
|
|
451
|
+
See also: [OutpointString](./wallet.md#type-outpointstring), [WalletClient](./wallet.md#class-walletclient), [WalletInterface](./wallet.md#interface-walletinterface), [encrypt](./messages.md#variable-encrypt)
|
|
452
|
+
|
|
437
453
|
#### Constructor
|
|
438
454
|
|
|
439
455
|
Creates an instance of the localKVStore.
|
|
@@ -441,6 +457,7 @@ Creates an instance of the localKVStore.
|
|
|
441
457
|
```ts
|
|
442
458
|
constructor(wallet: WalletInterface = new WalletClient(), context = "kvstore default", encrypt = true, originator?: string, acceptDelayedBroadcast = false)
|
|
443
459
|
```
|
|
460
|
+
See also: [WalletClient](./wallet.md#class-walletclient), [WalletInterface](./wallet.md#interface-walletinterface), [encrypt](./messages.md#variable-encrypt)
|
|
444
461
|
|
|
445
462
|
Argument Details
|
|
446
463
|
|
|
@@ -519,6 +536,7 @@ to the same key from missing earlier changes.
|
|
|
519
536
|
```ts
|
|
520
537
|
async set(key: string, value: string): Promise<OutpointString>
|
|
521
538
|
```
|
|
539
|
+
See also: [OutpointString](./wallet.md#type-outpointstring)
|
|
522
540
|
|
|
523
541
|
Returns
|
|
524
542
|
|
|
@@ -596,7 +614,7 @@ kvStoreInterpreter: InterpreterFunction<string, KVContext> = async (transaction:
|
|
|
596
614
|
}
|
|
597
615
|
```
|
|
598
616
|
|
|
599
|
-
See also: [KVContext](#interface-kvcontext), [kvProtocol](#variable-kvprotocol)
|
|
617
|
+
See also: [KVContext](./kvstore.md#interface-kvcontext), [PushDrop](./script.md#class-pushdrop), [Transaction](./transaction.md#class-transaction), [kvProtocol](./kvstore.md#variable-kvprotocol), [toUTF8](./primitives.md#variable-toutf8)
|
|
600
618
|
|
|
601
619
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
602
620
|
|
|
@@ -49,6 +49,8 @@ decrypt = (message: number[], recipient: PrivateKey): number[] => {
|
|
|
49
49
|
}
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey), [Reader](./primitives.md#class-reader), [SymmetricKey](./primitives.md#class-symmetrickey), [encode](./primitives.md#variable-encode), [toBase64](./primitives.md#function-tobase64), [toHex](./primitives.md#variable-tohex)
|
|
53
|
+
|
|
52
54
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
|
|
53
55
|
|
|
54
56
|
---
|
|
@@ -76,6 +78,8 @@ encrypt = (message: number[], sender: PrivateKey, recipient: PublicKey): number[
|
|
|
76
78
|
}
|
|
77
79
|
```
|
|
78
80
|
|
|
81
|
+
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey), [SymmetricKey](./primitives.md#class-symmetrickey), [encode](./primitives.md#variable-encode), [toArray](./primitives.md#variable-toarray), [toBase64](./primitives.md#function-tobase64)
|
|
82
|
+
|
|
79
83
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
|
|
80
84
|
|
|
81
85
|
---
|
|
@@ -107,6 +111,8 @@ sign = (message: number[], signer: PrivateKey, verifier?: PublicKey): number[] =
|
|
|
107
111
|
}
|
|
108
112
|
```
|
|
109
113
|
|
|
114
|
+
See also: [Curve](./primitives.md#class-curve), [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey), [encode](./primitives.md#variable-encode), [toArray](./primitives.md#variable-toarray), [toBase64](./primitives.md#function-tobase64)
|
|
115
|
+
|
|
110
116
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
|
|
111
117
|
|
|
112
118
|
---
|
|
@@ -145,6 +151,8 @@ verify = (message: number[], sig: number[], recipient?: PrivateKey): boolean =>
|
|
|
145
151
|
}
|
|
146
152
|
```
|
|
147
153
|
|
|
154
|
+
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey), [Reader](./primitives.md#class-reader), [Signature](./primitives.md#class-signature), [encode](./primitives.md#variable-encode), [toBase64](./primitives.md#function-tobase64), [toHex](./primitives.md#variable-tohex)
|
|
155
|
+
|
|
148
156
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
|
|
149
157
|
|
|
150
158
|
---
|