@bsv/sdk 1.4.17 → 1.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/kvstore/LocalKVStore.js +152 -141
- package/dist/cjs/src/kvstore/LocalKVStore.js.map +1 -1
- package/dist/cjs/src/storage/StorageUploader.js +122 -14
- package/dist/cjs/src/storage/StorageUploader.js.map +1 -1
- package/dist/cjs/src/storage/__test/StorageUploader.test.js +85 -14
- package/dist/cjs/src/storage/__test/StorageUploader.test.js.map +1 -1
- package/dist/cjs/src/wallet/WERR_REVIEW_ACTIONS.js +29 -0
- package/dist/cjs/src/wallet/WERR_REVIEW_ACTIONS.js.map +1 -0
- package/dist/cjs/src/wallet/WalletError.js +4 -3
- package/dist/cjs/src/wallet/WalletError.js.map +1 -1
- package/dist/cjs/src/wallet/index.js +4 -1
- package/dist/cjs/src/wallet/index.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/HTTPWalletJSON.js +13 -6
- package/dist/cjs/src/wallet/substrates/HTTPWalletJSON.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/kvstore/LocalKVStore.js +151 -141
- package/dist/esm/src/kvstore/LocalKVStore.js.map +1 -1
- package/dist/esm/src/storage/StorageUploader.js +119 -14
- package/dist/esm/src/storage/StorageUploader.js.map +1 -1
- package/dist/esm/src/storage/__test/StorageUploader.test.js +85 -14
- package/dist/esm/src/storage/__test/StorageUploader.test.js.map +1 -1
- package/dist/esm/src/wallet/WERR_REVIEW_ACTIONS.js +31 -0
- package/dist/esm/src/wallet/WERR_REVIEW_ACTIONS.js.map +1 -0
- package/dist/esm/src/wallet/WalletError.js +3 -2
- package/dist/esm/src/wallet/WalletError.js.map +1 -1
- package/dist/esm/src/wallet/index.js +2 -0
- package/dist/esm/src/wallet/index.js.map +1 -1
- package/dist/esm/src/wallet/substrates/HTTPWalletJSON.js +13 -6
- package/dist/esm/src/wallet/substrates/HTTPWalletJSON.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/kvstore/LocalKVStore.d.ts +10 -4
- package/dist/types/src/kvstore/LocalKVStore.d.ts.map +1 -1
- package/dist/types/src/storage/StorageUploader.d.ts +77 -14
- package/dist/types/src/storage/StorageUploader.d.ts.map +1 -1
- package/dist/types/src/wallet/WERR_REVIEW_ACTIONS.d.ts +23 -0
- package/dist/types/src/wallet/WERR_REVIEW_ACTIONS.d.ts.map +1 -0
- package/dist/types/src/wallet/Wallet.interfaces.d.ts +22 -0
- package/dist/types/src/wallet/Wallet.interfaces.d.ts.map +1 -1
- package/dist/types/src/wallet/WalletError.d.ts +4 -3
- package/dist/types/src/wallet/WalletError.d.ts.map +1 -1
- package/dist/types/src/wallet/index.d.ts +1 -0
- package/dist/types/src/wallet/index.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/HTTPWalletJSON.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/docs/kvstore.md +9 -8
- package/docs/storage.md +117 -7
- package/docs/wallet.md +146 -38
- package/package.json +1 -1
- package/src/kvstore/LocalKVStore.ts +156 -151
- package/src/kvstore/__tests/LocalKVStore.test.ts +104 -193
- package/src/storage/StorageUploader.ts +156 -14
- package/src/storage/__test/StorageUploader.test.ts +134 -15
- package/src/wallet/WERR_REVIEW_ACTIONS.ts +30 -0
- package/src/wallet/Wallet.interfaces.ts +24 -0
- package/src/wallet/WalletError.ts +4 -2
- package/src/wallet/index.ts +2 -0
- package/src/wallet/substrates/HTTPWalletJSON.ts +12 -6
package/docs/kvstore.md
CHANGED
|
@@ -14,10 +14,10 @@ Allows setting, getting, and removing key-value pairs, with optional encryption.
|
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
16
|
export default class LocalKVStore {
|
|
17
|
-
constructor(wallet: WalletInterface = new WalletClient(), context = "kvstore
|
|
17
|
+
constructor(wallet: WalletInterface = new WalletClient(), context = "kvstore default", encrypt = true, originator?: string)
|
|
18
18
|
async get(key: string, defaultValue: string | undefined = undefined): Promise<string | undefined>
|
|
19
19
|
async set(key: string, value: string): Promise<OutpointString>
|
|
20
|
-
async remove(key: string): Promise<
|
|
20
|
+
async remove(key: string): Promise<string[]>
|
|
21
21
|
}
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -28,7 +28,7 @@ See also: [OutpointString](./wallet.md#type-outpointstring), [WalletClient](./wa
|
|
|
28
28
|
Creates an instance of the localKVStore.
|
|
29
29
|
|
|
30
30
|
```ts
|
|
31
|
-
constructor(wallet: WalletInterface = new WalletClient(), context = "kvstore
|
|
31
|
+
constructor(wallet: WalletInterface = new WalletClient(), context = "kvstore default", encrypt = true, originator?: string)
|
|
32
32
|
```
|
|
33
33
|
See also: [WalletClient](./wallet.md#class-walletclient), [WalletInterface](./wallet.md#interface-walletinterface), [encrypt](./messages.md#variable-encrypt)
|
|
34
34
|
|
|
@@ -37,9 +37,11 @@ Argument Details
|
|
|
37
37
|
+ **wallet**
|
|
38
38
|
+ The wallet interface to use. Defaults to a new WalletClient instance.
|
|
39
39
|
+ **context**
|
|
40
|
-
+ The context (basket) for namespacing keys. Defaults to 'kvstore
|
|
40
|
+
+ The context (basket) for namespacing keys. Defaults to 'kvstore default'.
|
|
41
41
|
+ **encrypt**
|
|
42
42
|
+ Whether to encrypt values. Defaults to true.
|
|
43
|
+
+ **originator**
|
|
44
|
+
+ — An originator to use with PushDrop and the wallet, if provided.
|
|
43
45
|
|
|
44
46
|
Throws
|
|
45
47
|
|
|
@@ -67,7 +69,7 @@ Argument Details
|
|
|
67
69
|
|
|
68
70
|
Throws
|
|
69
71
|
|
|
70
|
-
If
|
|
72
|
+
If too many outputs are found for the key (ambiguous state).
|
|
71
73
|
|
|
72
74
|
If the found output's locking script cannot be decoded or represents an invalid token format.
|
|
73
75
|
|
|
@@ -80,13 +82,12 @@ If the key does not exist, it does nothing.
|
|
|
80
82
|
If signing the removal transaction fails, it relinquishes the original outputs instead of spending.
|
|
81
83
|
|
|
82
84
|
```ts
|
|
83
|
-
async remove(key: string): Promise<
|
|
85
|
+
async remove(key: string): Promise<string[]>
|
|
84
86
|
```
|
|
85
|
-
See also: [OutpointString](./wallet.md#type-outpointstring)
|
|
86
87
|
|
|
87
88
|
Returns
|
|
88
89
|
|
|
89
|
-
A promise that resolves to the
|
|
90
|
+
A promise that resolves to the txids of the removal transactions if successful.
|
|
90
91
|
|
|
91
92
|
Argument Details
|
|
92
93
|
|
package/docs/storage.md
CHANGED
|
@@ -8,6 +8,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8
8
|
| --- |
|
|
9
9
|
| [DownloadResult](#interface-downloadresult) |
|
|
10
10
|
| [DownloaderConfig](#interface-downloaderconfig) |
|
|
11
|
+
| [FindFileData](#interface-findfiledata) |
|
|
12
|
+
| [RenewFileResult](#interface-renewfileresult) |
|
|
11
13
|
| [UploadFileResult](#interface-uploadfileresult) |
|
|
12
14
|
| [UploadableFile](#interface-uploadablefile) |
|
|
13
15
|
| [UploaderConfig](#interface-uploaderconfig) |
|
|
@@ -38,6 +40,34 @@ export interface DownloaderConfig {
|
|
|
38
40
|
|
|
39
41
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
40
42
|
|
|
43
|
+
---
|
|
44
|
+
### Interface: FindFileData
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
export interface FindFileData {
|
|
48
|
+
name: string;
|
|
49
|
+
size: string;
|
|
50
|
+
mimeType: string;
|
|
51
|
+
expiryTime: number;
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
### Interface: RenewFileResult
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
export interface RenewFileResult {
|
|
62
|
+
status: string;
|
|
63
|
+
prevExpiryTime?: number;
|
|
64
|
+
newExpiryTime?: number;
|
|
65
|
+
amount?: number;
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
70
|
+
|
|
41
71
|
---
|
|
42
72
|
### Interface: UploadFileResult
|
|
43
73
|
|
|
@@ -107,6 +137,12 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
107
137
|
---
|
|
108
138
|
### Class: StorageUploader
|
|
109
139
|
|
|
140
|
+
The StorageUploader class provides client-side methods for:
|
|
141
|
+
- Uploading files with a specified retention period
|
|
142
|
+
- Finding file metadata by UHRP URL
|
|
143
|
+
- Listing all user uploads
|
|
144
|
+
- Renewing an existing advertisement's expiry time
|
|
145
|
+
|
|
110
146
|
```ts
|
|
111
147
|
export class StorageUploader {
|
|
112
148
|
constructor(config: UploaderConfig)
|
|
@@ -114,10 +150,65 @@ export class StorageUploader {
|
|
|
114
150
|
file: UploadableFile;
|
|
115
151
|
retentionPeriod: number;
|
|
116
152
|
}): Promise<UploadFileResult>
|
|
153
|
+
public async findFile(uhrpUrl: string): Promise<FindFileData>
|
|
154
|
+
public async listUploads(): Promise<any>
|
|
155
|
+
public async renewFile(uhrpUrl: string, additionalMinutes: number): Promise<RenewFileResult>
|
|
117
156
|
}
|
|
118
157
|
```
|
|
119
158
|
|
|
120
|
-
See also: [UploadFileResult](./storage.md#interface-uploadfileresult), [UploadableFile](./storage.md#interface-uploadablefile), [UploaderConfig](./storage.md#interface-uploaderconfig)
|
|
159
|
+
See also: [FindFileData](./storage.md#interface-findfiledata), [RenewFileResult](./storage.md#interface-renewfileresult), [UploadFileResult](./storage.md#interface-uploadfileresult), [UploadableFile](./storage.md#interface-uploadablefile), [UploaderConfig](./storage.md#interface-uploaderconfig)
|
|
160
|
+
|
|
161
|
+
#### Constructor
|
|
162
|
+
|
|
163
|
+
Creates a new StorageUploader instance.
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
constructor(config: UploaderConfig)
|
|
167
|
+
```
|
|
168
|
+
See also: [UploaderConfig](./storage.md#interface-uploaderconfig)
|
|
169
|
+
|
|
170
|
+
Argument Details
|
|
171
|
+
|
|
172
|
+
+ **config**
|
|
173
|
+
+ An object containing the storage server's URL and a wallet interface
|
|
174
|
+
|
|
175
|
+
#### Method findFile
|
|
176
|
+
|
|
177
|
+
Retrieves metadata for a file matching the given UHRP URL from the `/find` route.
|
|
178
|
+
|
|
179
|
+
```ts
|
|
180
|
+
public async findFile(uhrpUrl: string): Promise<FindFileData>
|
|
181
|
+
```
|
|
182
|
+
See also: [FindFileData](./storage.md#interface-findfiledata)
|
|
183
|
+
|
|
184
|
+
Returns
|
|
185
|
+
|
|
186
|
+
An object with file name, size, MIME type, and expiry time
|
|
187
|
+
|
|
188
|
+
Argument Details
|
|
189
|
+
|
|
190
|
+
+ **uhrpUrl**
|
|
191
|
+
+ The UHRP URL, e.g. "uhrp://abcd..."
|
|
192
|
+
|
|
193
|
+
Throws
|
|
194
|
+
|
|
195
|
+
If the server or the route returns an error
|
|
196
|
+
|
|
197
|
+
#### Method listUploads
|
|
198
|
+
|
|
199
|
+
Lists all advertisements belonging to the user from the `/list` route.
|
|
200
|
+
|
|
201
|
+
```ts
|
|
202
|
+
public async listUploads(): Promise<any>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Returns
|
|
206
|
+
|
|
207
|
+
The array of uploads returned by the server
|
|
208
|
+
|
|
209
|
+
Throws
|
|
210
|
+
|
|
211
|
+
If the server or the route returns an error
|
|
121
212
|
|
|
122
213
|
#### Method publishFile
|
|
123
214
|
|
|
@@ -138,18 +229,37 @@ See also: [UploadFileResult](./storage.md#interface-uploadfileresult), [Uploadab
|
|
|
138
229
|
|
|
139
230
|
Returns
|
|
140
231
|
|
|
141
|
-
An object
|
|
232
|
+
An object with the file's UHRP URL
|
|
233
|
+
|
|
234
|
+
Throws
|
|
235
|
+
|
|
236
|
+
If the server or upload step returns a non-OK response
|
|
237
|
+
|
|
238
|
+
#### Method renewFile
|
|
239
|
+
|
|
240
|
+
Renews the hosting time for an existing file advertisement identified by uhrpUrl.
|
|
241
|
+
Calls the `/renew` route to add `additionalMinutes` to the GCS customTime
|
|
242
|
+
and re-mint the advertisement token on-chain.
|
|
243
|
+
|
|
244
|
+
```ts
|
|
245
|
+
public async renewFile(uhrpUrl: string, additionalMinutes: number): Promise<RenewFileResult>
|
|
246
|
+
```
|
|
247
|
+
See also: [RenewFileResult](./storage.md#interface-renewfileresult)
|
|
248
|
+
|
|
249
|
+
Returns
|
|
250
|
+
|
|
251
|
+
An object with the new and previous expiry times, plus any cost
|
|
142
252
|
|
|
143
253
|
Argument Details
|
|
144
254
|
|
|
145
|
-
+ **
|
|
146
|
-
+
|
|
147
|
-
+ **
|
|
148
|
-
+
|
|
255
|
+
+ **uhrpUrl**
|
|
256
|
+
+ The UHRP URL of the file (e.g., "uhrp://abcd1234...")
|
|
257
|
+
+ **additionalMinutes**
|
|
258
|
+
+ The number of minutes to extend
|
|
149
259
|
|
|
150
260
|
Throws
|
|
151
261
|
|
|
152
|
-
If
|
|
262
|
+
If the request fails or the server returns an error
|
|
153
263
|
|
|
154
264
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
155
265
|
|
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) | [
|
|
10
|
-
| [AbortActionResult](#interface-abortactionresult) | [
|
|
11
|
-
| [AcquireCertificateArgs](#interface-acquirecertificateargs) | [
|
|
12
|
-
| [AuthenticatedResult](#interface-authenticatedresult) | [
|
|
13
|
-
| [BasketInsertion](#interface-basketinsertion) | [
|
|
14
|
-
| [CertificateResult](#interface-certificateresult) | [
|
|
15
|
-
| [CreateActionArgs](#interface-createactionargs) | [
|
|
16
|
-
| [CreateActionInput](#interface-createactioninput) | [
|
|
17
|
-
| [CreateActionOptions](#interface-createactionoptions) | [
|
|
18
|
-
| [CreateActionOutput](#interface-createactionoutput) | [
|
|
19
|
-
| [CreateActionResult](#interface-createactionresult) | [
|
|
20
|
-
| [CreateHmacArgs](#interface-createhmacargs) | [
|
|
21
|
-
| [CreateHmacResult](#interface-createhmacresult) | [
|
|
22
|
-
| [CreateSignatureArgs](#interface-createsignatureargs) | [
|
|
23
|
-
| [CreateSignatureResult](#interface-createsignatureresult) | [
|
|
24
|
-
| [DiscoverByAttributesArgs](#interface-discoverbyattributesargs) | [
|
|
25
|
-
| [DiscoverByIdentityKeyArgs](#interface-discoverbyidentitykeyargs) | [
|
|
26
|
-
| [DiscoverCertificatesResult](#interface-discovercertificatesresult) | [
|
|
27
|
-
| [GetHeaderArgs](#interface-getheaderargs) | [
|
|
28
|
-
| [GetHeaderResult](#interface-getheaderresult) | [
|
|
29
|
-
| [GetHeightResult](#interface-getheightresult) | [
|
|
30
|
-
| [GetNetworkResult](#interface-getnetworkresult) | [
|
|
31
|
-
| [GetPublicKeyArgs](#interface-getpublickeyargs) | [
|
|
32
|
-
| [GetPublicKeyResult](#interface-getpublickeyresult) | [
|
|
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) | [
|
|
3463
|
-
| [AcquisitionProtocol](#type-acquisitionprotocol) | [
|
|
3464
|
-
| [ActionStatus](#type-actionstatus) | [
|
|
3465
|
-
| [AtomicBEEF](#type-atomicbeef) | [
|
|
3466
|
-
| [BEEF](#type-beef) | [
|
|
3467
|
-
| [Base64String](#type-base64string) | [
|
|
3468
|
-
| [BasketStringUnder300Bytes](#type-basketstringunder300bytes) | [
|
|
3469
|
-
| [BooleanDefaultFalse](#type-booleandefaultfalse) | [
|
|
3470
|
-
| [BooleanDefaultTrue](#type-booleandefaulttrue) | [
|
|
3471
|
-
| [Byte](#type-byte) | [
|
|
3472
|
-
| [CallType](#type-calltype) | [
|
|
3473
|
-
| [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes) | [
|
|
3474
|
-
| [Counterparty](#type-counterparty) | [
|
|
3475
|
-
| [DescriptionString5to50Bytes](#type-descriptionstring5to50bytes) | [
|
|
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
|
|