@bsv/wallet-toolbox 1.1.5 → 1.1.6
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/docs/README.md +1 -1
- package/docs/client.md +698 -442
- package/docs/monitor.md +54 -37
- package/docs/services.md +53 -34
- package/docs/setup.md +295 -38
- package/docs/storage.md +115 -103
- package/docs/wallet.md +697 -442
- package/out/src/Setup.d.ts +3 -3
- package/out/src/Setup.js +5 -5
- package/out/src/SetupClient.d.ts +105 -12
- package/out/src/SetupClient.d.ts.map +1 -1
- package/out/src/SetupClient.js +3 -4
- package/out/src/SetupClient.js.map +1 -1
- package/out/src/Wallet.d.ts +4 -0
- package/out/src/Wallet.d.ts.map +1 -1
- package/out/src/Wallet.js +7 -0
- package/out/src/Wallet.js.map +1 -1
- package/out/src/sdk/WalletError.d.ts +0 -1
- package/out/src/sdk/WalletError.d.ts.map +1 -1
- package/out/src/sdk/WalletError.js +0 -1
- package/out/src/sdk/WalletError.js.map +1 -1
- package/out/src/sdk/validationHelpers.d.ts +1 -0
- package/out/src/sdk/validationHelpers.d.ts.map +1 -1
- package/out/src/sdk/validationHelpers.js +2 -1
- package/out/src/sdk/validationHelpers.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts +1 -4
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +1 -4
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/src/storage/methods/createAction.d.ts.map +1 -1
- package/out/src/storage/methods/createAction.js +42 -11
- package/out/src/storage/methods/createAction.js.map +1 -1
- package/out/src/storage/methods/generateChange.js +1 -1
- package/out/src/storage/methods/generateChange.js.map +1 -1
- package/out/src/storage/schema/tables/ProvenTxReq.d.ts +4 -4
- package/out/test/examples/README.man.test.js +1 -1
- package/out/test/utils/TestUtilsWalletStorage.d.ts +2 -1
- package/out/test/utils/TestUtilsWalletStorage.d.ts.map +1 -1
- package/out/test/utils/TestUtilsWalletStorage.js +112 -27
- package/out/test/utils/TestUtilsWalletStorage.js.map +1 -1
- package/out/test/wallet/action/createAction.test.js +31 -5
- package/out/test/wallet/action/createAction.test.js.map +1 -1
- package/out/test/wallet/action/createAction2.test.d.ts +37 -0
- package/out/test/wallet/action/createAction2.test.d.ts.map +1 -0
- package/out/test/wallet/action/createAction2.test.js +1145 -0
- package/out/test/wallet/action/createAction2.test.js.map +1 -0
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/Setup.ts +5 -5
- package/src/SetupClient.ts +107 -15
- package/src/Wallet.ts +9 -0
- package/src/sdk/WalletError.ts +0 -1
- package/src/sdk/validationHelpers.ts +3 -1
- package/src/storage/StorageProvider.ts +1 -4
- package/src/storage/methods/createAction.ts +48 -12
- package/src/storage/methods/generateChange.ts +1 -1
- package/src/storage/schema/tables/ProvenTxReq.ts +4 -4
- package/test/examples/README.man.test.ts +1 -1
- package/test/utils/TestUtilsWalletStorage.ts +131 -35
- package/test/wallet/action/createAction.test.ts +36 -5
- package/test/wallet/action/createAction2.test.ts +1400 -0
- package/ts2md.json +6 -6
package/docs/storage.md
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
# API
|
|
1
|
+
# STORAGE: BSV Wallet Toolbox API Documentation
|
|
2
|
+
|
|
3
|
+
The documentation is split into various pages, this page covers the persistent storage of wallet data: transactions, outputs and metadata.
|
|
4
|
+
|
|
5
|
+
The [WalletStorageManager](#class-walletstoragemanager) class manages a collection of storage providers of which one is the "active" storage
|
|
6
|
+
at any one time, and the rest are backups. It manages access to wallet data, pushing incremental updates to backups, and switching the active
|
|
7
|
+
to what was previously a backup.
|
|
8
|
+
|
|
9
|
+
The [StorageClient](#class-storageclient) implements a cloud based storage provider via JSON-RPC. The [StorageServer](#class-storageserver) class
|
|
10
|
+
and `@bsv/wallet-infra` package can be used to host such a JSON-RPC server.
|
|
11
|
+
|
|
12
|
+
The [StorageKnex](#class-storageknex) class implements `Knex` based database storage with explicit support for both MySQL and SQLite.
|
|
13
|
+
|
|
14
|
+
[Return To Top](./README.md)
|
|
15
|
+
|
|
16
|
+
<!--#region ts2md-api-merged-here-->
|
|
17
|
+
### API
|
|
2
18
|
|
|
3
19
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4
20
|
|
|
5
|
-
|
|
21
|
+
#### Interfaces
|
|
6
22
|
|
|
7
23
|
| | |
|
|
8
24
|
| --- | --- |
|
|
@@ -21,7 +37,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
21
37
|
|
|
22
38
|
---
|
|
23
39
|
|
|
24
|
-
|
|
40
|
+
##### Interface: CommitNewTxResults
|
|
25
41
|
|
|
26
42
|
```ts
|
|
27
43
|
export interface CommitNewTxResults {
|
|
@@ -33,7 +49,7 @@ export interface CommitNewTxResults {
|
|
|
33
49
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
34
50
|
|
|
35
51
|
---
|
|
36
|
-
|
|
52
|
+
##### Interface: GenerateChangeSdkChangeInput
|
|
37
53
|
|
|
38
54
|
```ts
|
|
39
55
|
export interface GenerateChangeSdkChangeInput {
|
|
@@ -45,7 +61,7 @@ export interface GenerateChangeSdkChangeInput {
|
|
|
45
61
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
46
62
|
|
|
47
63
|
---
|
|
48
|
-
|
|
64
|
+
##### Interface: GenerateChangeSdkChangeOutput
|
|
49
65
|
|
|
50
66
|
```ts
|
|
51
67
|
export interface GenerateChangeSdkChangeOutput {
|
|
@@ -57,7 +73,7 @@ export interface GenerateChangeSdkChangeOutput {
|
|
|
57
73
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
58
74
|
|
|
59
75
|
---
|
|
60
|
-
|
|
76
|
+
##### Interface: GenerateChangeSdkInput
|
|
61
77
|
|
|
62
78
|
```ts
|
|
63
79
|
export interface GenerateChangeSdkInput {
|
|
@@ -69,7 +85,7 @@ export interface GenerateChangeSdkInput {
|
|
|
69
85
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
70
86
|
|
|
71
87
|
---
|
|
72
|
-
|
|
88
|
+
##### Interface: GenerateChangeSdkOutput
|
|
73
89
|
|
|
74
90
|
```ts
|
|
75
91
|
export interface GenerateChangeSdkOutput {
|
|
@@ -81,7 +97,7 @@ export interface GenerateChangeSdkOutput {
|
|
|
81
97
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
82
98
|
|
|
83
99
|
---
|
|
84
|
-
|
|
100
|
+
##### Interface: GenerateChangeSdkParams
|
|
85
101
|
|
|
86
102
|
```ts
|
|
87
103
|
export interface GenerateChangeSdkParams {
|
|
@@ -105,7 +121,7 @@ See also: [GenerateChangeSdkInput](#interface-generatechangesdkinput), [Generate
|
|
|
105
121
|
|
|
106
122
|
<summary>Interface GenerateChangeSdkParams Details</summary>
|
|
107
123
|
|
|
108
|
-
|
|
124
|
+
###### Property changeFirstSatoshis
|
|
109
125
|
|
|
110
126
|
Lowest amount value to assign to a change output.
|
|
111
127
|
Drop the output if unable to satisfy.
|
|
@@ -115,7 +131,7 @@ default 285
|
|
|
115
131
|
changeFirstSatoshis: number
|
|
116
132
|
```
|
|
117
133
|
|
|
118
|
-
|
|
134
|
+
###### Property changeInitialSatoshis
|
|
119
135
|
|
|
120
136
|
Satoshi amount to initialize optional new change outputs.
|
|
121
137
|
|
|
@@ -123,7 +139,7 @@ Satoshi amount to initialize optional new change outputs.
|
|
|
123
139
|
changeInitialSatoshis: number
|
|
124
140
|
```
|
|
125
141
|
|
|
126
|
-
|
|
142
|
+
###### Property changeLockingScriptLength
|
|
127
143
|
|
|
128
144
|
Fixed change locking script length.
|
|
129
145
|
|
|
@@ -133,7 +149,7 @@ For P2PKH template, 25 bytes
|
|
|
133
149
|
changeLockingScriptLength: number
|
|
134
150
|
```
|
|
135
151
|
|
|
136
|
-
|
|
152
|
+
###### Property changeUnlockingScriptLength
|
|
137
153
|
|
|
138
154
|
Fixed change unlocking script length.
|
|
139
155
|
|
|
@@ -143,7 +159,7 @@ For P2PKH template, 107 bytes
|
|
|
143
159
|
changeUnlockingScriptLength: number
|
|
144
160
|
```
|
|
145
161
|
|
|
146
|
-
|
|
162
|
+
###### Property targetNetCount
|
|
147
163
|
|
|
148
164
|
Target for number of new change outputs added minus number of funding change outputs consumed.
|
|
149
165
|
If undefined, only a single change output will be added if excess fees must be recaptured.
|
|
@@ -157,7 +173,7 @@ targetNetCount?: number
|
|
|
157
173
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
158
174
|
|
|
159
175
|
---
|
|
160
|
-
|
|
176
|
+
##### Interface: GenerateChangeSdkResult
|
|
161
177
|
|
|
162
178
|
```ts
|
|
163
179
|
export interface GenerateChangeSdkResult {
|
|
@@ -174,7 +190,7 @@ See also: [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput
|
|
|
174
190
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
175
191
|
|
|
176
192
|
---
|
|
177
|
-
|
|
193
|
+
##### Interface: GenerateChangeSdkStorageChange
|
|
178
194
|
|
|
179
195
|
```ts
|
|
180
196
|
export interface GenerateChangeSdkStorageChange extends GenerateChangeSdkChangeInput {
|
|
@@ -187,7 +203,7 @@ See also: [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput
|
|
|
187
203
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
188
204
|
|
|
189
205
|
---
|
|
190
|
-
|
|
206
|
+
##### Interface: GetReqsAndBeefDetail
|
|
191
207
|
|
|
192
208
|
```ts
|
|
193
209
|
export interface GetReqsAndBeefDetail {
|
|
@@ -202,7 +218,7 @@ export interface GetReqsAndBeefDetail {
|
|
|
202
218
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
203
219
|
|
|
204
220
|
---
|
|
205
|
-
|
|
221
|
+
##### Interface: GetReqsAndBeefResult
|
|
206
222
|
|
|
207
223
|
```ts
|
|
208
224
|
export interface GetReqsAndBeefResult {
|
|
@@ -216,7 +232,7 @@ See also: [GetReqsAndBeefDetail](#interface-getreqsandbeefdetail)
|
|
|
216
232
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
217
233
|
|
|
218
234
|
---
|
|
219
|
-
|
|
235
|
+
##### Interface: PostBeefResultForTxidApi
|
|
220
236
|
|
|
221
237
|
```ts
|
|
222
238
|
export interface PostBeefResultForTxidApi {
|
|
@@ -233,7 +249,7 @@ export interface PostBeefResultForTxidApi {
|
|
|
233
249
|
|
|
234
250
|
<summary>Interface PostBeefResultForTxidApi Details</summary>
|
|
235
251
|
|
|
236
|
-
|
|
252
|
+
###### Property alreadyKnown
|
|
237
253
|
|
|
238
254
|
if true, the transaction was already known to this service. Usually treat as a success.
|
|
239
255
|
|
|
@@ -243,7 +259,7 @@ Potentially stop posting to additional transaction processors.
|
|
|
243
259
|
alreadyKnown?: boolean
|
|
244
260
|
```
|
|
245
261
|
|
|
246
|
-
|
|
262
|
+
###### Property status
|
|
247
263
|
|
|
248
264
|
'success' - The transaction was accepted for processing
|
|
249
265
|
|
|
@@ -256,7 +272,7 @@ status: "success" | "error"
|
|
|
256
272
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
257
273
|
|
|
258
274
|
---
|
|
259
|
-
|
|
275
|
+
##### Interface: PostReqsToNetworkDetails
|
|
260
276
|
|
|
261
277
|
```ts
|
|
262
278
|
export interface PostReqsToNetworkDetails {
|
|
@@ -274,7 +290,7 @@ See also: [PostReqsToNetworkDetailsStatus](#type-postreqstonetworkdetailsstatus)
|
|
|
274
290
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
275
291
|
|
|
276
292
|
---
|
|
277
|
-
|
|
293
|
+
##### Interface: PostReqsToNetworkResult
|
|
278
294
|
|
|
279
295
|
```ts
|
|
280
296
|
export interface PostReqsToNetworkResult {
|
|
@@ -291,7 +307,7 @@ See also: [PostBeefResult](#interface-postbeefresult), [PostReqsToNetworkDetails
|
|
|
291
307
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
292
308
|
|
|
293
309
|
---
|
|
294
|
-
|
|
310
|
+
##### Interface: StorageInternalizeActionResult
|
|
295
311
|
|
|
296
312
|
```ts
|
|
297
313
|
export interface StorageInternalizeActionResult extends InternalizeActionResult {
|
|
@@ -305,7 +321,7 @@ export interface StorageInternalizeActionResult extends InternalizeActionResult
|
|
|
305
321
|
|
|
306
322
|
<summary>Interface StorageInternalizeActionResult Details</summary>
|
|
307
323
|
|
|
308
|
-
|
|
324
|
+
###### Property isMerge
|
|
309
325
|
|
|
310
326
|
true if internalizing outputs on an existing storage transaction
|
|
311
327
|
|
|
@@ -313,7 +329,7 @@ true if internalizing outputs on an existing storage transaction
|
|
|
313
329
|
isMerge: boolean
|
|
314
330
|
```
|
|
315
331
|
|
|
316
|
-
|
|
332
|
+
###### Property satoshis
|
|
317
333
|
|
|
318
334
|
net change in change balance for user due to this internalization
|
|
319
335
|
|
|
@@ -321,7 +337,7 @@ net change in change balance for user due to this internalization
|
|
|
321
337
|
satoshis: number
|
|
322
338
|
```
|
|
323
339
|
|
|
324
|
-
|
|
340
|
+
###### Property txid
|
|
325
341
|
|
|
326
342
|
txid of transaction being internalized
|
|
327
343
|
|
|
@@ -334,7 +350,7 @@ txid: string
|
|
|
334
350
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
335
351
|
|
|
336
352
|
---
|
|
337
|
-
|
|
353
|
+
##### Interface: StorageKnexOptions
|
|
338
354
|
|
|
339
355
|
```ts
|
|
340
356
|
export interface StorageKnexOptions extends StorageProviderOptions {
|
|
@@ -348,7 +364,7 @@ See also: [StorageProviderOptions](#interface-storageprovideroptions)
|
|
|
348
364
|
|
|
349
365
|
<summary>Interface StorageKnexOptions Details</summary>
|
|
350
366
|
|
|
351
|
-
|
|
367
|
+
###### Property knex
|
|
352
368
|
|
|
353
369
|
Knex database interface initialized with valid connection configuration.
|
|
354
370
|
|
|
@@ -361,7 +377,7 @@ knex: Knex
|
|
|
361
377
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
362
378
|
|
|
363
379
|
---
|
|
364
|
-
|
|
380
|
+
##### Interface: StorageProviderOptions
|
|
365
381
|
|
|
366
382
|
```ts
|
|
367
383
|
export interface StorageProviderOptions extends StorageReaderWriterOptions {
|
|
@@ -378,7 +394,7 @@ See also: [Chain](#type-chain), [StorageFeeModel](#interface-storagefeemodel), [
|
|
|
378
394
|
|
|
379
395
|
<summary>Interface StorageProviderOptions Details</summary>
|
|
380
396
|
|
|
381
|
-
|
|
397
|
+
###### Property commissionPubKeyHex
|
|
382
398
|
|
|
383
399
|
If commissionSatoshis is greater than zero, must be a valid public key hex string.
|
|
384
400
|
The actual locking script for each commission will use a public key derived
|
|
@@ -388,7 +404,7 @@ from this key by information stored in the commissions table.
|
|
|
388
404
|
commissionPubKeyHex?: PubKeyHex
|
|
389
405
|
```
|
|
390
406
|
|
|
391
|
-
|
|
407
|
+
###### Property commissionSatoshis
|
|
392
408
|
|
|
393
409
|
Transactions created by this Storage can charge a fee per transaction.
|
|
394
410
|
A value of zero disables commission fees.
|
|
@@ -402,7 +418,7 @@ commissionSatoshis: number
|
|
|
402
418
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
403
419
|
|
|
404
420
|
---
|
|
405
|
-
|
|
421
|
+
##### Interface: StorageReaderOptions
|
|
406
422
|
|
|
407
423
|
```ts
|
|
408
424
|
export interface StorageReaderOptions {
|
|
@@ -415,7 +431,7 @@ See also: [Chain](#type-chain)
|
|
|
415
431
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
416
432
|
|
|
417
433
|
---
|
|
418
|
-
|
|
434
|
+
##### Interface: StorageReaderWriterOptions
|
|
419
435
|
|
|
420
436
|
```ts
|
|
421
437
|
export interface StorageReaderWriterOptions extends StorageReaderOptions {
|
|
@@ -427,7 +443,7 @@ See also: [StorageReaderOptions](#interface-storagereaderoptions)
|
|
|
427
443
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
428
444
|
|
|
429
445
|
---
|
|
430
|
-
|
|
446
|
+
##### Interface: WalletStorageServerOptions
|
|
431
447
|
|
|
432
448
|
```ts
|
|
433
449
|
export interface WalletStorageServerOptions {
|
|
@@ -443,7 +459,7 @@ See also: [Wallet](#class-wallet)
|
|
|
443
459
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
444
460
|
|
|
445
461
|
---
|
|
446
|
-
|
|
462
|
+
##### Interface: XValidCreateActionOutput
|
|
447
463
|
|
|
448
464
|
```ts
|
|
449
465
|
export interface XValidCreateActionOutput extends sdk.ValidCreateActionOutput {
|
|
@@ -460,7 +476,7 @@ See also: [StorageProvidedBy](#type-storageprovidedby), [ValidCreateActionOutput
|
|
|
460
476
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
461
477
|
|
|
462
478
|
---
|
|
463
|
-
|
|
479
|
+
#### Classes
|
|
464
480
|
|
|
465
481
|
| |
|
|
466
482
|
| --- |
|
|
@@ -478,7 +494,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
478
494
|
|
|
479
495
|
---
|
|
480
496
|
|
|
481
|
-
|
|
497
|
+
##### Class: KnexMigrations
|
|
482
498
|
|
|
483
499
|
```ts
|
|
484
500
|
export class KnexMigrations implements MigrationSource<string> {
|
|
@@ -524,7 +540,7 @@ See also: [Chain](#type-chain), [DBType](#type-dbtype), [WERR_NOT_IMPLEMENTED](#
|
|
|
524
540
|
|
|
525
541
|
<summary>Class KnexMigrations Details</summary>
|
|
526
542
|
|
|
527
|
-
|
|
543
|
+
###### Constructor
|
|
528
544
|
|
|
529
545
|
```ts
|
|
530
546
|
constructor(public chain: sdk.Chain, public storageName: string, public storageIdentityKey: string, public maxOutputScriptLength: number)
|
|
@@ -538,7 +554,7 @@ Argument Details
|
|
|
538
554
|
+ **maxOutputScriptLength**
|
|
539
555
|
+ limit for scripts kept in outputs table, longer scripts will be pulled from rawTx
|
|
540
556
|
|
|
541
|
-
|
|
557
|
+
###### Method dbtype
|
|
542
558
|
|
|
543
559
|
```ts
|
|
544
560
|
static async dbtype(knex: Knex<any, any[]>): Promise<DBType>
|
|
@@ -554,7 +570,7 @@ connected database engine variant
|
|
|
554
570
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
555
571
|
|
|
556
572
|
---
|
|
557
|
-
|
|
573
|
+
##### Class: StorageClient
|
|
558
574
|
|
|
559
575
|
```ts
|
|
560
576
|
export class StorageClient implements sdk.WalletStorageProvider {
|
|
@@ -602,7 +618,7 @@ See also: [AuthId](#interface-authid), [FindCertificatesArgs](#interface-findcer
|
|
|
602
618
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
603
619
|
|
|
604
620
|
---
|
|
605
|
-
|
|
621
|
+
##### Class: StorageKnex
|
|
606
622
|
|
|
607
623
|
```ts
|
|
608
624
|
export class StorageKnex extends StorageProvider implements sdk.WalletStorageProvider {
|
|
@@ -817,7 +833,7 @@ See also: [AuthId](#interface-authid), [DBType](#type-dbtype), [EntityTimeStamp]
|
|
|
817
833
|
|
|
818
834
|
<summary>Class StorageKnex Details</summary>
|
|
819
835
|
|
|
820
|
-
|
|
836
|
+
###### Method allocateChangeInput
|
|
821
837
|
|
|
822
838
|
Finds closest matching available change output to use as input for new transaction.
|
|
823
839
|
|
|
@@ -827,7 +843,7 @@ Transactionally allocate the output such that
|
|
|
827
843
|
async allocateChangeInput(userId: number, basketId: number, targetSatoshis: number, exactSatoshis: number | undefined, excludeSending: boolean, transactionId: number): Promise<table.Output | undefined>
|
|
828
844
|
```
|
|
829
845
|
|
|
830
|
-
|
|
846
|
+
###### Method countChangeInputs
|
|
831
847
|
|
|
832
848
|
Finds closest matching available change output to use as input for new transaction.
|
|
833
849
|
|
|
@@ -837,7 +853,7 @@ Transactionally allocate the output such that
|
|
|
837
853
|
async countChangeInputs(userId: number, basketId: number, excludeSending: boolean): Promise<number>
|
|
838
854
|
```
|
|
839
855
|
|
|
840
|
-
|
|
856
|
+
###### Method toDb
|
|
841
857
|
|
|
842
858
|
Convert the standard optional `TrxToken` parameter into either a direct knex database instance,
|
|
843
859
|
or a Knex.Transaction as appropriate.
|
|
@@ -847,7 +863,7 @@ toDb(trx?: sdk.TrxToken)
|
|
|
847
863
|
```
|
|
848
864
|
See also: [TrxToken](#interface-trxtoken)
|
|
849
865
|
|
|
850
|
-
|
|
866
|
+
###### Method validateEntities
|
|
851
867
|
|
|
852
868
|
Helper to force uniform behavior across database engines.
|
|
853
869
|
Use to process all arrays of records with time stamps retreived from database.
|
|
@@ -861,7 +877,7 @@ Returns
|
|
|
861
877
|
|
|
862
878
|
input `entities` array with contained values validated.
|
|
863
879
|
|
|
864
|
-
|
|
880
|
+
###### Method validateEntity
|
|
865
881
|
|
|
866
882
|
Helper to force uniform behavior across database engines.
|
|
867
883
|
Use to process all individual records with time stamps retreived from database.
|
|
@@ -871,7 +887,7 @@ validateEntity<T extends sdk.EntityTimeStamp>(entity: T, dateFields?: string[],
|
|
|
871
887
|
```
|
|
872
888
|
See also: [EntityTimeStamp](#interface-entitytimestamp)
|
|
873
889
|
|
|
874
|
-
|
|
890
|
+
###### Method validateEntityForInsert
|
|
875
891
|
|
|
876
892
|
Helper to force uniform behavior across database engines.
|
|
877
893
|
Use to process new entities being inserted into the database.
|
|
@@ -881,7 +897,7 @@ async validateEntityForInsert<T extends sdk.EntityTimeStamp>(entity: T, trx?: sd
|
|
|
881
897
|
```
|
|
882
898
|
See also: [EntityTimeStamp](#interface-entitytimestamp), [TrxToken](#interface-trxtoken)
|
|
883
899
|
|
|
884
|
-
|
|
900
|
+
###### Method validatePartialForUpdate
|
|
885
901
|
|
|
886
902
|
Helper to force uniform behavior across database engines.
|
|
887
903
|
Use to process the update template for entities being updated.
|
|
@@ -891,7 +907,7 @@ validatePartialForUpdate<T extends sdk.EntityTimeStamp>(update: Partial<T>, date
|
|
|
891
907
|
```
|
|
892
908
|
See also: [EntityTimeStamp](#interface-entitytimestamp)
|
|
893
909
|
|
|
894
|
-
|
|
910
|
+
###### Method verifyReadyForDatabaseAccess
|
|
895
911
|
|
|
896
912
|
Make sure database is ready for access:
|
|
897
913
|
|
|
@@ -908,7 +924,7 @@ See also: [DBType](#type-dbtype), [TrxToken](#interface-trxtoken)
|
|
|
908
924
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
909
925
|
|
|
910
926
|
---
|
|
911
|
-
|
|
927
|
+
##### Class: StorageProvider
|
|
912
928
|
|
|
913
929
|
```ts
|
|
914
930
|
export abstract class StorageProvider extends StorageReaderWriter implements sdk.WalletStorageProvider {
|
|
@@ -976,7 +992,7 @@ See also: [AuthId](#interface-authid), [Chain](#type-chain), [FindCertificatesAr
|
|
|
976
992
|
|
|
977
993
|
<summary>Class StorageProvider Details</summary>
|
|
978
994
|
|
|
979
|
-
|
|
995
|
+
###### Method confirmSpendableOutputs
|
|
980
996
|
|
|
981
997
|
For each spendable output in the 'default' basket of the authenticated user,
|
|
982
998
|
verify that the output script, satoshis, vout and txid match that of an output
|
|
@@ -992,7 +1008,7 @@ Returns
|
|
|
992
1008
|
|
|
993
1009
|
object with invalidSpendableOutputs array. A good result is an empty array.
|
|
994
1010
|
|
|
995
|
-
|
|
1011
|
+
###### Method getProvenOrReq
|
|
996
1012
|
|
|
997
1013
|
Checks if txid is a known valid ProvenTx and returns it if found.
|
|
998
1014
|
Next checks if txid is a current ProvenTxReq and returns that if found.
|
|
@@ -1007,10 +1023,10 @@ async getProvenOrReq(txid: string, newReq?: table.ProvenTxReq, trx?: sdk.TrxToke
|
|
|
1007
1023
|
```
|
|
1008
1024
|
See also: [StorageProvenOrReq](#interface-storageprovenorreq), [TrxToken](#interface-trxtoken)
|
|
1009
1025
|
|
|
1010
|
-
|
|
1026
|
+
###### Method getReqsAndBeefToShareWithWorld
|
|
1011
1027
|
|
|
1012
1028
|
Given an array of transaction txids with current ProvenTxReq ready-to-share status,
|
|
1013
|
-
lookup their
|
|
1029
|
+
lookup their ProvenTxReqApi req records.
|
|
1014
1030
|
For the txids with reqs and status still ready to send construct a single merged beef.
|
|
1015
1031
|
|
|
1016
1032
|
```ts
|
|
@@ -1018,7 +1034,7 @@ async getReqsAndBeefToShareWithWorld(txids: string[], knownTxids: string[], trx?
|
|
|
1018
1034
|
```
|
|
1019
1035
|
See also: [GetReqsAndBeefResult](#interface-getreqsandbeefresult), [TrxToken](#interface-trxtoken)
|
|
1020
1036
|
|
|
1021
|
-
|
|
1037
|
+
###### Method updateProvenTxReqWithNewProvenTx
|
|
1022
1038
|
|
|
1023
1039
|
Handles storage changes when a valid MerklePath and mined block header are found for a ProvenTxReq txid.
|
|
1024
1040
|
|
|
@@ -1037,7 +1053,7 @@ async updateProvenTxReqWithNewProvenTx(args: sdk.UpdateProvenTxReqWithNewProvenT
|
|
|
1037
1053
|
```
|
|
1038
1054
|
See also: [UpdateProvenTxReqWithNewProvenTxArgs](#interface-updateproventxreqwithnewproventxargs), [UpdateProvenTxReqWithNewProvenTxResult](#interface-updateproventxreqwithnewproventxresult)
|
|
1039
1055
|
|
|
1040
|
-
|
|
1056
|
+
###### Method updateTransactionStatus
|
|
1041
1057
|
|
|
1042
1058
|
For all `status` values besides 'failed', just updates the transaction records status property.
|
|
1043
1059
|
|
|
@@ -1048,18 +1064,12 @@ async updateTransactionStatus(status: sdk.TransactionStatus, transactionId?: num
|
|
|
1048
1064
|
```
|
|
1049
1065
|
See also: [TransactionStatus](#type-transactionstatus), [TrxToken](#interface-trxtoken)
|
|
1050
1066
|
|
|
1051
|
-
Throws
|
|
1052
|
-
|
|
1053
|
-
ERR_DOJO_COMPLETED_TX if current status is 'completed' and new status is not 'completed.
|
|
1054
|
-
|
|
1055
|
-
ERR_DOJO_PROVEN_TX if transaction has proof or provenTxId and new status is not 'completed'.
|
|
1056
|
-
|
|
1057
1067
|
</details>
|
|
1058
1068
|
|
|
1059
1069
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1060
1070
|
|
|
1061
1071
|
---
|
|
1062
|
-
|
|
1072
|
+
##### Class: StorageReader
|
|
1063
1073
|
|
|
1064
1074
|
The `StorageReader` abstract class is the base of the concrete wallet storage provider classes.
|
|
1065
1075
|
|
|
@@ -1128,7 +1138,7 @@ See also: [Chain](#type-chain), [DBType](#type-dbtype), [FindCertificateFieldsAr
|
|
|
1128
1138
|
|
|
1129
1139
|
<summary>Class StorageReader Details</summary>
|
|
1130
1140
|
|
|
1131
|
-
|
|
1141
|
+
###### Method validateEntityDate
|
|
1132
1142
|
|
|
1133
1143
|
Force dates to strings on SQLite and Date objects on MySQL
|
|
1134
1144
|
|
|
@@ -1136,7 +1146,7 @@ Force dates to strings on SQLite and Date objects on MySQL
|
|
|
1136
1146
|
validateEntityDate(date: Date | string | number): Date | string
|
|
1137
1147
|
```
|
|
1138
1148
|
|
|
1139
|
-
|
|
1149
|
+
###### Method validateOptionalEntityDate
|
|
1140
1150
|
|
|
1141
1151
|
```ts
|
|
1142
1152
|
validateOptionalEntityDate(date: Date | string | number | null | undefined, useNowAsDefault?: boolean): Date | string | undefined
|
|
@@ -1152,7 +1162,7 @@ Argument Details
|
|
|
1152
1162
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1153
1163
|
|
|
1154
1164
|
---
|
|
1155
|
-
|
|
1165
|
+
##### Class: StorageReaderWriter
|
|
1156
1166
|
|
|
1157
1167
|
```ts
|
|
1158
1168
|
export abstract class StorageReaderWriter extends StorageReader {
|
|
@@ -1244,7 +1254,7 @@ See also: [AuthId](#interface-authid), [FindOutputTagMapsArgs](#interface-findou
|
|
|
1244
1254
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1245
1255
|
|
|
1246
1256
|
---
|
|
1247
|
-
|
|
1257
|
+
##### Class: StorageServer
|
|
1248
1258
|
|
|
1249
1259
|
```ts
|
|
1250
1260
|
export class StorageServer {
|
|
@@ -1258,7 +1268,7 @@ See also: [StorageProvider](#class-storageprovider), [WalletStorageServerOptions
|
|
|
1258
1268
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1259
1269
|
|
|
1260
1270
|
---
|
|
1261
|
-
|
|
1271
|
+
##### Class: StorageSyncReader
|
|
1262
1272
|
|
|
1263
1273
|
The `StorageSyncReader` non-abstract class must be used when authentication checking access to the methods of a `StorageBaseReader` is required.
|
|
1264
1274
|
|
|
@@ -1295,7 +1305,7 @@ See also: [AuthId](#interface-authid), [FindCertificateFieldsArgs](#interface-fi
|
|
|
1295
1305
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1296
1306
|
|
|
1297
1307
|
---
|
|
1298
|
-
|
|
1308
|
+
##### Class: WalletStorageManager
|
|
1299
1309
|
|
|
1300
1310
|
The `WalletStorageManager` class delivers authentication checking storage access to the wallet.
|
|
1301
1311
|
|
|
@@ -1378,7 +1388,7 @@ See also: [AuthId](#interface-authid), [FindCertificatesArgs](#interface-findcer
|
|
|
1378
1388
|
|
|
1379
1389
|
<summary>Class WalletStorageManager Details</summary>
|
|
1380
1390
|
|
|
1381
|
-
|
|
1391
|
+
###### Property _isSingleWriter
|
|
1382
1392
|
|
|
1383
1393
|
if true, allow only a single writer to proceed at a time.
|
|
1384
1394
|
queue the blocked requests so they get executed in order when released.
|
|
@@ -1387,7 +1397,7 @@ queue the blocked requests so they get executed in order when released.
|
|
|
1387
1397
|
_isSingleWriter: boolean = true
|
|
1388
1398
|
```
|
|
1389
1399
|
|
|
1390
|
-
|
|
1400
|
+
###### Property _storageProviderLocked
|
|
1391
1401
|
|
|
1392
1402
|
if true, allow no new reader or writers or sync to proceed.
|
|
1393
1403
|
queue the blocked requests so they get executed in order when released.
|
|
@@ -1396,7 +1406,7 @@ queue the blocked requests so they get executed in order when released.
|
|
|
1396
1406
|
_storageProviderLocked: boolean = false
|
|
1397
1407
|
```
|
|
1398
1408
|
|
|
1399
|
-
|
|
1409
|
+
###### Property _syncLocked
|
|
1400
1410
|
|
|
1401
1411
|
if true, allow no new reader or writers to proceed.
|
|
1402
1412
|
queue the blocked requests so they get executed in order when released.
|
|
@@ -1405,7 +1415,7 @@ queue the blocked requests so they get executed in order when released.
|
|
|
1405
1415
|
_syncLocked: boolean = false
|
|
1406
1416
|
```
|
|
1407
1417
|
|
|
1408
|
-
|
|
1418
|
+
###### Method isActiveStorageProvider
|
|
1409
1419
|
|
|
1410
1420
|
```ts
|
|
1411
1421
|
isActiveStorageProvider(): boolean
|
|
@@ -1415,7 +1425,7 @@ Returns
|
|
|
1415
1425
|
|
|
1416
1426
|
true if the active `WalletStorageProvider` also implements `StorageProvider`
|
|
1417
1427
|
|
|
1418
|
-
|
|
1428
|
+
###### Method runAsSync
|
|
1419
1429
|
|
|
1420
1430
|
```ts
|
|
1421
1431
|
async runAsSync<R>(sync: (active: sdk.WalletStorageSync) => Promise<R>, activeSync?: sdk.WalletStorageSync): Promise<R>
|
|
@@ -1429,7 +1439,7 @@ Argument Details
|
|
|
1429
1439
|
+ **activeSync**
|
|
1430
1440
|
+ from chained sync functions, active storage already held under sync access lock.
|
|
1431
1441
|
|
|
1432
|
-
|
|
1442
|
+
###### Method setActive
|
|
1433
1443
|
|
|
1434
1444
|
Updates backups and switches to new active storage provider from among current backup providers.
|
|
1435
1445
|
|
|
@@ -1447,7 +1457,7 @@ Argument Details
|
|
|
1447
1457
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1448
1458
|
|
|
1449
1459
|
---
|
|
1450
|
-
|
|
1460
|
+
#### Functions
|
|
1451
1461
|
|
|
1452
1462
|
| | |
|
|
1453
1463
|
| --- | --- |
|
|
@@ -1468,7 +1478,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
1468
1478
|
|
|
1469
1479
|
---
|
|
1470
1480
|
|
|
1471
|
-
|
|
1481
|
+
##### Function: attemptToPostReqsToNetwork
|
|
1472
1482
|
|
|
1473
1483
|
Attempt to post one or more `ProvenTxReq` with status 'unsent'
|
|
1474
1484
|
to the bitcoin network.
|
|
@@ -1482,7 +1492,7 @@ See also: [PostReqsToNetworkResult](#interface-postreqstonetworkresult), [Storag
|
|
|
1482
1492
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1483
1493
|
|
|
1484
1494
|
---
|
|
1485
|
-
|
|
1495
|
+
##### Function: createAction
|
|
1486
1496
|
|
|
1487
1497
|
```ts
|
|
1488
1498
|
export async function createAction(storage: StorageProvider, auth: sdk.AuthId, vargs: sdk.ValidCreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<sdk.StorageCreateActionResult>
|
|
@@ -1493,7 +1503,7 @@ See also: [AuthId](#interface-authid), [StorageCreateActionResult](#interface-st
|
|
|
1493
1503
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1494
1504
|
|
|
1495
1505
|
---
|
|
1496
|
-
|
|
1506
|
+
##### Function: createStorageServiceChargeScript
|
|
1497
1507
|
|
|
1498
1508
|
```ts
|
|
1499
1509
|
export function createStorageServiceChargeScript(pubKeyHex: PubKeyHex): {
|
|
@@ -1505,7 +1515,7 @@ export function createStorageServiceChargeScript(pubKeyHex: PubKeyHex): {
|
|
|
1505
1515
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1506
1516
|
|
|
1507
1517
|
---
|
|
1508
|
-
|
|
1518
|
+
##### Function: generateChangeSdk
|
|
1509
1519
|
|
|
1510
1520
|
Simplifications:
|
|
1511
1521
|
- only support one change type with fixed length scripts.
|
|
@@ -1522,7 +1532,7 @@ See also: [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput
|
|
|
1522
1532
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1523
1533
|
|
|
1524
1534
|
---
|
|
1525
|
-
|
|
1535
|
+
##### Function: generateChangeSdkMakeStorage
|
|
1526
1536
|
|
|
1527
1537
|
```ts
|
|
1528
1538
|
export function generateChangeSdkMakeStorage(availableChange: GenerateChangeSdkChangeInput[]): {
|
|
@@ -1537,7 +1547,7 @@ See also: [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput
|
|
|
1537
1547
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1538
1548
|
|
|
1539
1549
|
---
|
|
1540
|
-
|
|
1550
|
+
##### Function: getBeefForTransaction
|
|
1541
1551
|
|
|
1542
1552
|
Creates a `Beef` to support the validity of a transaction identified by its `txid`.
|
|
1543
1553
|
|
|
@@ -1574,7 +1584,7 @@ Argument Details
|
|
|
1574
1584
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1575
1585
|
|
|
1576
1586
|
---
|
|
1577
|
-
|
|
1587
|
+
##### Function: getSyncChunk
|
|
1578
1588
|
|
|
1579
1589
|
Gets the next sync chunk of updated data from un-remoted storage (could be using a remote DB connection).
|
|
1580
1590
|
|
|
@@ -1587,7 +1597,7 @@ See also: [RequestSyncChunkArgs](#interface-requestsyncchunkargs), [StorageReade
|
|
|
1587
1597
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1588
1598
|
|
|
1589
1599
|
---
|
|
1590
|
-
|
|
1600
|
+
##### Function: internalizeAction
|
|
1591
1601
|
|
|
1592
1602
|
Internalize Action allows a wallet to take ownership of outputs in a pre-existing transaction.
|
|
1593
1603
|
The transaction may, or may not already be known to both the storage and user.
|
|
@@ -1623,7 +1633,7 @@ See also: [AuthId](#interface-authid), [StorageProvider](#class-storageprovider)
|
|
|
1623
1633
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1624
1634
|
|
|
1625
1635
|
---
|
|
1626
|
-
|
|
1636
|
+
##### Function: listActions
|
|
1627
1637
|
|
|
1628
1638
|
```ts
|
|
1629
1639
|
export async function listActions(storage: StorageKnex, auth: sdk.AuthId, vargs: sdk.ValidListActionsArgs): Promise<ListActionsResult>
|
|
@@ -1634,7 +1644,7 @@ See also: [AuthId](#interface-authid), [StorageKnex](#class-storageknex), [Valid
|
|
|
1634
1644
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1635
1645
|
|
|
1636
1646
|
---
|
|
1637
|
-
|
|
1647
|
+
##### Function: listCertificates
|
|
1638
1648
|
|
|
1639
1649
|
```ts
|
|
1640
1650
|
export async function listCertificates(storage: StorageProvider, auth: sdk.AuthId, vargs: sdk.ValidListCertificatesArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListCertificatesResult>
|
|
@@ -1645,7 +1655,7 @@ See also: [AuthId](#interface-authid), [StorageProvider](#class-storageprovider)
|
|
|
1645
1655
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1646
1656
|
|
|
1647
1657
|
---
|
|
1648
|
-
|
|
1658
|
+
##### Function: listOutputs
|
|
1649
1659
|
|
|
1650
1660
|
```ts
|
|
1651
1661
|
export async function listOutputs(dsk: StorageKnex, auth: sdk.AuthId, vargs: sdk.ValidListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>
|
|
@@ -1656,7 +1666,7 @@ See also: [AuthId](#interface-authid), [StorageKnex](#class-storageknex), [Valid
|
|
|
1656
1666
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1657
1667
|
|
|
1658
1668
|
---
|
|
1659
|
-
|
|
1669
|
+
##### Function: lockScriptWithKeyOffsetFromPubKey
|
|
1660
1670
|
|
|
1661
1671
|
```ts
|
|
1662
1672
|
export function lockScriptWithKeyOffsetFromPubKey(pubKey: string, keyOffset?: string): {
|
|
@@ -1668,7 +1678,7 @@ export function lockScriptWithKeyOffsetFromPubKey(pubKey: string, keyOffset?: st
|
|
|
1668
1678
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1669
1679
|
|
|
1670
1680
|
---
|
|
1671
|
-
|
|
1681
|
+
##### Function: offsetPubKey
|
|
1672
1682
|
|
|
1673
1683
|
```ts
|
|
1674
1684
|
export function offsetPubKey(pubKey: string, keyOffset?: string): {
|
|
@@ -1680,7 +1690,7 @@ export function offsetPubKey(pubKey: string, keyOffset?: string): {
|
|
|
1680
1690
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1681
1691
|
|
|
1682
1692
|
---
|
|
1683
|
-
|
|
1693
|
+
##### Function: processAction
|
|
1684
1694
|
|
|
1685
1695
|
```ts
|
|
1686
1696
|
export async function processAction(storage: StorageProvider, auth: sdk.AuthId, args: sdk.StorageProcessActionArgs): Promise<sdk.StorageProcessActionResults>
|
|
@@ -1691,7 +1701,7 @@ See also: [AuthId](#interface-authid), [StorageProcessActionArgs](#interface-sto
|
|
|
1691
1701
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1692
1702
|
|
|
1693
1703
|
---
|
|
1694
|
-
|
|
1704
|
+
##### Function: purgeData
|
|
1695
1705
|
|
|
1696
1706
|
```ts
|
|
1697
1707
|
export async function purgeData(storage: StorageKnex, params: sdk.PurgeParams, trx?: sdk.TrxToken): Promise<sdk.PurgeResults>
|
|
@@ -1702,7 +1712,7 @@ See also: [PurgeParams](#interface-purgeparams), [PurgeResults](#interface-purge
|
|
|
1702
1712
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1703
1713
|
|
|
1704
1714
|
---
|
|
1705
|
-
|
|
1715
|
+
##### Function: reviewStatus
|
|
1706
1716
|
|
|
1707
1717
|
```ts
|
|
1708
1718
|
export async function reviewStatus(storage: StorageKnex, args: {
|
|
@@ -1718,7 +1728,7 @@ See also: [StorageKnex](#class-storageknex), [TrxToken](#interface-trxtoken)
|
|
|
1718
1728
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1719
1729
|
|
|
1720
1730
|
---
|
|
1721
|
-
|
|
1731
|
+
##### Function: transactionInputSize
|
|
1722
1732
|
|
|
1723
1733
|
```ts
|
|
1724
1734
|
export function transactionInputSize(scriptSize: number): number
|
|
@@ -1742,7 +1752,7 @@ Argument Details
|
|
|
1742
1752
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1743
1753
|
|
|
1744
1754
|
---
|
|
1745
|
-
|
|
1755
|
+
##### Function: transactionOutputSize
|
|
1746
1756
|
|
|
1747
1757
|
```ts
|
|
1748
1758
|
export function transactionOutputSize(scriptSize: number): number
|
|
@@ -1766,7 +1776,7 @@ Argument Details
|
|
|
1766
1776
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1767
1777
|
|
|
1768
1778
|
---
|
|
1769
|
-
|
|
1779
|
+
##### Function: transactionSize
|
|
1770
1780
|
|
|
1771
1781
|
Compute the serialized binary transaction size in bytes
|
|
1772
1782
|
given the number of inputs and outputs,
|
|
@@ -1796,7 +1806,7 @@ Argument Details
|
|
|
1796
1806
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1797
1807
|
|
|
1798
1808
|
---
|
|
1799
|
-
|
|
1809
|
+
##### Function: validateGenerateChangeSdkParams
|
|
1800
1810
|
|
|
1801
1811
|
```ts
|
|
1802
1812
|
export function validateGenerateChangeSdkParams(params: GenerateChangeSdkParams)
|
|
@@ -1807,7 +1817,7 @@ See also: [GenerateChangeSdkParams](#interface-generatechangesdkparams)
|
|
|
1807
1817
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1808
1818
|
|
|
1809
1819
|
---
|
|
1810
|
-
|
|
1820
|
+
##### Function: validateGenerateChangeSdkResult
|
|
1811
1821
|
|
|
1812
1822
|
```ts
|
|
1813
1823
|
export function validateGenerateChangeSdkResult(params: GenerateChangeSdkParams, r: GenerateChangeSdkResult): {
|
|
@@ -1821,7 +1831,7 @@ See also: [GenerateChangeSdkParams](#interface-generatechangesdkparams), [Genera
|
|
|
1821
1831
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1822
1832
|
|
|
1823
1833
|
---
|
|
1824
|
-
|
|
1834
|
+
##### Function: validateStorageFeeModel
|
|
1825
1835
|
|
|
1826
1836
|
```ts
|
|
1827
1837
|
export function validateStorageFeeModel(v?: sdk.StorageFeeModel): sdk.StorageFeeModel
|
|
@@ -1832,7 +1842,7 @@ See also: [StorageFeeModel](#interface-storagefeemodel)
|
|
|
1832
1842
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1833
1843
|
|
|
1834
1844
|
---
|
|
1835
|
-
|
|
1845
|
+
##### Function: varUintSize
|
|
1836
1846
|
|
|
1837
1847
|
Returns the byte size required to encode number as Bitcoin VarUint
|
|
1838
1848
|
|
|
@@ -1849,7 +1859,7 @@ See also: [WERR_INVALID_PARAMETER](#class-werr_invalid_parameter)
|
|
|
1849
1859
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1850
1860
|
|
|
1851
1861
|
---
|
|
1852
|
-
|
|
1862
|
+
#### Types
|
|
1853
1863
|
|
|
1854
1864
|
| |
|
|
1855
1865
|
| --- |
|
|
@@ -1860,7 +1870,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
1860
1870
|
|
|
1861
1871
|
---
|
|
1862
1872
|
|
|
1863
|
-
|
|
1873
|
+
##### Type: DBType
|
|
1864
1874
|
|
|
1865
1875
|
```ts
|
|
1866
1876
|
export type DBType = "SQLite" | "MySQL"
|
|
@@ -1869,7 +1879,7 @@ export type DBType = "SQLite" | "MySQL"
|
|
|
1869
1879
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1870
1880
|
|
|
1871
1881
|
---
|
|
1872
|
-
|
|
1882
|
+
##### Type: PostReqsToNetworkDetailsStatus
|
|
1873
1883
|
|
|
1874
1884
|
```ts
|
|
1875
1885
|
export type PostReqsToNetworkDetailsStatus = "success" | "doubleSpend" | "unknown"
|
|
@@ -1878,5 +1888,7 @@ export type PostReqsToNetworkDetailsStatus = "success" | "doubleSpend" | "unknow
|
|
|
1878
1888
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1879
1889
|
|
|
1880
1890
|
---
|
|
1881
|
-
|
|
1891
|
+
#### Variables
|
|
1892
|
+
|
|
1882
1893
|
|
|
1894
|
+
<!--#endregion ts2md-api-merged-here-->
|