@bsv/sdk 1.4.15 → 1.4.18

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.
Files changed (64) hide show
  1. package/dist/cjs/mod.js +1 -0
  2. package/dist/cjs/mod.js.map +1 -1
  3. package/dist/cjs/package.json +9 -9
  4. package/dist/cjs/src/kvstore/LocalKVStore.js +279 -0
  5. package/dist/cjs/src/kvstore/LocalKVStore.js.map +1 -0
  6. package/dist/cjs/src/kvstore/index.js +9 -0
  7. package/dist/cjs/src/kvstore/index.js.map +1 -0
  8. package/dist/cjs/src/wallet/WERR_REVIEW_ACTIONS.js +29 -0
  9. package/dist/cjs/src/wallet/WERR_REVIEW_ACTIONS.js.map +1 -0
  10. package/dist/cjs/src/wallet/WalletError.js +4 -3
  11. package/dist/cjs/src/wallet/WalletError.js.map +1 -1
  12. package/dist/cjs/src/wallet/index.js +4 -1
  13. package/dist/cjs/src/wallet/index.js.map +1 -1
  14. package/dist/cjs/src/wallet/substrates/HTTPWalletJSON.js +13 -6
  15. package/dist/cjs/src/wallet/substrates/HTTPWalletJSON.js.map +1 -1
  16. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  17. package/dist/esm/mod.js +1 -0
  18. package/dist/esm/mod.js.map +1 -1
  19. package/dist/esm/src/kvstore/LocalKVStore.js +273 -0
  20. package/dist/esm/src/kvstore/LocalKVStore.js.map +1 -0
  21. package/dist/esm/src/kvstore/index.js +2 -0
  22. package/dist/esm/src/kvstore/index.js.map +1 -0
  23. package/dist/esm/src/wallet/WERR_REVIEW_ACTIONS.js +31 -0
  24. package/dist/esm/src/wallet/WERR_REVIEW_ACTIONS.js.map +1 -0
  25. package/dist/esm/src/wallet/WalletError.js +3 -2
  26. package/dist/esm/src/wallet/WalletError.js.map +1 -1
  27. package/dist/esm/src/wallet/index.js +2 -0
  28. package/dist/esm/src/wallet/index.js.map +1 -1
  29. package/dist/esm/src/wallet/substrates/HTTPWalletJSON.js +13 -6
  30. package/dist/esm/src/wallet/substrates/HTTPWalletJSON.js.map +1 -1
  31. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  32. package/dist/types/mod.d.ts +1 -0
  33. package/dist/types/mod.d.ts.map +1 -1
  34. package/dist/types/src/kvstore/LocalKVStore.d.ts +85 -0
  35. package/dist/types/src/kvstore/LocalKVStore.d.ts.map +1 -0
  36. package/dist/types/src/kvstore/index.d.ts +2 -0
  37. package/dist/types/src/kvstore/index.d.ts.map +1 -0
  38. package/dist/types/src/wallet/WERR_REVIEW_ACTIONS.d.ts +23 -0
  39. package/dist/types/src/wallet/WERR_REVIEW_ACTIONS.d.ts.map +1 -0
  40. package/dist/types/src/wallet/Wallet.interfaces.d.ts +22 -0
  41. package/dist/types/src/wallet/Wallet.interfaces.d.ts.map +1 -1
  42. package/dist/types/src/wallet/WalletError.d.ts +4 -3
  43. package/dist/types/src/wallet/WalletError.d.ts.map +1 -1
  44. package/dist/types/src/wallet/index.d.ts +1 -0
  45. package/dist/types/src/wallet/index.d.ts.map +1 -1
  46. package/dist/types/src/wallet/substrates/HTTPWalletJSON.d.ts.map +1 -1
  47. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  48. package/dist/umd/bundle.js +1 -1
  49. package/docs/identity.md +225 -0
  50. package/docs/kvstore.md +133 -0
  51. package/docs/registry.md +383 -0
  52. package/docs/transaction.md +3 -3
  53. package/docs/wallet.md +146 -38
  54. package/mod.ts +2 -1
  55. package/package.json +19 -9
  56. package/src/kvstore/LocalKVStore.ts +287 -0
  57. package/src/kvstore/__tests/LocalKVStore.test.ts +614 -0
  58. package/src/kvstore/index.ts +1 -0
  59. package/src/wallet/WERR_REVIEW_ACTIONS.ts +30 -0
  60. package/src/wallet/Wallet.interfaces.ts +24 -0
  61. package/src/wallet/WalletError.ts +4 -2
  62. package/src/wallet/index.ts +2 -0
  63. package/src/wallet/substrates/HTTPWalletJSON.ts +12 -6
  64. package/docs/wallet-substrates.md +0 -1194
@@ -0,0 +1,383 @@
1
+ # API
2
+
3
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
4
+
5
+ ## Interfaces
6
+
7
+ | |
8
+ | --- |
9
+ | [BasketDefinitionData](#interface-basketdefinitiondata) |
10
+ | [BasketQuery](#interface-basketquery) |
11
+ | [CertificateDefinitionData](#interface-certificatedefinitiondata) |
12
+ | [CertificateFieldDescriptor](#interface-certificatefielddescriptor) |
13
+ | [CertificateQuery](#interface-certificatequery) |
14
+ | [ProtocolDefinitionData](#interface-protocoldefinitiondata) |
15
+ | [ProtocolQuery](#interface-protocolquery) |
16
+ | [RegistryQueryMapping](#interface-registryquerymapping) |
17
+ | [TokenData](#interface-tokendata) |
18
+
19
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
20
+
21
+ ---
22
+
23
+ ### Interface: BasketDefinitionData
24
+
25
+ Registry data for a Basket-style record.
26
+
27
+ ```ts
28
+ export interface BasketDefinitionData {
29
+ definitionType: "basket";
30
+ basketID: string;
31
+ name: string;
32
+ iconURL: string;
33
+ description: string;
34
+ documentationURL: string;
35
+ registryOperator?: PubKeyHex;
36
+ }
37
+ ```
38
+
39
+ See also: [PubKeyHex](./wallet.md#type-pubkeyhex)
40
+
41
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
42
+
43
+ ---
44
+ ### Interface: BasketQuery
45
+
46
+ When searching for basket definitions, we can filter by:
47
+ - basketID
48
+ - registryOperators
49
+ - name
50
+
51
+ ```ts
52
+ export interface BasketQuery {
53
+ basketID?: string;
54
+ registryOperators?: string[];
55
+ name?: string;
56
+ }
57
+ ```
58
+
59
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
60
+
61
+ ---
62
+ ### Interface: CertificateDefinitionData
63
+
64
+ Registry data for a Certificate-style record.
65
+
66
+ ```ts
67
+ export interface CertificateDefinitionData {
68
+ definitionType: "certificate";
69
+ type: string;
70
+ name: string;
71
+ iconURL: string;
72
+ description: string;
73
+ documentationURL: string;
74
+ fields: Record<string, CertificateFieldDescriptor>;
75
+ registryOperator?: PubKeyHex;
76
+ }
77
+ ```
78
+
79
+ See also: [CertificateFieldDescriptor](./registry.md#interface-certificatefielddescriptor), [PubKeyHex](./wallet.md#type-pubkeyhex)
80
+
81
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
82
+
83
+ ---
84
+ ### Interface: CertificateFieldDescriptor
85
+
86
+ Describes a re-usable structure for certificate fields (used by CertMap).
87
+
88
+ ```ts
89
+ export interface CertificateFieldDescriptor {
90
+ friendlyName: string;
91
+ description: string;
92
+ type: "text" | "imageURL" | "other";
93
+ fieldIcon: string;
94
+ }
95
+ ```
96
+
97
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
98
+
99
+ ---
100
+ ### Interface: CertificateQuery
101
+
102
+ When searching for certificate definitions, we can filter by:
103
+ - type
104
+ - name
105
+ - registryOperators
106
+
107
+ ```ts
108
+ export interface CertificateQuery {
109
+ type?: string;
110
+ name?: string;
111
+ registryOperators?: string[];
112
+ }
113
+ ```
114
+
115
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
116
+
117
+ ---
118
+ ### Interface: ProtocolDefinitionData
119
+
120
+ Registry data for a Protocol-style record.
121
+
122
+ ```ts
123
+ export interface ProtocolDefinitionData {
124
+ definitionType: "protocol";
125
+ protocolID: WalletProtocol;
126
+ name: string;
127
+ iconURL: string;
128
+ description: string;
129
+ documentationURL: string;
130
+ registryOperator?: PubKeyHex;
131
+ }
132
+ ```
133
+
134
+ See also: [PubKeyHex](./wallet.md#type-pubkeyhex), [WalletProtocol](./wallet.md#type-walletprotocol)
135
+
136
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
137
+
138
+ ---
139
+ ### Interface: ProtocolQuery
140
+
141
+ When searching for protocol definitions, we can filter by:
142
+ - name
143
+ - registryOperators
144
+ - protocolID
145
+
146
+ ```ts
147
+ export interface ProtocolQuery {
148
+ name?: string;
149
+ registryOperators?: string[];
150
+ protocolID?: WalletProtocol;
151
+ }
152
+ ```
153
+
154
+ See also: [WalletProtocol](./wallet.md#type-walletprotocol)
155
+
156
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
157
+
158
+ ---
159
+ ### Interface: RegistryQueryMapping
160
+
161
+ A lookup-service mapping of queries by each definition type.
162
+
163
+ ```ts
164
+ export interface RegistryQueryMapping {
165
+ basket: BasketQuery;
166
+ protocol: ProtocolQuery;
167
+ certificate: CertificateQuery;
168
+ }
169
+ ```
170
+
171
+ See also: [BasketQuery](./registry.md#interface-basketquery), [CertificateQuery](./registry.md#interface-certificatequery), [ProtocolQuery](./registry.md#interface-protocolquery)
172
+
173
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
174
+
175
+ ---
176
+ ### Interface: TokenData
177
+
178
+ Common info for the on-chain token/UTXO that points to a registry entry.
179
+
180
+ ```ts
181
+ export interface TokenData {
182
+ txid: string;
183
+ outputIndex: number;
184
+ satoshis: number;
185
+ lockingScript: string;
186
+ beef: BEEF;
187
+ }
188
+ ```
189
+
190
+ See also: [BEEF](./wallet.md#type-beef)
191
+
192
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
193
+
194
+ ---
195
+ ## Classes
196
+
197
+ ### Class: RegistryClient
198
+
199
+ RegistryClient manages on-chain registry definitions for three types:
200
+ - basket (basket-based items)
201
+ - protocol (protocol-based items)
202
+ - certificate (certificate-based items)
203
+
204
+ It provides methods to:
205
+ - Register new definitions using pushdrop-based UTXOs.
206
+ - Resolve existing definitions using a lookup service.
207
+ - List registry entries associated with the operator's wallet.
208
+ - Revoke an existing registry entry by spending its UTXO.
209
+
210
+ Registry operators use this client to establish and manage
211
+ canonical references for baskets, protocols, and certificate types.
212
+
213
+ ```ts
214
+ export class RegistryClient {
215
+ constructor(private readonly wallet: WalletInterface = new WalletClient())
216
+ async registerDefinition(data: DefinitionData): Promise<BroadcastResponse | BroadcastFailure>
217
+ async resolve<T extends DefinitionType>(definitionType: T, query: RegistryQueryMapping[T]): Promise<DefinitionData[]>
218
+ async listOwnRegistryEntries(definitionType: DefinitionType): Promise<RegistryRecord[]>
219
+ async revokeOwnRegistryEntry(registryRecord: RegistryRecord): Promise<BroadcastResponse | BroadcastFailure>
220
+ }
221
+ ```
222
+
223
+ See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [DefinitionData](./registry.md#type-definitiondata), [DefinitionType](./registry.md#type-definitiontype), [RegistryQueryMapping](./registry.md#interface-registryquerymapping), [RegistryRecord](./registry.md#type-registryrecord), [WalletClient](./wallet.md#class-walletclient), [WalletInterface](./wallet.md#interface-walletinterface)
224
+
225
+ #### Method listOwnRegistryEntries
226
+
227
+ Lists the registry operator's published definitions for the given type.
228
+
229
+ Returns parsed registry records including transaction details such as txid, outputIndex, satoshis, and the locking script.
230
+
231
+ ```ts
232
+ async listOwnRegistryEntries(definitionType: DefinitionType): Promise<RegistryRecord[]>
233
+ ```
234
+ See also: [DefinitionType](./registry.md#type-definitiontype), [RegistryRecord](./registry.md#type-registryrecord)
235
+
236
+ Returns
237
+
238
+ A promise that resolves to an array of RegistryRecord objects.
239
+
240
+ Argument Details
241
+
242
+ + **definitionType**
243
+ + The type of registry definition to list ('basket', 'protocol', or 'certificate').
244
+
245
+ #### Method registerDefinition
246
+
247
+ Publishes a new on-chain definition for baskets, protocols, or certificates.
248
+ The definition data is encoded in a pushdrop-based UTXO.
249
+
250
+ Registry operators (i.e., identity key owners) can create these definitions
251
+ to establish canonical references for basket IDs, protocol specs, or certificate schemas.
252
+
253
+ ```ts
254
+ async registerDefinition(data: DefinitionData): Promise<BroadcastResponse | BroadcastFailure>
255
+ ```
256
+ See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [DefinitionData](./registry.md#type-definitiondata)
257
+
258
+ Returns
259
+
260
+ A promise with the broadcast result or failure.
261
+
262
+ Argument Details
263
+
264
+ + **data**
265
+ + Structured information about a 'basket', 'protocol', or 'certificate'.
266
+
267
+ #### Method resolve
268
+
269
+ Resolves registrant tokens of a particular type using a lookup service.
270
+
271
+ The query object shape depends on the registry type:
272
+ - For "basket", the query is of type BasketMapQuery:
273
+ { basketID?: string; name?: string; registryOperators?: string[]; }
274
+ - For "protocol", the query is of type ProtoMapQuery:
275
+ { name?: string; registryOperators?: string[]; protocolID?: WalletProtocol; }
276
+ - For "certificate", the query is of type CertMapQuery:
277
+ { type?: string; name?: string; registryOperators?: string[]; }
278
+
279
+ ```ts
280
+ async resolve<T extends DefinitionType>(definitionType: T, query: RegistryQueryMapping[T]): Promise<DefinitionData[]>
281
+ ```
282
+ See also: [DefinitionData](./registry.md#type-definitiondata), [DefinitionType](./registry.md#type-definitiontype), [RegistryQueryMapping](./registry.md#interface-registryquerymapping)
283
+
284
+ Returns
285
+
286
+ A promise that resolves to an array of matching registry records.
287
+
288
+ Argument Details
289
+
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.
294
+
295
+ #### Method revokeOwnRegistryEntry
296
+
297
+ Revokes a registry record by spending its associated UTXO.
298
+
299
+ ```ts
300
+ async revokeOwnRegistryEntry(registryRecord: RegistryRecord): Promise<BroadcastResponse | BroadcastFailure>
301
+ ```
302
+ See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [RegistryRecord](./registry.md#type-registryrecord)
303
+
304
+ Returns
305
+
306
+ Broadcast success/failure.
307
+
308
+ Argument Details
309
+
310
+ + **registryRecord**
311
+ + Must have valid txid, outputIndex, and lockingScript.
312
+
313
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
314
+
315
+ ---
316
+ ## Functions
317
+
318
+ ### Function: deserializeWalletProtocol
319
+
320
+ ```ts
321
+ export function deserializeWalletProtocol(str: string): WalletProtocol
322
+ ```
323
+
324
+ See also: [WalletProtocol](./wallet.md#type-walletprotocol)
325
+
326
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
327
+
328
+ ---
329
+ ## Types
330
+
331
+ | |
332
+ | --- |
333
+ | [DefinitionData](#type-definitiondata) |
334
+ | [DefinitionType](#type-definitiontype) |
335
+ | [RegistryRecord](#type-registryrecord) |
336
+
337
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
338
+
339
+ ---
340
+
341
+ ### Type: DefinitionData
342
+
343
+ Union of all possible definition data objects.
344
+
345
+ ```ts
346
+ export type DefinitionData = BasketDefinitionData | ProtocolDefinitionData | CertificateDefinitionData
347
+ ```
348
+
349
+ See also: [BasketDefinitionData](./registry.md#interface-basketdefinitiondata), [CertificateDefinitionData](./registry.md#interface-certificatedefinitiondata), [ProtocolDefinitionData](./registry.md#interface-protocoldefinitiondata)
350
+
351
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
352
+
353
+ ---
354
+ ### Type: DefinitionType
355
+
356
+ We unify the registry “type” to these three strings everywhere:
357
+ 'basket' | 'protocol' | 'certificate'
358
+
359
+ ```ts
360
+ export type DefinitionType = "basket" | "protocol" | "certificate"
361
+ ```
362
+
363
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
364
+
365
+ ---
366
+ ### Type: RegistryRecord
367
+
368
+ A registry record is a combination of the typed definition data
369
+ plus the on-chain token data for the UTXO holding it.
370
+
371
+ ```ts
372
+ export type RegistryRecord = DefinitionData & TokenData
373
+ ```
374
+
375
+ See also: [DefinitionData](./registry.md#type-definitiondata), [TokenData](./registry.md#interface-tokendata)
376
+
377
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
378
+
379
+ ---
380
+ ## Enums
381
+
382
+ ## Variables
383
+
@@ -1477,7 +1477,7 @@ export default class Transaction {
1477
1477
  addOutput(output: TransactionOutput): void
1478
1478
  addP2PKHOutput(address: number[] | string, satoshis?: number): void
1479
1479
  updateMetadata(metadata: Record<string, any>): void
1480
- async fee(modelOrFee: FeeModel | number = new SatoshisPerKilobyte(10), changeDistribution: "equal" | "random" = "equal"): Promise<void>
1480
+ async fee(modelOrFee: FeeModel | number = new SatoshisPerKilobyte(1), changeDistribution: "equal" | "random" = "equal"): Promise<void>
1481
1481
  getFee(): number
1482
1482
  async sign(): Promise<void>
1483
1483
  async broadcast(broadcaster: Broadcaster = defaultBroadcaster()): Promise<BroadcastResponse | BroadcastFailure>
@@ -1567,11 +1567,11 @@ Argument Details
1567
1567
  #### Method fee
1568
1568
 
1569
1569
  Computes fees prior to signing.
1570
- If no fee model is provided, uses a SatoshisPerKilobyte fee model that pays 10 sat/kb.
1570
+ If no fee model is provided, uses a SatoshisPerKilobyte fee model that pays 1 sat/kb.
1571
1571
  If fee is a number, the transaction uses that value as fee.
1572
1572
 
1573
1573
  ```ts
1574
- async fee(modelOrFee: FeeModel | number = new SatoshisPerKilobyte(10), changeDistribution: "equal" | "random" = "equal"): Promise<void>
1574
+ async fee(modelOrFee: FeeModel | number = new SatoshisPerKilobyte(1), changeDistribution: "equal" | "random" = "equal"): Promise<void>
1575
1575
  ```
1576
1576
  See also: [FeeModel](./transaction.md#interface-feemodel), [SatoshisPerKilobyte](./transaction.md#class-satoshisperkilobyte)
1577
1577
 
package/docs/wallet.md CHANGED
@@ -6,30 +6,31 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
6
6
 
7
7
  | | | |
8
8
  | --- | --- | --- |
9
- | [AbortActionArgs](#interface-abortactionargs) | [GetVersionResult](#interface-getversionresult) | [SendWithResult](#interface-sendwithresult) |
10
- | [AbortActionResult](#interface-abortactionresult) | [IdentityCertificate](#interface-identitycertificate) | [SignActionArgs](#interface-signactionargs) |
11
- | [AcquireCertificateArgs](#interface-acquirecertificateargs) | [IdentityCertifier](#interface-identitycertifier) | [SignActionOptions](#interface-signactionoptions) |
12
- | [AuthenticatedResult](#interface-authenticatedresult) | [InternalizeActionArgs](#interface-internalizeactionargs) | [SignActionResult](#interface-signactionresult) |
13
- | [BasketInsertion](#interface-basketinsertion) | [InternalizeActionResult](#interface-internalizeactionresult) | [SignActionSpend](#interface-signactionspend) |
14
- | [CertificateResult](#interface-certificateresult) | [InternalizeOutput](#interface-internalizeoutput) | [SignableTransaction](#interface-signabletransaction) |
15
- | [CreateActionArgs](#interface-createactionargs) | [KeyDeriverApi](#interface-keyderiverapi) | [VerifyHmacArgs](#interface-verifyhmacargs) |
16
- | [CreateActionInput](#interface-createactioninput) | [KeyLinkageResult](#interface-keylinkageresult) | [VerifyHmacResult](#interface-verifyhmacresult) |
17
- | [CreateActionOptions](#interface-createactionoptions) | [ListActionsArgs](#interface-listactionsargs) | [VerifySignatureArgs](#interface-verifysignatureargs) |
18
- | [CreateActionOutput](#interface-createactionoutput) | [ListActionsResult](#interface-listactionsresult) | [VerifySignatureResult](#interface-verifysignatureresult) |
19
- | [CreateActionResult](#interface-createactionresult) | [ListCertificatesArgs](#interface-listcertificatesargs) | [WalletAction](#interface-walletaction) |
20
- | [CreateHmacArgs](#interface-createhmacargs) | [ListCertificatesResult](#interface-listcertificatesresult) | [WalletActionInput](#interface-walletactioninput) |
21
- | [CreateHmacResult](#interface-createhmacresult) | [ListOutputsArgs](#interface-listoutputsargs) | [WalletActionOutput](#interface-walletactionoutput) |
22
- | [CreateSignatureArgs](#interface-createsignatureargs) | [ListOutputsResult](#interface-listoutputsresult) | [WalletCertificate](#interface-walletcertificate) |
23
- | [CreateSignatureResult](#interface-createsignatureresult) | [ProveCertificateArgs](#interface-provecertificateargs) | [WalletDecryptArgs](#interface-walletdecryptargs) |
24
- | [DiscoverByAttributesArgs](#interface-discoverbyattributesargs) | [ProveCertificateResult](#interface-provecertificateresult) | [WalletDecryptResult](#interface-walletdecryptresult) |
25
- | [DiscoverByIdentityKeyArgs](#interface-discoverbyidentitykeyargs) | [RelinquishCertificateArgs](#interface-relinquishcertificateargs) | [WalletEncryptArgs](#interface-walletencryptargs) |
26
- | [DiscoverCertificatesResult](#interface-discovercertificatesresult) | [RelinquishCertificateResult](#interface-relinquishcertificateresult) | [WalletEncryptResult](#interface-walletencryptresult) |
27
- | [GetHeaderArgs](#interface-getheaderargs) | [RelinquishOutputArgs](#interface-relinquishoutputargs) | [WalletEncryptionArgs](#interface-walletencryptionargs) |
28
- | [GetHeaderResult](#interface-getheaderresult) | [RelinquishOutputResult](#interface-relinquishoutputresult) | [WalletErrorObject](#interface-walleterrorobject) |
29
- | [GetHeightResult](#interface-getheightresult) | [RevealCounterpartyKeyLinkageArgs](#interface-revealcounterpartykeylinkageargs) | [WalletInterface](#interface-walletinterface) |
30
- | [GetNetworkResult](#interface-getnetworkresult) | [RevealCounterpartyKeyLinkageResult](#interface-revealcounterpartykeylinkageresult) | [WalletOutput](#interface-walletoutput) |
31
- | [GetPublicKeyArgs](#interface-getpublickeyargs) | [RevealSpecificKeyLinkageArgs](#interface-revealspecifickeylinkageargs) | [WalletPayment](#interface-walletpayment) |
32
- | [GetPublicKeyResult](#interface-getpublickeyresult) | [RevealSpecificKeyLinkageResult](#interface-revealspecifickeylinkageresult) | [WalletWire](#interface-walletwire) |
9
+ | [AbortActionArgs](#interface-abortactionargs) | [IdentityCertificate](#interface-identitycertificate) | [SignActionArgs](#interface-signactionargs) |
10
+ | [AbortActionResult](#interface-abortactionresult) | [IdentityCertifier](#interface-identitycertifier) | [SignActionOptions](#interface-signactionoptions) |
11
+ | [AcquireCertificateArgs](#interface-acquirecertificateargs) | [InternalizeActionArgs](#interface-internalizeactionargs) | [SignActionResult](#interface-signactionresult) |
12
+ | [AuthenticatedResult](#interface-authenticatedresult) | [InternalizeActionResult](#interface-internalizeactionresult) | [SignActionSpend](#interface-signactionspend) |
13
+ | [BasketInsertion](#interface-basketinsertion) | [InternalizeOutput](#interface-internalizeoutput) | [SignableTransaction](#interface-signabletransaction) |
14
+ | [CertificateResult](#interface-certificateresult) | [KeyDeriverApi](#interface-keyderiverapi) | [VerifyHmacArgs](#interface-verifyhmacargs) |
15
+ | [CreateActionArgs](#interface-createactionargs) | [KeyLinkageResult](#interface-keylinkageresult) | [VerifyHmacResult](#interface-verifyhmacresult) |
16
+ | [CreateActionInput](#interface-createactioninput) | [ListActionsArgs](#interface-listactionsargs) | [VerifySignatureArgs](#interface-verifysignatureargs) |
17
+ | [CreateActionOptions](#interface-createactionoptions) | [ListActionsResult](#interface-listactionsresult) | [VerifySignatureResult](#interface-verifysignatureresult) |
18
+ | [CreateActionOutput](#interface-createactionoutput) | [ListCertificatesArgs](#interface-listcertificatesargs) | [WalletAction](#interface-walletaction) |
19
+ | [CreateActionResult](#interface-createactionresult) | [ListCertificatesResult](#interface-listcertificatesresult) | [WalletActionInput](#interface-walletactioninput) |
20
+ | [CreateHmacArgs](#interface-createhmacargs) | [ListOutputsArgs](#interface-listoutputsargs) | [WalletActionOutput](#interface-walletactionoutput) |
21
+ | [CreateHmacResult](#interface-createhmacresult) | [ListOutputsResult](#interface-listoutputsresult) | [WalletCertificate](#interface-walletcertificate) |
22
+ | [CreateSignatureArgs](#interface-createsignatureargs) | [ProveCertificateArgs](#interface-provecertificateargs) | [WalletDecryptArgs](#interface-walletdecryptargs) |
23
+ | [CreateSignatureResult](#interface-createsignatureresult) | [ProveCertificateResult](#interface-provecertificateresult) | [WalletDecryptResult](#interface-walletdecryptresult) |
24
+ | [DiscoverByAttributesArgs](#interface-discoverbyattributesargs) | [RelinquishCertificateArgs](#interface-relinquishcertificateargs) | [WalletEncryptArgs](#interface-walletencryptargs) |
25
+ | [DiscoverByIdentityKeyArgs](#interface-discoverbyidentitykeyargs) | [RelinquishCertificateResult](#interface-relinquishcertificateresult) | [WalletEncryptResult](#interface-walletencryptresult) |
26
+ | [DiscoverCertificatesResult](#interface-discovercertificatesresult) | [RelinquishOutputArgs](#interface-relinquishoutputargs) | [WalletEncryptionArgs](#interface-walletencryptionargs) |
27
+ | [GetHeaderArgs](#interface-getheaderargs) | [RelinquishOutputResult](#interface-relinquishoutputresult) | [WalletErrorObject](#interface-walleterrorobject) |
28
+ | [GetHeaderResult](#interface-getheaderresult) | [RevealCounterpartyKeyLinkageArgs](#interface-revealcounterpartykeylinkageargs) | [WalletInterface](#interface-walletinterface) |
29
+ | [GetHeightResult](#interface-getheightresult) | [RevealCounterpartyKeyLinkageResult](#interface-revealcounterpartykeylinkageresult) | [WalletOutput](#interface-walletoutput) |
30
+ | [GetNetworkResult](#interface-getnetworkresult) | [RevealSpecificKeyLinkageArgs](#interface-revealspecifickeylinkageargs) | [WalletPayment](#interface-walletpayment) |
31
+ | [GetPublicKeyArgs](#interface-getpublickeyargs) | [RevealSpecificKeyLinkageResult](#interface-revealspecifickeylinkageresult) | [WalletWire](#interface-walletwire) |
32
+ | [GetPublicKeyResult](#interface-getpublickeyresult) | [ReviewActionResult](#interface-reviewactionresult) | |
33
+ | [GetVersionResult](#interface-getversionresult) | [SendWithResult](#interface-sendwithresult) | |
33
34
 
34
35
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
35
36
 
@@ -836,6 +837,38 @@ See also: [Byte](./wallet.md#type-byte), [KeyIDStringUnder800Bytes](./wallet.md#
836
837
 
837
838
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
838
839
 
840
+ ---
841
+ ### Interface: ReviewActionResult
842
+
843
+ ```ts
844
+ export interface ReviewActionResult {
845
+ txid: TXIDHexString;
846
+ status: ReviewActionResultStatus;
847
+ competingTxs?: string[];
848
+ competingBeef?: number[];
849
+ }
850
+ ```
851
+
852
+ See also: [ReviewActionResultStatus](./wallet.md#type-reviewactionresultstatus), [TXIDHexString](./wallet.md#type-txidhexstring)
853
+
854
+ #### Property competingBeef
855
+
856
+ Merged beef of competingTxs, valid when status is 'doubleSpend'.
857
+
858
+ ```ts
859
+ competingBeef?: number[]
860
+ ```
861
+
862
+ #### Property competingTxs
863
+
864
+ Any competing txids reported for this txid, valid when status is 'doubleSpend'.
865
+
866
+ ```ts
867
+ competingTxs?: string[]
868
+ ```
869
+
870
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
871
+
839
872
  ---
840
873
  ### Interface: SendWithResult
841
874
 
@@ -1502,6 +1535,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
1502
1535
  | [HTTPWalletWire](#class-httpwalletwire) |
1503
1536
  | [KeyDeriver](#class-keyderiver) |
1504
1537
  | [ProtoWallet](#class-protowallet) |
1538
+ | [WERR_REVIEW_ACTIONS](#class-werr_review_actions) |
1505
1539
  | [WalletClient](#class-walletclient) |
1506
1540
  | [WalletError](#class-walleterror) |
1507
1541
  | [WalletWireProcessor](#class-walletwireprocessor) |
@@ -2098,6 +2132,36 @@ See also: [CreateHmacArgs](./wallet.md#interface-createhmacargs), [CreateHmacRes
2098
2132
 
2099
2133
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
2100
2134
 
2135
+ ---
2136
+ ### Class: WERR_REVIEW_ACTIONS
2137
+
2138
+ When a `createAction` or `signAction` is completed in undelayed mode (`acceptDelayedBroadcast`: false),
2139
+ any unsucccessful result will return the results by way of this exception to ensure attention is
2140
+ paid to processing errors.
2141
+
2142
+ ```ts
2143
+ export class WERR_REVIEW_ACTIONS extends Error {
2144
+ code: number;
2145
+ isError: boolean = true;
2146
+ constructor(public reviewActionResults: ReviewActionResult[], public sendWithResults: SendWithResult[], public txid?: TXIDHexString, public tx?: AtomicBEEF, public noSendChange?: OutpointString[])
2147
+ }
2148
+ ```
2149
+
2150
+ See also: [AtomicBEEF](./wallet.md#type-atomicbeef), [OutpointString](./wallet.md#type-outpointstring), [ReviewActionResult](./wallet.md#interface-reviewactionresult), [SendWithResult](./wallet.md#interface-sendwithresult), [TXIDHexString](./wallet.md#type-txidhexstring)
2151
+
2152
+ #### Constructor
2153
+
2154
+ All parameters correspond to their comparable `createAction` or `signSction` results
2155
+ with the exception of `reviewActionResults`;
2156
+ which contains more details, particularly for double spend results.
2157
+
2158
+ ```ts
2159
+ constructor(public reviewActionResults: ReviewActionResult[], public sendWithResults: SendWithResult[], public txid?: TXIDHexString, public tx?: AtomicBEEF, public noSendChange?: OutpointString[])
2160
+ ```
2161
+ See also: [AtomicBEEF](./wallet.md#type-atomicbeef), [OutpointString](./wallet.md#type-outpointstring), [ReviewActionResult](./wallet.md#interface-reviewactionresult), [SendWithResult](./wallet.md#interface-sendwithresult), [TXIDHexString](./wallet.md#type-txidhexstring)
2162
+
2163
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
2164
+
2101
2165
  ---
2102
2166
  ### Class: WalletClient
2103
2167
 
@@ -3459,20 +3523,21 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
3459
3523
 
3460
3524
  | | | |
3461
3525
  | --- | --- | --- |
3462
- | [AcquireCertificateResult](#type-acquirecertificateresult) | [EntityIconURLStringMax500Bytes](#type-entityiconurlstringmax500bytes) | [PositiveIntegerMax10](#type-positiveintegermax10) |
3463
- | [AcquisitionProtocol](#type-acquisitionprotocol) | [EntityNameStringMax100Bytes](#type-entitynamestringmax100bytes) | [PositiveIntegerOrZero](#type-positiveintegerorzero) |
3464
- | [ActionStatus](#type-actionstatus) | [ErrorCodeString10To40Bytes](#type-errorcodestring10to40bytes) | [ProtocolString5To400Bytes](#type-protocolstring5to400bytes) |
3465
- | [AtomicBEEF](#type-atomicbeef) | [ErrorDescriptionString20To200Bytes](#type-errordescriptionstring20to200bytes) | [PubKeyHex](#type-pubkeyhex) |
3466
- | [BEEF](#type-beef) | [HexString](#type-hexstring) | [SatoshiValue](#type-satoshivalue) |
3467
- | [Base64String](#type-base64string) | [ISOTimestampString](#type-isotimestampstring) | [SecurityLevel](#type-securitylevel) |
3468
- | [BasketStringUnder300Bytes](#type-basketstringunder300bytes) | [KeyIDStringUnder800Bytes](#type-keyidstringunder800bytes) | [SendWithResultStatus](#type-sendwithresultstatus) |
3469
- | [BooleanDefaultFalse](#type-booleandefaultfalse) | [KeyringRevealer](#type-keyringrevealer) | [TXIDHexString](#type-txidhexstring) |
3470
- | [BooleanDefaultTrue](#type-booleandefaulttrue) | [LabelStringUnder300Bytes](#type-labelstringunder300bytes) | [TrustSelf](#type-trustself) |
3471
- | [Byte](#type-byte) | [OriginatorDomainNameStringUnder250Bytes](#type-originatordomainnamestringunder250bytes) | [VersionString7To30Bytes](#type-versionstring7to30bytes) |
3472
- | [CallType](#type-calltype) | [OutpointString](#type-outpointstring) | [WalletCounterparty](#type-walletcounterparty) |
3473
- | [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes) | [OutputTagStringUnder300Bytes](#type-outputtagstringunder300bytes) | [WalletErrorCode](#type-walleterrorcode) |
3474
- | [Counterparty](#type-counterparty) | [PositiveInteger](#type-positiveinteger) | [WalletNetwork](#type-walletnetwork) |
3475
- | [DescriptionString5to50Bytes](#type-descriptionstring5to50bytes) | [PositiveIntegerDefault10Max10000](#type-positiveintegerdefault10max10000) | [WalletProtocol](#type-walletprotocol) |
3526
+ | [AcquireCertificateResult](#type-acquirecertificateresult) | [EntityNameStringMax100Bytes](#type-entitynamestringmax100bytes) | [ProtocolString5To400Bytes](#type-protocolstring5to400bytes) |
3527
+ | [AcquisitionProtocol](#type-acquisitionprotocol) | [ErrorCodeString10To40Bytes](#type-errorcodestring10to40bytes) | [PubKeyHex](#type-pubkeyhex) |
3528
+ | [ActionStatus](#type-actionstatus) | [ErrorDescriptionString20To200Bytes](#type-errordescriptionstring20to200bytes) | [ReviewActionResultStatus](#type-reviewactionresultstatus) |
3529
+ | [AtomicBEEF](#type-atomicbeef) | [HexString](#type-hexstring) | [SatoshiValue](#type-satoshivalue) |
3530
+ | [BEEF](#type-beef) | [ISOTimestampString](#type-isotimestampstring) | [SecurityLevel](#type-securitylevel) |
3531
+ | [Base64String](#type-base64string) | [KeyIDStringUnder800Bytes](#type-keyidstringunder800bytes) | [SendWithResultStatus](#type-sendwithresultstatus) |
3532
+ | [BasketStringUnder300Bytes](#type-basketstringunder300bytes) | [KeyringRevealer](#type-keyringrevealer) | [TXIDHexString](#type-txidhexstring) |
3533
+ | [BooleanDefaultFalse](#type-booleandefaultfalse) | [LabelStringUnder300Bytes](#type-labelstringunder300bytes) | [TrustSelf](#type-trustself) |
3534
+ | [BooleanDefaultTrue](#type-booleandefaulttrue) | [OriginatorDomainNameStringUnder250Bytes](#type-originatordomainnamestringunder250bytes) | [VersionString7To30Bytes](#type-versionstring7to30bytes) |
3535
+ | [Byte](#type-byte) | [OutpointString](#type-outpointstring) | [WalletCounterparty](#type-walletcounterparty) |
3536
+ | [CallType](#type-calltype) | [OutputTagStringUnder300Bytes](#type-outputtagstringunder300bytes) | [WalletErrorCode](#type-walleterrorcode) |
3537
+ | [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes) | [PositiveInteger](#type-positiveinteger) | [WalletNetwork](#type-walletnetwork) |
3538
+ | [Counterparty](#type-counterparty) | [PositiveIntegerDefault10Max10000](#type-positiveintegerdefault10max10000) | [WalletProtocol](#type-walletprotocol) |
3539
+ | [DescriptionString5to50Bytes](#type-descriptionstring5to50bytes) | [PositiveIntegerMax10](#type-positiveintegermax10) | |
3540
+ | [EntityIconURLStringMax500Bytes](#type-entityiconurlstringmax500bytes) | [PositiveIntegerOrZero](#type-positiveintegerorzero) | |
3476
3541
 
3477
3542
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
3478
3543
 
@@ -3777,6 +3842,23 @@ See also: [HexString](./wallet.md#type-hexstring)
3777
3842
 
3778
3843
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
3779
3844
 
3845
+ ---
3846
+ ### Type: ReviewActionResultStatus
3847
+
3848
+ Indicates status of a new Action following a `createAction` or `signAction` in immediate mode:
3849
+ When `acceptDelayedBroadcast` is falses.
3850
+
3851
+ 'success': The action has been broadcast and accepted by the bitcoin processing network.
3852
+ 'doulbeSpend': The action has been confirmed to double spend one or more inputs, and by the "first-seen-rule" is the loosing transaction.
3853
+ 'invalidTx': The action was rejected by the processing network as an invalid bitcoin transaction.
3854
+ 'serviceError': The broadcast services are currently unable to reach the bitcoin network. The action is now queued for delayed retries.
3855
+
3856
+ ```ts
3857
+ export type ReviewActionResultStatus = "success" | "doubleSpend" | "serviceError" | "invalidTx"
3858
+ ```
3859
+
3860
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
3861
+
3780
3862
  ---
3781
3863
  ### Type: SatoshiValue
3782
3864
 
@@ -3863,6 +3945,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
3863
3945
  export type WalletErrorCode = keyof typeof walletErrors
3864
3946
  ```
3865
3947
 
3948
+ See also: [walletErrors](./wallet.md#enum-walleterrors)
3949
+
3866
3950
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
3867
3951
 
3868
3952
  ---
@@ -3891,6 +3975,15 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
3891
3975
  ---
3892
3976
  ## Enums
3893
3977
 
3978
+ | |
3979
+ | --- |
3980
+ | [SecurityLevels](#enum-securitylevels) |
3981
+ | [walletErrors](#enum-walleterrors) |
3982
+
3983
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
3984
+
3985
+ ---
3986
+
3894
3987
  ### Enum: SecurityLevels
3895
3988
 
3896
3989
  ```ts
@@ -3905,6 +3998,21 @@ See also: [Counterparty](./wallet.md#type-counterparty)
3905
3998
 
3906
3999
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
3907
4000
 
4001
+ ---
4002
+ ### Enum: walletErrors
4003
+
4004
+ ```ts
4005
+ export enum walletErrors {
4006
+ unknownError = 1,
4007
+ unsupportedAction = 2,
4008
+ invalidHmac = 3,
4009
+ invalidSignature = 4,
4010
+ reviewActions = 5
4011
+ }
4012
+ ```
4013
+
4014
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
4015
+
3908
4016
  ---
3909
4017
  ## Variables
3910
4018
 
package/mod.ts CHANGED
@@ -15,4 +15,5 @@ export * from './src/auth/index.js'
15
15
  export * from './src/overlay-tools/index.js'
16
16
  export * from './src/storage/index.js'
17
17
  export * from './src/identity/index.js'
18
- export * from './src/registry/index.js'
18
+ export * from './src/registry/index.js'
19
+ export * from './src/kvstore/index.js'