@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
|
@@ -30,6 +30,7 @@ export interface DownloadResult {
|
|
|
30
30
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
31
31
|
|
|
32
32
|
---
|
|
33
|
+
|
|
33
34
|
### Interface: DownloaderConfig
|
|
34
35
|
|
|
35
36
|
```ts
|
|
@@ -41,6 +42,7 @@ export interface DownloaderConfig {
|
|
|
41
42
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
42
43
|
|
|
43
44
|
---
|
|
45
|
+
|
|
44
46
|
### Interface: FindFileData
|
|
45
47
|
|
|
46
48
|
```ts
|
|
@@ -55,6 +57,7 @@ export interface FindFileData {
|
|
|
55
57
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
56
58
|
|
|
57
59
|
---
|
|
60
|
+
|
|
58
61
|
### Interface: RenewFileResult
|
|
59
62
|
|
|
60
63
|
```ts
|
|
@@ -69,6 +72,7 @@ export interface RenewFileResult {
|
|
|
69
72
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
70
73
|
|
|
71
74
|
---
|
|
75
|
+
|
|
72
76
|
### Interface: UploadFileResult
|
|
73
77
|
|
|
74
78
|
```ts
|
|
@@ -81,6 +85,7 @@ export interface UploadFileResult {
|
|
|
81
85
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
82
86
|
|
|
83
87
|
---
|
|
88
|
+
|
|
84
89
|
### Interface: UploadableFile
|
|
85
90
|
|
|
86
91
|
```ts
|
|
@@ -93,6 +98,7 @@ export interface UploadableFile {
|
|
|
93
98
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
94
99
|
|
|
95
100
|
---
|
|
101
|
+
|
|
96
102
|
### Interface: UploaderConfig
|
|
97
103
|
|
|
98
104
|
```ts
|
|
@@ -107,6 +113,7 @@ See also: [WalletInterface](./wallet.md#interface-walletinterface)
|
|
|
107
113
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
108
114
|
|
|
109
115
|
---
|
|
116
|
+
|
|
110
117
|
## Classes
|
|
111
118
|
|
|
112
119
|
| |
|
|
@@ -137,6 +144,7 @@ Downloads the content from the UHRP URL after validating the hash for integrity.
|
|
|
137
144
|
```ts
|
|
138
145
|
public async download(uhrpUrl: string): Promise<DownloadResult>
|
|
139
146
|
```
|
|
147
|
+
|
|
140
148
|
See also: [DownloadResult](./storage.md#interface-downloadresult)
|
|
141
149
|
|
|
142
150
|
Returns
|
|
@@ -145,8 +153,8 @@ A promise that resolves to the downloaded content.
|
|
|
145
153
|
|
|
146
154
|
Argument Details
|
|
147
155
|
|
|
148
|
-
|
|
149
|
-
|
|
156
|
+
- **uhrpUrl**
|
|
157
|
+
- The UHRP URL to download.
|
|
150
158
|
|
|
151
159
|
#### Method resolve
|
|
152
160
|
|
|
@@ -162,15 +170,17 @@ A promise that resolves to an array of HTTP URLs.
|
|
|
162
170
|
|
|
163
171
|
Argument Details
|
|
164
172
|
|
|
165
|
-
|
|
166
|
-
|
|
173
|
+
- **uhrpUrl**
|
|
174
|
+
- The UHRP URL to resolve.
|
|
167
175
|
|
|
168
176
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
169
177
|
|
|
170
178
|
---
|
|
179
|
+
|
|
171
180
|
### Class: StorageUploader
|
|
172
181
|
|
|
173
182
|
The StorageUploader class provides client-side methods for:
|
|
183
|
+
|
|
174
184
|
- Uploading files with a specified retention period
|
|
175
185
|
- Finding file metadata by UHRP URL
|
|
176
186
|
- Listing all user uploads
|
|
@@ -198,12 +208,13 @@ Creates a new StorageUploader instance.
|
|
|
198
208
|
```ts
|
|
199
209
|
constructor(config: UploaderConfig)
|
|
200
210
|
```
|
|
211
|
+
|
|
201
212
|
See also: [UploaderConfig](./storage.md#interface-uploaderconfig)
|
|
202
213
|
|
|
203
214
|
Argument Details
|
|
204
215
|
|
|
205
|
-
|
|
206
|
-
|
|
216
|
+
- **config**
|
|
217
|
+
- An object containing the storage server's URL and a wallet interface
|
|
207
218
|
|
|
208
219
|
#### Method findFile
|
|
209
220
|
|
|
@@ -212,6 +223,7 @@ Retrieves metadata for a file matching the given UHRP URL from the `/find` route
|
|
|
212
223
|
```ts
|
|
213
224
|
public async findFile(uhrpUrl: string): Promise<FindFileData>
|
|
214
225
|
```
|
|
226
|
+
|
|
215
227
|
See also: [FindFileData](./storage.md#interface-findfiledata)
|
|
216
228
|
|
|
217
229
|
Returns
|
|
@@ -220,8 +232,8 @@ An object with file name, size, MIME type, and expiry time
|
|
|
220
232
|
|
|
221
233
|
Argument Details
|
|
222
234
|
|
|
223
|
-
|
|
224
|
-
|
|
235
|
+
- **uhrpUrl**
|
|
236
|
+
- The UHRP URL, e.g. "uhrp://abcd..."
|
|
225
237
|
|
|
226
238
|
Throws
|
|
227
239
|
|
|
@@ -248,6 +260,7 @@ If the server or the route returns an error
|
|
|
248
260
|
Publishes a file to the storage server with the specified retention period.
|
|
249
261
|
|
|
250
262
|
This will:
|
|
263
|
+
|
|
251
264
|
1. Request an upload URL from the server.
|
|
252
265
|
2. Perform an HTTP PUT to upload the file’s raw bytes.
|
|
253
266
|
3. Return a UHRP URL referencing the file once published.
|
|
@@ -258,6 +271,7 @@ public async publishFile(params: {
|
|
|
258
271
|
retentionPeriod: number;
|
|
259
272
|
}): Promise<UploadFileResult>
|
|
260
273
|
```
|
|
274
|
+
|
|
261
275
|
See also: [UploadFileResult](./storage.md#interface-uploadfileresult), [UploadableFile](./storage.md#interface-uploadablefile)
|
|
262
276
|
|
|
263
277
|
Returns
|
|
@@ -277,6 +291,7 @@ and re-mint the advertisement token on-chain.
|
|
|
277
291
|
```ts
|
|
278
292
|
public async renewFile(uhrpUrl: string, additionalMinutes: number): Promise<RenewFileResult>
|
|
279
293
|
```
|
|
294
|
+
|
|
280
295
|
See also: [RenewFileResult](./storage.md#interface-renewfileresult)
|
|
281
296
|
|
|
282
297
|
Returns
|
|
@@ -285,10 +300,10 @@ An object with the new and previous expiry times, plus any cost
|
|
|
285
300
|
|
|
286
301
|
Argument Details
|
|
287
302
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
303
|
+
- **uhrpUrl**
|
|
304
|
+
- The UHRP URL of the file (e.g., "uhrp://abcd1234...")
|
|
305
|
+
- **additionalMinutes**
|
|
306
|
+
- The number of minutes to extend
|
|
292
307
|
|
|
293
308
|
Throws
|
|
294
309
|
|
|
@@ -297,6 +312,7 @@ If the request fails or the server returns an error
|
|
|
297
312
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
298
313
|
|
|
299
314
|
---
|
|
315
|
+
|
|
300
316
|
## Functions
|
|
301
317
|
|
|
302
318
|
## Types
|
|
@@ -338,6 +354,7 @@ See also: [fromBase58Check](./primitives.md#variable-frombase58check), [normaliz
|
|
|
338
354
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
339
355
|
|
|
340
356
|
---
|
|
357
|
+
|
|
341
358
|
### Variable: getURLForFile
|
|
342
359
|
|
|
343
360
|
```ts
|
|
@@ -352,6 +369,7 @@ See also: [getURLForHash](./storage.md#variable-geturlforhash), [sha256](./primi
|
|
|
352
369
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
353
370
|
|
|
354
371
|
---
|
|
372
|
+
|
|
355
373
|
### Variable: getURLForHash
|
|
356
374
|
|
|
357
375
|
```ts
|
|
@@ -368,6 +386,7 @@ See also: [toArray](./primitives.md#variable-toarray), [toBase58Check](./primiti
|
|
|
368
386
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
369
387
|
|
|
370
388
|
---
|
|
389
|
+
|
|
371
390
|
### Variable: isValidURL
|
|
372
391
|
|
|
373
392
|
```ts
|
|
@@ -387,6 +406,7 @@ See also: [getHashFromURL](./storage.md#variable-gethashfromurl)
|
|
|
387
406
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
388
407
|
|
|
389
408
|
---
|
|
409
|
+
|
|
390
410
|
### Variable: normalizeURL
|
|
391
411
|
|
|
392
412
|
```ts
|
package/docs/reference/totp.md
CHANGED
|
@@ -22,6 +22,7 @@ See also: [TOTPAlgorithm](./totp.md#type-totpalgorithm)
|
|
|
22
22
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
23
23
|
|
|
24
24
|
---
|
|
25
|
+
|
|
25
26
|
## Classes
|
|
26
27
|
|
|
27
28
|
### Class: TOTP
|
|
@@ -42,6 +43,7 @@ Generates a Time-based One-Time Password (TOTP).
|
|
|
42
43
|
```ts
|
|
43
44
|
static generate(secret: number[], options?: TOTPOptions): string
|
|
44
45
|
```
|
|
46
|
+
|
|
45
47
|
See also: [TOTPOptions](./totp.md#interface-totpoptions)
|
|
46
48
|
|
|
47
49
|
Returns
|
|
@@ -50,10 +52,10 @@ The generated TOTP.
|
|
|
50
52
|
|
|
51
53
|
Argument Details
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
- **secret**
|
|
56
|
+
- The secret key for TOTP.
|
|
57
|
+
- **options**
|
|
58
|
+
- Optional parameters for TOTP.
|
|
57
59
|
|
|
58
60
|
#### Method validate
|
|
59
61
|
|
|
@@ -62,6 +64,7 @@ Validates a Time-based One-Time Password (TOTP).
|
|
|
62
64
|
```ts
|
|
63
65
|
static validate(secret: number[], passcode: string, options?: TOTPValidateOptions): boolean
|
|
64
66
|
```
|
|
67
|
+
|
|
65
68
|
See also: [TOTPValidateOptions](./totp.md#type-totpvalidateoptions)
|
|
66
69
|
|
|
67
70
|
Returns
|
|
@@ -70,16 +73,17 @@ A boolean indicating whether the passcode is valid.
|
|
|
70
73
|
|
|
71
74
|
Argument Details
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
- **secret**
|
|
77
|
+
- The secret key for TOTP.
|
|
78
|
+
- **passcode**
|
|
79
|
+
- The passcode to validate.
|
|
80
|
+
- **options**
|
|
81
|
+
- Optional parameters for TOTP validation.
|
|
79
82
|
|
|
80
83
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
81
84
|
|
|
82
85
|
---
|
|
86
|
+
|
|
83
87
|
## Functions
|
|
84
88
|
|
|
85
89
|
## Types
|
|
@@ -102,6 +106,7 @@ export type TOTPAlgorithm = "SHA-1" | "SHA-256" | "SHA-512"
|
|
|
102
106
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
103
107
|
|
|
104
108
|
---
|
|
109
|
+
|
|
105
110
|
### Type: TOTPValidateOptions
|
|
106
111
|
|
|
107
112
|
Options for TOTP validation.
|
|
@@ -117,5 +122,5 @@ See also: [TOTPOptions](./totp.md#interface-totpoptions)
|
|
|
117
122
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
118
123
|
|
|
119
124
|
---
|
|
120
|
-
## Variables
|
|
121
125
|
|
|
126
|
+
## Variables
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# Transaction Signatures Reference
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
** SKELETON PLACEHOLDER - check <https://docs.bsvblockchain.org/guides/sdks/ts/low-level/tx_sig> ***
|
|
3
4
|
*This is a technical reference document for transaction signatures in the BSV TypeScript SDK.*
|
|
4
5
|
|
|
5
6
|
## Introduction
|