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