@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
package/docs/reference/errors.md
CHANGED
|
@@ -7,40 +7,48 @@ Complete reference for error codes, messages, and troubleshooting in the BSV Typ
|
|
|
7
7
|
### Transaction Errors
|
|
8
8
|
|
|
9
9
|
#### INSUFFICIENT_FUNDS
|
|
10
|
+
|
|
10
11
|
**Code**: `INSUFFICIENT_FUNDS`
|
|
11
12
|
**Message**: "Insufficient funds to create transaction"
|
|
12
13
|
**Cause**: Wallet doesn't have enough UTXOs to cover transaction outputs and fees
|
|
13
14
|
**Solutions**:
|
|
15
|
+
|
|
14
16
|
- Check wallet balance with `listOutputs()`
|
|
15
17
|
- Reduce transaction amount
|
|
16
18
|
- Wait for pending transactions to confirm
|
|
17
19
|
- Use smaller fee rates
|
|
18
20
|
|
|
19
21
|
#### INVALID_TRANSACTION
|
|
22
|
+
|
|
20
23
|
**Code**: `INVALID_TRANSACTION`
|
|
21
24
|
**Message**: "Transaction validation failed"
|
|
22
25
|
**Cause**: Transaction structure or signatures are invalid
|
|
23
26
|
**Solutions**:
|
|
27
|
+
|
|
24
28
|
- Verify all inputs are properly signed
|
|
25
29
|
- Check script templates are correct
|
|
26
30
|
- Ensure transaction format is valid
|
|
27
31
|
- Validate all output amounts are positive
|
|
28
32
|
|
|
29
33
|
#### TRANSACTION_TOO_LARGE
|
|
34
|
+
|
|
30
35
|
**Code**: `TRANSACTION_TOO_LARGE`
|
|
31
36
|
**Message**: "Transaction exceeds maximum size limit"
|
|
32
37
|
**Cause**: Transaction size exceeds network limits
|
|
33
38
|
**Solutions**:
|
|
39
|
+
|
|
34
40
|
- Reduce number of inputs/outputs
|
|
35
41
|
- Use more efficient script templates
|
|
36
42
|
- Split into multiple transactions
|
|
37
43
|
- Optimize data storage methods
|
|
38
44
|
|
|
39
45
|
#### INVALID_SCRIPT
|
|
46
|
+
|
|
40
47
|
**Code**: `INVALID_SCRIPT`
|
|
41
48
|
**Message**: "Script execution failed"
|
|
42
49
|
**Cause**: Locking or unlocking script contains errors
|
|
43
50
|
**Solutions**:
|
|
51
|
+
|
|
44
52
|
- Validate script syntax with `Script.fromASM()`
|
|
45
53
|
- Check opcode usage and limits
|
|
46
54
|
- Verify script template implementation
|
|
@@ -49,40 +57,48 @@ Complete reference for error codes, messages, and troubleshooting in the BSV Typ
|
|
|
49
57
|
### Wallet Errors
|
|
50
58
|
|
|
51
59
|
#### WALLET_NOT_CONNECTED
|
|
60
|
+
|
|
52
61
|
**Code**: `WALLET_NOT_CONNECTED`
|
|
53
62
|
**Message**: "Wallet connection not established"
|
|
54
63
|
**Cause**: WalletClient not connected to substrate
|
|
55
64
|
**Solutions**:
|
|
65
|
+
|
|
56
66
|
- Call `await wallet.connectToSubstrate()`
|
|
57
67
|
- Check wallet application is running
|
|
58
68
|
- Verify network connectivity
|
|
59
69
|
- Restart wallet application if needed
|
|
60
70
|
|
|
61
71
|
#### AUTHENTICATION_FAILED
|
|
72
|
+
|
|
62
73
|
**Code**: `AUTHENTICATION_FAILED`
|
|
63
74
|
**Message**: "Wallet authentication failed"
|
|
64
75
|
**Cause**: User denied access or authentication expired
|
|
65
76
|
**Solutions**:
|
|
77
|
+
|
|
66
78
|
- Re-authenticate with wallet
|
|
67
79
|
- Check originator domain permissions
|
|
68
80
|
- Verify wallet trust settings
|
|
69
81
|
- Clear cached authentication state
|
|
70
82
|
|
|
71
83
|
#### WALLET_LOCKED
|
|
84
|
+
|
|
72
85
|
**Code**: `WALLET_LOCKED`
|
|
73
86
|
**Message**: "Wallet is locked or requires password"
|
|
74
87
|
**Cause**: Wallet requires user authentication
|
|
75
88
|
**Solutions**:
|
|
89
|
+
|
|
76
90
|
- Unlock wallet application
|
|
77
91
|
- Enter wallet password
|
|
78
92
|
- Check wallet auto-lock settings
|
|
79
93
|
- Verify user session is active
|
|
80
94
|
|
|
81
95
|
#### ACTION_REJECTED
|
|
96
|
+
|
|
82
97
|
**Code**: `ACTION_REJECTED`
|
|
83
98
|
**Message**: "User rejected the transaction"
|
|
84
99
|
**Cause**: User declined transaction in wallet UI
|
|
85
100
|
**Solutions**:
|
|
101
|
+
|
|
86
102
|
- Retry transaction with user consent
|
|
87
103
|
- Adjust transaction parameters
|
|
88
104
|
- Provide clearer transaction description
|
|
@@ -91,40 +107,48 @@ Complete reference for error codes, messages, and troubleshooting in the BSV Typ
|
|
|
91
107
|
### Network Errors
|
|
92
108
|
|
|
93
109
|
#### NETWORK_ERROR
|
|
110
|
+
|
|
94
111
|
**Code**: `NETWORK_ERROR`
|
|
95
112
|
**Message**: "Network request failed"
|
|
96
113
|
**Cause**: Connection issues with blockchain nodes
|
|
97
114
|
**Solutions**:
|
|
115
|
+
|
|
98
116
|
- Check internet connectivity
|
|
99
117
|
- Verify node endpoints are accessible
|
|
100
118
|
- Try alternative chain trackers
|
|
101
119
|
- Implement retry logic with exponential backoff
|
|
102
120
|
|
|
103
121
|
#### NODE_UNAVAILABLE
|
|
122
|
+
|
|
104
123
|
**Code**: `NODE_UNAVAILABLE`
|
|
105
124
|
**Message**: "Blockchain node is unavailable"
|
|
106
125
|
**Cause**: Target node is down or unreachable
|
|
107
126
|
**Solutions**:
|
|
127
|
+
|
|
108
128
|
- Switch to backup node endpoints
|
|
109
129
|
- Check node status and health
|
|
110
130
|
- Use multiple chain tracker instances
|
|
111
131
|
- Implement failover mechanisms
|
|
112
132
|
|
|
113
133
|
#### BROADCAST_FAILED
|
|
134
|
+
|
|
114
135
|
**Code**: `BROADCAST_FAILED`
|
|
115
136
|
**Message**: "Transaction broadcast failed"
|
|
116
137
|
**Cause**: Network rejected transaction or broadcast error
|
|
117
138
|
**Solutions**:
|
|
139
|
+
|
|
118
140
|
- Verify transaction is valid
|
|
119
141
|
- Check network fees are adequate
|
|
120
142
|
- Retry broadcast after delay
|
|
121
143
|
- Use alternative broadcast endpoints
|
|
122
144
|
|
|
123
145
|
#### TIMEOUT_ERROR
|
|
146
|
+
|
|
124
147
|
**Code**: `TIMEOUT_ERROR`
|
|
125
148
|
**Message**: "Request timeout exceeded"
|
|
126
149
|
**Cause**: Network request took too long
|
|
127
150
|
**Solutions**:
|
|
151
|
+
|
|
128
152
|
- Increase timeout values
|
|
129
153
|
- Check network latency
|
|
130
154
|
- Use faster endpoints
|
|
@@ -133,40 +157,48 @@ Complete reference for error codes, messages, and troubleshooting in the BSV Typ
|
|
|
133
157
|
### Cryptographic Errors
|
|
134
158
|
|
|
135
159
|
#### INVALID_PRIVATE_KEY
|
|
160
|
+
|
|
136
161
|
**Code**: `INVALID_PRIVATE_KEY`
|
|
137
162
|
**Message**: "Private key is invalid or out of range"
|
|
138
163
|
**Cause**: Private key doesn't meet secp256k1 requirements
|
|
139
164
|
**Solutions**:
|
|
165
|
+
|
|
140
166
|
- Generate new key with `PrivateKey.fromRandom()`
|
|
141
167
|
- Validate key is within curve order
|
|
142
168
|
- Check key format and encoding
|
|
143
169
|
- Use proper key derivation methods
|
|
144
170
|
|
|
145
171
|
#### INVALID_PUBLIC_KEY
|
|
172
|
+
|
|
146
173
|
**Code**: `INVALID_PUBLIC_KEY`
|
|
147
174
|
**Message**: "Public key is invalid or not on curve"
|
|
148
175
|
**Cause**: Public key point is invalid
|
|
149
176
|
**Solutions**:
|
|
177
|
+
|
|
150
178
|
- Verify key derivation from private key
|
|
151
179
|
- Check point coordinates are valid
|
|
152
180
|
- Validate key format (compressed/uncompressed)
|
|
153
181
|
- Use `PublicKey.fromPrivateKey()` for generation
|
|
154
182
|
|
|
155
183
|
#### SIGNATURE_VERIFICATION_FAILED
|
|
184
|
+
|
|
156
185
|
**Code**: `SIGNATURE_VERIFICATION_FAILED`
|
|
157
186
|
**Message**: "Digital signature verification failed"
|
|
158
187
|
**Cause**: Signature doesn't match message and public key
|
|
159
188
|
**Solutions**:
|
|
189
|
+
|
|
160
190
|
- Verify message hash is correct
|
|
161
191
|
- Check signature format (DER encoding)
|
|
162
192
|
- Ensure correct public key is used
|
|
163
193
|
- Validate signature components (r, s values)
|
|
164
194
|
|
|
165
195
|
#### ENCRYPTION_FAILED
|
|
196
|
+
|
|
166
197
|
**Code**: `ENCRYPTION_FAILED`
|
|
167
198
|
**Message**: "Symmetric encryption operation failed"
|
|
168
199
|
**Cause**: AES encryption/decryption error
|
|
169
200
|
**Solutions**:
|
|
201
|
+
|
|
170
202
|
- Verify encryption key is valid
|
|
171
203
|
- Check data format and encoding
|
|
172
204
|
- Ensure proper IV/nonce usage
|
|
@@ -175,30 +207,36 @@ Complete reference for error codes, messages, and troubleshooting in the BSV Typ
|
|
|
175
207
|
### SPV Verification Errors
|
|
176
208
|
|
|
177
209
|
#### INVALID_MERKLE_PROOF
|
|
210
|
+
|
|
178
211
|
**Code**: `INVALID_MERKLE_PROOF`
|
|
179
212
|
**Message**: "Merkle proof verification failed"
|
|
180
213
|
**Cause**: Merkle path doesn't lead to valid root
|
|
181
214
|
**Solutions**:
|
|
215
|
+
|
|
182
216
|
- Verify merkle path structure
|
|
183
217
|
- Check transaction hash calculation
|
|
184
218
|
- Validate block header merkle root
|
|
185
219
|
- Ensure proof completeness
|
|
186
220
|
|
|
187
221
|
#### BLOCK_HEADER_INVALID
|
|
222
|
+
|
|
188
223
|
**Code**: `BLOCK_HEADER_INVALID`
|
|
189
224
|
**Message**: "Block header validation failed"
|
|
190
225
|
**Cause**: Block header doesn't meet consensus rules
|
|
191
226
|
**Solutions**:
|
|
227
|
+
|
|
192
228
|
- Verify header hash and difficulty
|
|
193
229
|
- Check timestamp validity
|
|
194
230
|
- Validate previous block hash
|
|
195
231
|
- Ensure proper header format
|
|
196
232
|
|
|
197
233
|
#### CHAIN_VALIDATION_FAILED
|
|
234
|
+
|
|
198
235
|
**Code**: `CHAIN_VALIDATION_FAILED`
|
|
199
236
|
**Message**: "Blockchain validation failed"
|
|
200
237
|
**Cause**: Chain doesn't follow consensus rules
|
|
201
238
|
**Solutions**:
|
|
239
|
+
|
|
202
240
|
- Verify chain continuity
|
|
203
241
|
- Check difficulty adjustments
|
|
204
242
|
- Validate block timestamps
|
|
@@ -207,20 +245,24 @@ Complete reference for error codes, messages, and troubleshooting in the BSV Typ
|
|
|
207
245
|
### Configuration Errors
|
|
208
246
|
|
|
209
247
|
#### INVALID_CONFIG
|
|
248
|
+
|
|
210
249
|
**Code**: `INVALID_CONFIG`
|
|
211
250
|
**Message**: "SDK configuration is invalid"
|
|
212
251
|
**Cause**: Configuration parameters are incorrect
|
|
213
252
|
**Solutions**:
|
|
253
|
+
|
|
214
254
|
- Validate configuration schema
|
|
215
255
|
- Check required parameters are present
|
|
216
256
|
- Verify network settings
|
|
217
257
|
- Use default configuration as baseline
|
|
218
258
|
|
|
219
259
|
#### UNSUPPORTED_NETWORK
|
|
260
|
+
|
|
220
261
|
**Code**: `UNSUPPORTED_NETWORK`
|
|
221
262
|
**Message**: "Network type is not supported"
|
|
222
263
|
**Cause**: Invalid network specification
|
|
223
264
|
**Solutions**:
|
|
265
|
+
|
|
224
266
|
- Use supported networks: mainnet, testnet, regtest
|
|
225
267
|
- Check network configuration
|
|
226
268
|
- Verify chain parameters
|
|
@@ -315,9 +357,11 @@ function categorizeError(error: WalletErrorObject): 'user' | 'network' | 'system
|
|
|
315
357
|
### Common Issues and Solutions
|
|
316
358
|
|
|
317
359
|
#### "RPC Error: no header should have returned false"
|
|
360
|
+
|
|
318
361
|
**Symptoms**: Error during `createAction` calls
|
|
319
362
|
**Cause**: Wallet input selection issues
|
|
320
363
|
**Solutions**:
|
|
364
|
+
|
|
321
365
|
1. Restart wallet application
|
|
322
366
|
2. Ensure wallet is fully synced
|
|
323
367
|
3. Use slightly larger amounts (200-500 satoshis)
|
|
@@ -325,27 +369,33 @@ function categorizeError(error: WalletErrorObject): 'user' | 'network' | 'system
|
|
|
325
369
|
5. Check for sufficient confirmed UTXOs
|
|
326
370
|
|
|
327
371
|
#### "Insufficient funds" with Available Balance
|
|
372
|
+
|
|
328
373
|
**Symptoms**: Error despite wallet showing balance
|
|
329
374
|
**Cause**: UTXOs not properly selected by wallet
|
|
330
375
|
**Solutions**:
|
|
376
|
+
|
|
331
377
|
1. Check UTXO status with `listOutputs()`
|
|
332
378
|
2. Verify UTXOs are confirmed
|
|
333
379
|
3. Restart wallet to refresh UTXO cache
|
|
334
380
|
4. Use manual input selection if supported
|
|
335
381
|
|
|
336
382
|
#### Transaction Broadcast Failures
|
|
383
|
+
|
|
337
384
|
**Symptoms**: Valid transactions rejected by network
|
|
338
385
|
**Cause**: Various network or validation issues
|
|
339
386
|
**Solutions**:
|
|
387
|
+
|
|
340
388
|
1. Verify transaction format and signatures
|
|
341
389
|
2. Check fee rates are adequate
|
|
342
390
|
3. Ensure inputs are unspent
|
|
343
391
|
4. Try alternative broadcast endpoints
|
|
344
392
|
|
|
345
393
|
#### Wallet Connection Issues
|
|
394
|
+
|
|
346
395
|
**Symptoms**: Cannot connect to wallet substrate
|
|
347
396
|
**Cause**: Wallet not running or permission issues
|
|
348
397
|
**Solutions**:
|
|
398
|
+
|
|
349
399
|
1. Ensure wallet application is running
|
|
350
400
|
2. Check originator domain permissions
|
|
351
401
|
3. Clear browser cache and cookies
|
|
@@ -30,6 +30,7 @@ export interface DisplayableIdentity {
|
|
|
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: IdentityClientOptions
|
|
34
35
|
|
|
35
36
|
```ts
|
|
@@ -46,6 +47,7 @@ See also: [WalletProtocol](./wallet.md#type-walletprotocol)
|
|
|
46
47
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
47
48
|
|
|
48
49
|
---
|
|
50
|
+
|
|
49
51
|
## Classes
|
|
50
52
|
|
|
51
53
|
### Class: IdentityClient
|
|
@@ -74,6 +76,7 @@ Parse out identity and certifier attributes to display from an IdentityCertifica
|
|
|
74
76
|
```ts
|
|
75
77
|
static parseIdentity(identityToParse: IdentityCertificate): DisplayableIdentity
|
|
76
78
|
```
|
|
79
|
+
|
|
77
80
|
See also: [DisplayableIdentity](./identity.md#interface-displayableidentity), [IdentityCertificate](./wallet.md#interface-identitycertificate)
|
|
78
81
|
|
|
79
82
|
Returns
|
|
@@ -82,10 +85,10 @@ Returns
|
|
|
82
85
|
|
|
83
86
|
Argument Details
|
|
84
87
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
- **serialNumber**
|
|
89
|
+
- Unique serial number of the certificate to revoke revelation
|
|
90
|
+
- **identityToParse**
|
|
91
|
+
- The Identity Certificate to parse
|
|
89
92
|
|
|
90
93
|
#### Method publiclyRevealAttributes
|
|
91
94
|
|
|
@@ -95,6 +98,7 @@ The publicly revealed certificate is included in a blockchain transaction and br
|
|
|
95
98
|
```ts
|
|
96
99
|
async publiclyRevealAttributes(certificate: WalletCertificate, fieldsToReveal: CertificateFieldNameUnder50Bytes[]): Promise<BroadcastResponse | BroadcastFailure>
|
|
97
100
|
```
|
|
101
|
+
|
|
98
102
|
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [WalletCertificate](./wallet.md#interface-walletcertificate)
|
|
99
103
|
|
|
100
104
|
Returns
|
|
@@ -103,10 +107,10 @@ A promise that resolves with the broadcast result from the overlay network.
|
|
|
103
107
|
|
|
104
108
|
Argument Details
|
|
105
109
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
- **certificate**
|
|
111
|
+
- The master certificate to selectively reveal.
|
|
112
|
+
- **fieldsToReveal**
|
|
113
|
+
- An array of certificate field names to reveal. Only these fields will be included in the public certificate.
|
|
110
114
|
|
|
111
115
|
Throws
|
|
112
116
|
|
|
@@ -119,6 +123,7 @@ Resolves displayable identity certificates by specific identity attributes, issu
|
|
|
119
123
|
```ts
|
|
120
124
|
async resolveByAttributes(args: DiscoverByAttributesArgs): Promise<DisplayableIdentity[]>
|
|
121
125
|
```
|
|
126
|
+
|
|
122
127
|
See also: [DiscoverByAttributesArgs](./wallet.md#interface-discoverbyattributesargs), [DisplayableIdentity](./identity.md#interface-displayableidentity)
|
|
123
128
|
|
|
124
129
|
Returns
|
|
@@ -127,8 +132,8 @@ The promise resolves to displayable identities.
|
|
|
127
132
|
|
|
128
133
|
Argument Details
|
|
129
134
|
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
- **args**
|
|
136
|
+
- Attributes and optional parameters used to discover certificates.
|
|
132
137
|
|
|
133
138
|
#### Method resolveByIdentityKey
|
|
134
139
|
|
|
@@ -137,6 +142,7 @@ Resolves displayable identity certificates, issued to a given identity key by a
|
|
|
137
142
|
```ts
|
|
138
143
|
async resolveByIdentityKey(args: DiscoverByIdentityKeyArgs): Promise<DisplayableIdentity[]>
|
|
139
144
|
```
|
|
145
|
+
|
|
140
146
|
See also: [DiscoverByIdentityKeyArgs](./wallet.md#interface-discoverbyidentitykeyargs), [DisplayableIdentity](./identity.md#interface-displayableidentity)
|
|
141
147
|
|
|
142
148
|
Returns
|
|
@@ -145,12 +151,13 @@ The promise resolves to displayable identities.
|
|
|
145
151
|
|
|
146
152
|
Argument Details
|
|
147
153
|
|
|
148
|
-
|
|
149
|
-
|
|
154
|
+
- **args**
|
|
155
|
+
- Arguments for requesting the discovery based on the identity key.
|
|
150
156
|
|
|
151
157
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
152
158
|
|
|
153
159
|
---
|
|
160
|
+
|
|
154
161
|
## Functions
|
|
155
162
|
|
|
156
163
|
## Types
|
|
@@ -185,6 +192,7 @@ See also: [IdentityClientOptions](./identity.md#interface-identityclientoptions)
|
|
|
185
192
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
186
193
|
|
|
187
194
|
---
|
|
195
|
+
|
|
188
196
|
### Variable: KNOWN_IDENTITY_TYPES
|
|
189
197
|
|
|
190
198
|
```ts
|
|
@@ -204,6 +212,7 @@ KNOWN_IDENTITY_TYPES = {
|
|
|
204
212
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
205
213
|
|
|
206
214
|
---
|
|
215
|
+
|
|
207
216
|
### Variable: defaultIdentity
|
|
208
217
|
|
|
209
218
|
```ts
|
package/docs/reference/index.md
CHANGED
|
@@ -5,6 +5,7 @@ Complete technical specifications and API documentation for the BSV TypeScript S
|
|
|
5
5
|
## Standards and Interfaces
|
|
6
6
|
|
|
7
7
|
### [BRC-100 Wallet Interface](./brc-100.md)
|
|
8
|
+
|
|
8
9
|
- Unified wallet-to-application interface standard
|
|
9
10
|
- WalletClient implementation details
|
|
10
11
|
- JSON API specifications
|
|
@@ -12,26 +13,31 @@ Complete technical specifications and API documentation for the BSV TypeScript S
|
|
|
12
13
|
## Core Classes
|
|
13
14
|
|
|
14
15
|
### [Transaction Class](./transaction.md)
|
|
16
|
+
|
|
15
17
|
- Constructor options and methods
|
|
16
18
|
- Input/output management
|
|
17
19
|
- Serialization formats
|
|
18
20
|
|
|
19
21
|
### [PrivateKey/PublicKey Classes](./primitives.md)
|
|
22
|
+
|
|
20
23
|
- Key generation methods
|
|
21
24
|
- Import/export formats
|
|
22
25
|
- Cryptographic operations
|
|
23
26
|
|
|
24
27
|
### [Transaction Signatures Reference](./transaction-signatures.md)
|
|
28
|
+
|
|
25
29
|
- ECDSA signature components
|
|
26
30
|
- DER encoding format
|
|
27
31
|
- Signature hash types (SIGHASH flags)
|
|
28
32
|
|
|
29
33
|
### [Script Classes](./script.md)
|
|
34
|
+
|
|
30
35
|
- Script construction utilities
|
|
31
36
|
- Standard script templates
|
|
32
37
|
- Custom script patterns
|
|
33
38
|
|
|
34
39
|
### [OP Codes Reference](./op-codes.md)
|
|
40
|
+
|
|
35
41
|
- Complete opcode listing and descriptions
|
|
36
42
|
- Opcode categories and usage patterns
|
|
37
43
|
- Script execution examples
|
|
@@ -39,17 +45,20 @@ Complete technical specifications and API documentation for the BSV TypeScript S
|
|
|
39
45
|
## Module Reference
|
|
40
46
|
|
|
41
47
|
### [Primitives Module](./primitives.md)
|
|
48
|
+
|
|
42
49
|
- Cryptographic primitives
|
|
43
50
|
- Hash functions
|
|
44
51
|
- Security implementation notes
|
|
45
52
|
|
|
46
53
|
### [Transaction Module](./transaction.md)
|
|
54
|
+
|
|
47
55
|
- Transaction lifecycle
|
|
48
56
|
- Fee calculation details
|
|
49
57
|
- Broadcasting options
|
|
50
58
|
- SPV verification
|
|
51
59
|
|
|
52
60
|
### [Wallet Module](./wallet.md)
|
|
61
|
+
|
|
53
62
|
- Wallet architecture patterns
|
|
54
63
|
- Integration guidelines
|
|
55
64
|
- BRC-100 compliance notes
|
|
@@ -57,6 +66,7 @@ Complete technical specifications and API documentation for the BSV TypeScript S
|
|
|
57
66
|
## Configuration Reference
|
|
58
67
|
|
|
59
68
|
### [SDK Configuration Options](./configuration.md)
|
|
69
|
+
|
|
60
70
|
```typescript
|
|
61
71
|
interface SDKConfig {
|
|
62
72
|
network: 'mainnet' | 'testnet' | 'regtest'
|
|
@@ -67,12 +77,14 @@ interface SDKConfig {
|
|
|
67
77
|
```
|
|
68
78
|
|
|
69
79
|
### [ARC Configuration](./arc-config.md)
|
|
80
|
+
|
|
70
81
|
- Endpoint configuration
|
|
71
82
|
- Authentication methods
|
|
72
83
|
- Rate limiting options
|
|
73
84
|
- Failover settings
|
|
74
85
|
|
|
75
86
|
### [Network Configuration](./network-config.md)
|
|
87
|
+
|
|
76
88
|
- Mainnet vs testnet settings
|
|
77
89
|
- Custom network parameters
|
|
78
90
|
- Node endpoint configurations
|
|
@@ -80,17 +92,18 @@ interface SDKConfig {
|
|
|
80
92
|
## Error Reference
|
|
81
93
|
|
|
82
94
|
### [Error Codes and Messages](./errors.md)
|
|
95
|
+
|
|
83
96
|
- Transaction validation errors
|
|
84
97
|
- Network connectivity errors
|
|
85
98
|
- Cryptographic operation errors
|
|
86
99
|
- Troubleshooting steps
|
|
87
100
|
|
|
88
101
|
### [Debugging Guide](./debugging.md)
|
|
102
|
+
|
|
89
103
|
- SDK logging configuration
|
|
90
104
|
- Debug mode activation
|
|
91
105
|
- Transaction inspection tools
|
|
92
106
|
|
|
93
|
-
|
|
94
107
|
## Swagger
|
|
95
108
|
|
|
96
109
|
[BRC-100](https://brc.dev/100) defines a Unified, Vendor-Neutral, Unchanging, and Open BSV Blockchain Standard Wallet-to-Application Interface which is implemented in this library within the WalletClient class. The API is laid out here as a swagger openapi document to offer a fast-track to understanding the interface which is implemented across multiple substrates. The JSON api is generally considered a developer friendly introduction to the WalletClient, where an binary equivalent ABI may be preferred for production use cases.
|
|
@@ -31,18 +31,19 @@ Creates an instance of the localKVStore.
|
|
|
31
31
|
```ts
|
|
32
32
|
constructor(wallet: WalletInterface = new WalletClient(), context = "kvstore default", encrypt = true, originator?: string, acceptDelayedBroadcast = false)
|
|
33
33
|
```
|
|
34
|
+
|
|
34
35
|
See also: [WalletClient](./wallet.md#class-walletclient), [WalletInterface](./wallet.md#interface-walletinterface), [encrypt](./messages.md#variable-encrypt)
|
|
35
36
|
|
|
36
37
|
Argument Details
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
- **wallet**
|
|
40
|
+
- The wallet interface to use. Defaults to a new WalletClient instance.
|
|
41
|
+
- **context**
|
|
42
|
+
- The context (basket) for namespacing keys. Defaults to 'kvstore default'.
|
|
43
|
+
- **encrypt**
|
|
44
|
+
- Whether to encrypt values. Defaults to true.
|
|
45
|
+
- **originator**
|
|
46
|
+
- — An originator to use with PushDrop and the wallet, if provided.
|
|
46
47
|
|
|
47
48
|
Throws
|
|
48
49
|
|
|
@@ -63,10 +64,10 @@ the defaultValue if the key is not found, or undefined if no defaultValue is pro
|
|
|
63
64
|
|
|
64
65
|
Argument Details
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
- **key**
|
|
68
|
+
- The key to retrieve the value for.
|
|
69
|
+
- **defaultValue**
|
|
70
|
+
- The value to return if the key is not found.
|
|
70
71
|
|
|
71
72
|
Throws
|
|
72
73
|
|
|
@@ -92,8 +93,8 @@ A promise that resolves to the txids of the removal transactions if successful.
|
|
|
92
93
|
|
|
93
94
|
Argument Details
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
- **key**
|
|
97
|
+
- The key to remove.
|
|
97
98
|
|
|
98
99
|
#### Method set
|
|
99
100
|
|
|
@@ -110,6 +111,7 @@ to the same key from missing earlier changes.
|
|
|
110
111
|
```ts
|
|
111
112
|
async set(key: string, value: string): Promise<OutpointString>
|
|
112
113
|
```
|
|
114
|
+
|
|
113
115
|
See also: [OutpointString](./wallet.md#type-outpointstring)
|
|
114
116
|
|
|
115
117
|
Returns
|
|
@@ -118,14 +120,15 @@ A promise that resolves to the outpoint string (txid.vout) of the new or updated
|
|
|
118
120
|
|
|
119
121
|
Argument Details
|
|
120
122
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
- **key**
|
|
124
|
+
- The key to set or update.
|
|
125
|
+
- **value**
|
|
126
|
+
- The value to associate with the key.
|
|
125
127
|
|
|
126
128
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
127
129
|
|
|
128
130
|
---
|
|
131
|
+
|
|
129
132
|
## Functions
|
|
130
133
|
|
|
131
134
|
## Types
|
|
@@ -133,4 +136,3 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
133
136
|
## Enums
|
|
134
137
|
|
|
135
138
|
## Variables
|
|
136
|
-
|
|
@@ -52,6 +52,7 @@ See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitiv
|
|
|
52
52
|
Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
|
|
53
53
|
|
|
54
54
|
---
|
|
55
|
+
|
|
55
56
|
### Variable: encrypt
|
|
56
57
|
|
|
57
58
|
```ts
|
|
@@ -81,6 +82,7 @@ See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitiv
|
|
|
81
82
|
Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
|
|
82
83
|
|
|
83
84
|
---
|
|
85
|
+
|
|
84
86
|
### Variable: sign
|
|
85
87
|
|
|
86
88
|
```ts
|
|
@@ -114,6 +116,7 @@ See also: [Curve](./primitives.md#class-curve), [PrivateKey](./primitives.md#cla
|
|
|
114
116
|
Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
|
|
115
117
|
|
|
116
118
|
---
|
|
119
|
+
|
|
117
120
|
### Variable: verify
|
|
118
121
|
|
|
119
122
|
```ts
|