@bsv/sdk 1.6.14 → 1.6.16
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/auth/certificates/__tests/CompletedProtoWallet.js +1 -1
- package/dist/cjs/src/auth/certificates/__tests/CompletedProtoWallet.js.map +1 -1
- package/dist/cjs/src/primitives/Point.js +123 -6
- package/dist/cjs/src/primitives/Point.js.map +1 -1
- package/dist/cjs/src/primitives/PrivateKey.js +19 -2
- package/dist/cjs/src/primitives/PrivateKey.js.map +1 -1
- package/dist/cjs/src/primitives/PublicKey.js +19 -2
- package/dist/cjs/src/primitives/PublicKey.js.map +1 -1
- package/dist/cjs/src/wallet/CachedKeyDeriver.js +12 -1
- package/dist/cjs/src/wallet/CachedKeyDeriver.js.map +1 -1
- package/dist/cjs/src/wallet/KeyDeriver.js +8 -5
- package/dist/cjs/src/wallet/KeyDeriver.js.map +1 -1
- package/dist/cjs/src/wallet/ProtoWallet.js +5 -2
- package/dist/cjs/src/wallet/ProtoWallet.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/auth/certificates/__tests/CompletedProtoWallet.js +2 -2
- package/dist/esm/src/auth/certificates/__tests/CompletedProtoWallet.js.map +1 -1
- package/dist/esm/src/primitives/Point.js +123 -6
- package/dist/esm/src/primitives/Point.js.map +1 -1
- package/dist/esm/src/primitives/PrivateKey.js +19 -2
- package/dist/esm/src/primitives/PrivateKey.js.map +1 -1
- package/dist/esm/src/primitives/PublicKey.js +19 -2
- package/dist/esm/src/primitives/PublicKey.js.map +1 -1
- package/dist/esm/src/wallet/CachedKeyDeriver.js +20 -1
- package/dist/esm/src/wallet/CachedKeyDeriver.js.map +1 -1
- package/dist/esm/src/wallet/KeyDeriver.js +11 -5
- package/dist/esm/src/wallet/KeyDeriver.js.map +1 -1
- package/dist/esm/src/wallet/ProtoWallet.js +2 -2
- package/dist/esm/src/wallet/ProtoWallet.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/auth/certificates/__tests/CompletedProtoWallet.d.ts.map +1 -1
- package/dist/types/src/primitives/Point.d.ts.map +1 -1
- package/dist/types/src/primitives/PrivateKey.d.ts +3 -1
- package/dist/types/src/primitives/PrivateKey.d.ts.map +1 -1
- package/dist/types/src/primitives/PublicKey.d.ts +3 -1
- package/dist/types/src/primitives/PublicKey.d.ts.map +1 -1
- package/dist/types/src/transaction/http/HttpClient.d.ts +2 -0
- package/dist/types/src/transaction/http/HttpClient.d.ts.map +1 -1
- package/dist/types/src/wallet/CachedKeyDeriver.d.ts +10 -2
- package/dist/types/src/wallet/CachedKeyDeriver.d.ts.map +1 -1
- package/dist/types/src/wallet/KeyDeriver.d.ts +5 -2
- package/dist/types/src/wallet/KeyDeriver.d.ts.map +1 -1
- package/dist/types/src/wallet/ProtoWallet.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/docs/reference/auth.md +159 -212
- package/docs/reference/compat.md +96 -120
- package/docs/reference/identity.md +12 -21
- package/docs/reference/kvstore.md +19 -21
- package/docs/reference/messages.md +0 -3
- package/docs/reference/overlay-tools.md +18 -46
- package/docs/reference/primitives.md +404 -577
- package/docs/reference/registry.md +20 -43
- package/docs/reference/script.md +105 -140
- package/docs/reference/storage.md +12 -32
- package/docs/reference/totp.md +11 -16
- package/docs/reference/transaction.md +129 -201
- package/docs/reference/wallet.md +89 -247
- package/package.json +1 -1
- package/src/auth/certificates/__tests/CompletedProtoWallet.ts +3 -2
- package/src/primitives/Point.ts +152 -5
- package/src/primitives/PrivateKey.ts +22 -2
- package/src/primitives/PublicKey.ts +22 -2
- package/src/transaction/http/HttpClient.ts +2 -0
- package/src/wallet/CachedKeyDeriver.ts +32 -8
- package/src/wallet/KeyDeriver.ts +22 -6
- package/src/wallet/ProtoWallet.ts +3 -2
|
@@ -41,14 +41,12 @@ See also: [PubKeyHex](./wallet.md#type-pubkeyhex)
|
|
|
41
41
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
42
42
|
|
|
43
43
|
---
|
|
44
|
-
|
|
45
44
|
### Interface: BasketQuery
|
|
46
45
|
|
|
47
46
|
When searching for basket definitions, we can filter by:
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
- name
|
|
47
|
+
- basketID
|
|
48
|
+
- registryOperators
|
|
49
|
+
- name
|
|
52
50
|
|
|
53
51
|
```ts
|
|
54
52
|
export interface BasketQuery {
|
|
@@ -61,7 +59,6 @@ export interface BasketQuery {
|
|
|
61
59
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
62
60
|
|
|
63
61
|
---
|
|
64
|
-
|
|
65
62
|
### Interface: CertificateDefinitionData
|
|
66
63
|
|
|
67
64
|
Registry data for a Certificate-style record.
|
|
@@ -84,7 +81,6 @@ See also: [CertificateFieldDescriptor](./registry.md#interface-certificatefieldd
|
|
|
84
81
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
85
82
|
|
|
86
83
|
---
|
|
87
|
-
|
|
88
84
|
### Interface: CertificateFieldDescriptor
|
|
89
85
|
|
|
90
86
|
Describes a re-usable structure for certificate fields (used by CertMap).
|
|
@@ -101,14 +97,12 @@ export interface CertificateFieldDescriptor {
|
|
|
101
97
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
102
98
|
|
|
103
99
|
---
|
|
104
|
-
|
|
105
100
|
### Interface: CertificateQuery
|
|
106
101
|
|
|
107
102
|
When searching for certificate definitions, we can filter by:
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
- registryOperators
|
|
103
|
+
- type
|
|
104
|
+
- name
|
|
105
|
+
- registryOperators
|
|
112
106
|
|
|
113
107
|
```ts
|
|
114
108
|
export interface CertificateQuery {
|
|
@@ -121,7 +115,6 @@ export interface CertificateQuery {
|
|
|
121
115
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
122
116
|
|
|
123
117
|
---
|
|
124
|
-
|
|
125
118
|
### Interface: ProtocolDefinitionData
|
|
126
119
|
|
|
127
120
|
Registry data for a Protocol-style record.
|
|
@@ -143,14 +136,12 @@ See also: [PubKeyHex](./wallet.md#type-pubkeyhex), [WalletProtocol](./wallet.md#
|
|
|
143
136
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
144
137
|
|
|
145
138
|
---
|
|
146
|
-
|
|
147
139
|
### Interface: ProtocolQuery
|
|
148
140
|
|
|
149
141
|
When searching for protocol definitions, we can filter by:
|
|
150
|
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
- protocolID
|
|
142
|
+
- name
|
|
143
|
+
- registryOperators
|
|
144
|
+
- protocolID
|
|
154
145
|
|
|
155
146
|
```ts
|
|
156
147
|
export interface ProtocolQuery {
|
|
@@ -165,7 +156,6 @@ See also: [WalletProtocol](./wallet.md#type-walletprotocol)
|
|
|
165
156
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
166
157
|
|
|
167
158
|
---
|
|
168
|
-
|
|
169
159
|
### Interface: RegistryQueryMapping
|
|
170
160
|
|
|
171
161
|
A lookup-service mapping of queries by each definition type.
|
|
@@ -183,7 +173,6 @@ See also: [BasketQuery](./registry.md#interface-basketquery), [CertificateQuery]
|
|
|
183
173
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
184
174
|
|
|
185
175
|
---
|
|
186
|
-
|
|
187
176
|
### Interface: TokenData
|
|
188
177
|
|
|
189
178
|
Common info for the on-chain token/UTXO that points to a registry entry.
|
|
@@ -203,19 +192,16 @@ See also: [BEEF](./wallet.md#type-beef)
|
|
|
203
192
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
204
193
|
|
|
205
194
|
---
|
|
206
|
-
|
|
207
195
|
## Classes
|
|
208
196
|
|
|
209
197
|
### Class: RegistryClient
|
|
210
198
|
|
|
211
199
|
RegistryClient manages on-chain registry definitions for three types:
|
|
212
|
-
|
|
213
200
|
- basket (basket-based items)
|
|
214
201
|
- protocol (protocol-based items)
|
|
215
202
|
- certificate (certificate-based items)
|
|
216
203
|
|
|
217
204
|
It provides methods to:
|
|
218
|
-
|
|
219
205
|
- Register new definitions using pushdrop-based UTXOs.
|
|
220
206
|
- Resolve existing definitions using a lookup service.
|
|
221
207
|
- List registry entries associated with the operator's wallet.
|
|
@@ -245,7 +231,6 @@ Returns parsed registry records including transaction details such as txid, outp
|
|
|
245
231
|
```ts
|
|
246
232
|
async listOwnRegistryEntries(definitionType: DefinitionType): Promise<RegistryRecord[]>
|
|
247
233
|
```
|
|
248
|
-
|
|
249
234
|
See also: [DefinitionType](./registry.md#type-definitiontype), [RegistryRecord](./registry.md#type-registryrecord)
|
|
250
235
|
|
|
251
236
|
Returns
|
|
@@ -254,8 +239,8 @@ A promise that resolves to an array of RegistryRecord objects.
|
|
|
254
239
|
|
|
255
240
|
Argument Details
|
|
256
241
|
|
|
257
|
-
|
|
258
|
-
|
|
242
|
+
+ **definitionType**
|
|
243
|
+
+ The type of registry definition to list ('basket', 'protocol', or 'certificate').
|
|
259
244
|
|
|
260
245
|
#### Method registerDefinition
|
|
261
246
|
|
|
@@ -268,7 +253,6 @@ to establish canonical references for basket IDs, protocol specs, or certificate
|
|
|
268
253
|
```ts
|
|
269
254
|
async registerDefinition(data: DefinitionData): Promise<BroadcastResponse | BroadcastFailure>
|
|
270
255
|
```
|
|
271
|
-
|
|
272
256
|
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [DefinitionData](./registry.md#type-definitiondata)
|
|
273
257
|
|
|
274
258
|
Returns
|
|
@@ -277,15 +261,14 @@ A promise with the broadcast result or failure.
|
|
|
277
261
|
|
|
278
262
|
Argument Details
|
|
279
263
|
|
|
280
|
-
|
|
281
|
-
|
|
264
|
+
+ **data**
|
|
265
|
+
+ Structured information about a 'basket', 'protocol', or 'certificate'.
|
|
282
266
|
|
|
283
267
|
#### Method resolve
|
|
284
268
|
|
|
285
269
|
Resolves registrant tokens of a particular type using a lookup service.
|
|
286
270
|
|
|
287
271
|
The query object shape depends on the registry type:
|
|
288
|
-
|
|
289
272
|
- For "basket", the query is of type BasketMapQuery:
|
|
290
273
|
{ basketID?: string; name?: string; registryOperators?: string[]; }
|
|
291
274
|
- For "protocol", the query is of type ProtoMapQuery:
|
|
@@ -296,7 +279,6 @@ The query object shape depends on the registry type:
|
|
|
296
279
|
```ts
|
|
297
280
|
async resolve<T extends DefinitionType>(definitionType: T, query: RegistryQueryMapping[T]): Promise<DefinitionData[]>
|
|
298
281
|
```
|
|
299
|
-
|
|
300
282
|
See also: [DefinitionData](./registry.md#type-definitiondata), [DefinitionType](./registry.md#type-definitiontype), [RegistryQueryMapping](./registry.md#interface-registryquerymapping)
|
|
301
283
|
|
|
302
284
|
Returns
|
|
@@ -305,10 +287,10 @@ A promise that resolves to an array of matching registry records.
|
|
|
305
287
|
|
|
306
288
|
Argument Details
|
|
307
289
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
290
|
+
+ **definitionType**
|
|
291
|
+
+ The registry type, which can be 'basket', 'protocol', or 'certificate'.
|
|
292
|
+
+ **query**
|
|
293
|
+
+ The query object used to filter registry records, whose shape is determined by the registry type.
|
|
312
294
|
|
|
313
295
|
#### Method revokeOwnRegistryEntry
|
|
314
296
|
|
|
@@ -317,7 +299,6 @@ Revokes a registry record by spending its associated UTXO.
|
|
|
317
299
|
```ts
|
|
318
300
|
async revokeOwnRegistryEntry(registryRecord: RegistryRecord): Promise<BroadcastResponse | BroadcastFailure>
|
|
319
301
|
```
|
|
320
|
-
|
|
321
302
|
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [RegistryRecord](./registry.md#type-registryrecord)
|
|
322
303
|
|
|
323
304
|
Returns
|
|
@@ -326,13 +307,12 @@ Broadcast success/failure.
|
|
|
326
307
|
|
|
327
308
|
Argument Details
|
|
328
309
|
|
|
329
|
-
|
|
330
|
-
|
|
310
|
+
+ **registryRecord**
|
|
311
|
+
+ Must have valid txid, outputIndex, and lockingScript.
|
|
331
312
|
|
|
332
313
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
333
314
|
|
|
334
315
|
---
|
|
335
|
-
|
|
336
316
|
## Functions
|
|
337
317
|
|
|
338
318
|
### Function: deserializeWalletProtocol
|
|
@@ -346,7 +326,6 @@ See also: [WalletProtocol](./wallet.md#type-walletprotocol)
|
|
|
346
326
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
347
327
|
|
|
348
328
|
---
|
|
349
|
-
|
|
350
329
|
## Types
|
|
351
330
|
|
|
352
331
|
| |
|
|
@@ -372,7 +351,6 @@ See also: [BasketDefinitionData](./registry.md#interface-basketdefinitiondata),
|
|
|
372
351
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
373
352
|
|
|
374
353
|
---
|
|
375
|
-
|
|
376
354
|
### Type: DefinitionType
|
|
377
355
|
|
|
378
356
|
We unify the registry “type” to these three strings everywhere:
|
|
@@ -385,7 +363,6 @@ export type DefinitionType = "basket" | "protocol" | "certificate"
|
|
|
385
363
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
386
364
|
|
|
387
365
|
---
|
|
388
|
-
|
|
389
366
|
### Type: RegistryRecord
|
|
390
367
|
|
|
391
368
|
A registry record is a combination of the typed definition data
|
|
@@ -400,7 +377,7 @@ See also: [DefinitionData](./registry.md#type-definitiondata), [TokenData](./reg
|
|
|
400
377
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
401
378
|
|
|
402
379
|
---
|
|
403
|
-
|
|
404
380
|
## Enums
|
|
405
381
|
|
|
406
382
|
## Variables
|
|
383
|
+
|