@bsv/wallet-toolbox 2.1.25 → 2.1.27
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/CHANGELOG.md +11 -0
- package/README.md +8 -17
- package/docs/client.md +1671 -989
- package/docs/monitor.md +34 -19
- package/docs/services.md +303 -279
- package/docs/setup.md +24 -24
- package/docs/storage.md +864 -199
- package/docs/wallet.md +5285 -10988
- package/out/src/Wallet.d.ts +46 -2
- package/out/src/Wallet.d.ts.map +1 -1
- package/out/src/Wallet.js +65 -4
- package/out/src/Wallet.js.map +1 -1
- package/out/src/__tests/CWIStyleWalletManager.test.js +3 -2
- package/out/src/__tests/CWIStyleWalletManager.test.js.map +1 -1
- package/out/src/__tests/ShamirWalletManager.test.js +4 -0
- package/out/src/__tests/ShamirWalletManager.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.js +9 -17
- package/out/src/__tests/WalletPermissionsManager.callbacks.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.checks.test.js +4 -4
- package/out/src/__tests/WalletPermissionsManager.checks.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.encryption.test.js +8 -8
- package/out/src/__tests/WalletPermissionsManager.encryption.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts +2 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.js +7 -5
- package/out/src/__tests/WalletPermissionsManager.fixtures.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.flows.test.js +14 -14
- package/out/src/__tests/WalletPermissionsManager.flows.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.initialization.test.js +4 -4
- package/out/src/__tests/WalletPermissionsManager.initialization.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.pmodules.test.js +4 -4
- package/out/src/__tests/WalletPermissionsManager.pmodules.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.proxying.test.js +6 -5
- package/out/src/__tests/WalletPermissionsManager.proxying.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.tokens.test.js +2 -1
- package/out/src/__tests/WalletPermissionsManager.tokens.test.js.map +1 -1
- package/out/src/entropy/EntropyCollector.js.map +1 -1
- package/out/src/mockchain/MockChainMigrations.d.ts.map +1 -1
- package/out/src/mockchain/MockChainStorage.js +3 -3
- package/out/src/mockchain/MockChainStorage.js.map +1 -1
- package/out/src/mockchain/MockMiner.js +1 -1
- package/out/src/mockchain/MockMiner.js.map +1 -1
- package/out/src/mockchain/MockServices.js +14 -13
- package/out/src/mockchain/MockServices.js.map +1 -1
- package/out/src/monitor/Monitor.js +8 -6
- package/out/src/monitor/Monitor.js.map +1 -1
- package/out/src/monitor/MonitorDaemon.d.ts.map +1 -1
- package/out/src/monitor/MonitorDaemon.js +11 -13
- package/out/src/monitor/MonitorDaemon.js.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.js +6 -3
- package/out/src/sdk/PrivilegedKeyManager.js.map +1 -1
- package/out/src/sdk/WalletError.d.ts.map +1 -1
- package/out/src/sdk/WalletError.js +19 -18
- package/out/src/sdk/WalletError.js.map +1 -1
- package/out/src/sdk/WalletErrorFromJson.js +1 -1
- package/out/src/sdk/WalletErrorFromJson.js.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts +59 -59
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/services/ServiceCollection.d.ts.map +1 -1
- package/out/src/services/ServiceCollection.js +3 -4
- package/out/src/services/ServiceCollection.js.map +1 -1
- package/out/src/services/Services.d.ts.map +1 -1
- package/out/src/services/Services.js +27 -25
- package/out/src/services/Services.js.map +1 -1
- package/out/src/storage/StorageIdb.d.ts.map +1 -1
- package/out/src/storage/StorageIdb.js +99 -94
- package/out/src/storage/StorageIdb.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts +1 -1
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +159 -156
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +35 -31
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/src/storage/StorageReader.js +7 -7
- package/out/src/storage/StorageReader.js.map +1 -1
- package/out/src/storage/StorageReaderWriter.d.ts +0 -1
- package/out/src/storage/StorageReaderWriter.d.ts.map +1 -1
- package/out/src/storage/StorageReaderWriter.js +0 -3
- package/out/src/storage/StorageReaderWriter.js.map +1 -1
- package/out/src/storage/StorageSyncReader.js +1 -1
- package/out/src/storage/StorageSyncReader.js.map +1 -1
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
- package/out/src/storage/WalletStorageManager.js +22 -21
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/index.all.d.ts +3 -0
- package/out/src/storage/index.all.d.ts.map +1 -1
- package/out/src/storage/index.all.js +3 -0
- package/out/src/storage/index.all.js.map +1 -1
- package/out/src/storage/index.client.d.ts +3 -0
- package/out/src/storage/index.client.d.ts.map +1 -1
- package/out/src/storage/index.client.js +3 -0
- package/out/src/storage/index.client.js.map +1 -1
- package/out/src/storage/index.mobile.d.ts +3 -0
- package/out/src/storage/index.mobile.d.ts.map +1 -1
- package/out/src/storage/index.mobile.js +3 -0
- package/out/src/storage/index.mobile.js.map +1 -1
- package/out/src/storage/portable/index.d.ts +55 -0
- package/out/src/storage/portable/index.d.ts.map +1 -0
- package/out/src/storage/portable/index.js +830 -0
- package/out/src/storage/portable/index.js.map +1 -0
- package/out/src/storage/storageProviderHelpers.js +2 -2
- package/out/src/storage/storageProviderHelpers.js.map +1 -1
- package/out/src/utility/Format.d.ts.map +1 -1
- package/out/src/utility/Format.js +10 -45
- package/out/src/utility/Format.js.map +1 -1
- package/out/src/utility/ScriptTemplateBRC29.d.ts.map +1 -1
- package/out/src/utility/ScriptTemplateBRC29.js +3 -2
- package/out/src/utility/ScriptTemplateBRC29.js.map +1 -1
- package/out/src/utility/brc114ActionTimeLabels.js +1 -1
- package/out/src/utility/brc114ActionTimeLabels.js.map +1 -1
- package/out/src/utility/identityUtils.d.ts +12 -6
- package/out/src/utility/identityUtils.d.ts.map +1 -1
- package/out/src/utility/identityUtils.js +83 -35
- package/out/src/utility/identityUtils.js.map +1 -1
- package/out/src/utility/index.all.d.ts +1 -0
- package/out/src/utility/index.all.d.ts.map +1 -1
- package/out/src/utility/index.all.js +1 -0
- package/out/src/utility/index.all.js.map +1 -1
- package/out/src/utility/index.client.d.ts +1 -0
- package/out/src/utility/index.client.d.ts.map +1 -1
- package/out/src/utility/index.client.js +1 -0
- package/out/src/utility/index.client.js.map +1 -1
- package/out/src/utility/stampLog.js +3 -3
- package/out/src/utility/stampLog.js.map +1 -1
- package/out/src/utility/utilityHelpers.buffer.js +1 -1
- package/out/src/utility/utilityHelpers.buffer.js.map +1 -1
- package/out/src/utility/utilityHelpers.d.ts.map +1 -1
- package/out/src/utility/utilityHelpers.js +2 -2
- package/out/src/utility/utilityHelpers.js.map +1 -1
- package/out/src/wab-client/WABClient.d.ts +2 -2
- package/out/src/wab-client/WABClient.d.ts.map +1 -1
- package/package.json +2 -2
- package/out/src/storage/schema/__tests/v7Backfill.runner.test.d.ts +0 -2
- package/out/src/storage/schema/__tests/v7Backfill.runner.test.d.ts.map +0 -1
- package/out/src/storage/schema/__tests/v7Backfill.runner.test.js +0 -148
- package/out/src/storage/schema/__tests/v7Backfill.runner.test.js.map +0 -1
- package/out/src/storage/schema/__tests/v7Backfill.test.d.ts +0 -2
- package/out/src/storage/schema/__tests/v7Backfill.test.d.ts.map +0 -1
- package/out/src/storage/schema/__tests/v7Backfill.test.js +0 -96
- package/out/src/storage/schema/__tests/v7Backfill.test.js.map +0 -1
- package/out/src/storage/schema/__tests/v7Fsm.test.d.ts +0 -2
- package/out/src/storage/schema/__tests/v7Fsm.test.d.ts.map +0 -1
- package/out/src/storage/schema/__tests/v7Fsm.test.js +0 -42
- package/out/src/storage/schema/__tests/v7Fsm.test.js.map +0 -1
- package/out/src/storage/schema/__tests/v7Spendability.test.d.ts +0 -2
- package/out/src/storage/schema/__tests/v7Spendability.test.d.ts.map +0 -1
- package/out/src/storage/schema/__tests/v7Spendability.test.js +0 -29
- package/out/src/storage/schema/__tests/v7Spendability.test.js.map +0 -1
- package/out/src/storage/schema/tables/TableAction.d.ts +0 -38
- package/out/src/storage/schema/tables/TableAction.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableAction.js +0 -3
- package/out/src/storage/schema/tables/TableAction.js.map +0 -1
- package/out/src/storage/schema/tables/TableChainTip.d.ts +0 -17
- package/out/src/storage/schema/tables/TableChainTip.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableChainTip.js +0 -3
- package/out/src/storage/schema/tables/TableChainTip.js.map +0 -1
- package/out/src/storage/schema/tables/TableMonitorLease.d.ts +0 -23
- package/out/src/storage/schema/tables/TableMonitorLease.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableMonitorLease.js +0 -3
- package/out/src/storage/schema/tables/TableMonitorLease.js.map +0 -1
- package/out/src/storage/schema/tables/TableTransactionV7.d.ts +0 -50
- package/out/src/storage/schema/tables/TableTransactionV7.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableTransactionV7.js +0 -3
- package/out/src/storage/schema/tables/TableTransactionV7.js.map +0 -1
- package/out/src/storage/schema/tables/TableTxAudit.d.ts +0 -26
- package/out/src/storage/schema/tables/TableTxAudit.d.ts.map +0 -1
- package/out/src/storage/schema/tables/TableTxAudit.js +0 -3
- package/out/src/storage/schema/tables/TableTxAudit.js.map +0 -1
- package/out/src/storage/schema/v7Backfill.d.ts +0 -35
- package/out/src/storage/schema/v7Backfill.d.ts.map +0 -1
- package/out/src/storage/schema/v7Backfill.idb.d.ts +0 -32
- package/out/src/storage/schema/v7Backfill.idb.d.ts.map +0 -1
- package/out/src/storage/schema/v7Backfill.idb.js +0 -95
- package/out/src/storage/schema/v7Backfill.idb.js.map +0 -1
- package/out/src/storage/schema/v7Backfill.js +0 -147
- package/out/src/storage/schema/v7Backfill.js.map +0 -1
- package/out/src/storage/schema/v7Backfill.knex.d.ts +0 -32
- package/out/src/storage/schema/v7Backfill.knex.d.ts.map +0 -1
- package/out/src/storage/schema/v7Backfill.knex.js +0 -240
- package/out/src/storage/schema/v7Backfill.knex.js.map +0 -1
- package/out/src/storage/schema/v7Backfill.runner.d.ts +0 -63
- package/out/src/storage/schema/v7Backfill.runner.d.ts.map +0 -1
- package/out/src/storage/schema/v7Backfill.runner.js +0 -62
- package/out/src/storage/schema/v7Backfill.runner.js.map +0 -1
- package/out/src/storage/schema/v7Crud.d.ts +0 -39
- package/out/src/storage/schema/v7Crud.d.ts.map +0 -1
- package/out/src/storage/schema/v7Crud.js +0 -203
- package/out/src/storage/schema/v7Crud.js.map +0 -1
- package/out/src/storage/schema/v7Fsm.d.ts +0 -27
- package/out/src/storage/schema/v7Fsm.d.ts.map +0 -1
- package/out/src/storage/schema/v7Fsm.js +0 -108
- package/out/src/storage/schema/v7Fsm.js.map +0 -1
- package/out/src/storage/schema/v7MonitorLease.d.ts +0 -57
- package/out/src/storage/schema/v7MonitorLease.d.ts.map +0 -1
- package/out/src/storage/schema/v7MonitorLease.js +0 -101
- package/out/src/storage/schema/v7MonitorLease.js.map +0 -1
- package/out/src/storage/schema/v7Spendability.d.ts +0 -45
- package/out/src/storage/schema/v7Spendability.d.ts.map +0 -1
- package/out/src/storage/schema/v7Spendability.js +0 -52
- package/out/src/storage/schema/v7Spendability.js.map +0 -1
- package/out/src/storage/schema/v7TxAudit.d.ts +0 -33
- package/out/src/storage/schema/v7TxAudit.d.ts.map +0 -1
- package/out/src/storage/schema/v7TxAudit.js +0 -64
- package/out/src/storage/schema/v7TxAudit.js.map +0 -1
package/docs/storage.md
CHANGED
|
@@ -22,7 +22,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
22
22
|
|
|
23
23
|
| | | |
|
|
24
24
|
| --- | --- | --- |
|
|
25
|
-
| [AdminStatsResult](#interface-adminstatsresult) | [
|
|
25
|
+
| [AdminStatsResult](#interface-adminstatsresult) | [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [TableOutput](#interface-tableoutput) |
|
|
26
|
+
| [AggregatePostBeefTxResult](#interface-aggregatepostbeeftxresult) | [ProvenTxFromTxidResult](#interface-proventxfromtxidresult) | [TableOutputBasket](#interface-tableoutputbasket) |
|
|
26
27
|
| [CommitNewTxResults](#interface-commitnewtxresults) | [ProvenTxReqHistory](#interface-proventxreqhistory) | [TableOutputTag](#interface-tableoutputtag) |
|
|
27
28
|
| [EntitySyncMap](#interface-entitysyncmap) | [ProvenTxReqHistorySummaryApi](#interface-proventxreqhistorysummaryapi) | [TableOutputTagMap](#interface-tableoutputtagmap) |
|
|
28
29
|
| [GenerateChangeSdkChangeInput](#interface-generatechangesdkchangeinput) | [ProvenTxReqNotify](#interface-proventxreqnotify) | [TableOutputX](#interface-tableoutputx) |
|
|
@@ -40,7 +41,6 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
40
41
|
| [MonitorAdminContextConfig](#interface-monitoradmincontextconfig) | [TableCertificateX](#interface-tablecertificatex) | [WalletStorageServerOptions](#interface-walletstorageserveroptions) |
|
|
41
42
|
| [PostBeefResultForTxidApi](#interface-postbeefresultfortxidapi) | [TableCommission](#interface-tablecommission) | [XValidCreateActionOutput](#interface-xvalidcreateactionoutput) |
|
|
42
43
|
| [PostReqsToNetworkDetails](#interface-postreqstonetworkdetails) | [TableMonitorEvent](#interface-tablemonitorevent) | |
|
|
43
|
-
| [PostReqsToNetworkResult](#interface-postreqstonetworkresult) | [TableOutput](#interface-tableoutput) | |
|
|
44
44
|
|
|
45
45
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
46
46
|
|
|
@@ -55,7 +55,36 @@ export interface AdminStatsResult extends StorageAdminStats {
|
|
|
55
55
|
}
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
See also: [ServicesCallHistory](./client.md#
|
|
58
|
+
See also: [ServicesCallHistory](./client.md#interface-servicescallhistory), [StorageAdminStats](./storage.md#interface-storageadminstats)
|
|
59
|
+
|
|
60
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
##### Interface: AggregatePostBeefTxResult
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
export interface AggregatePostBeefTxResult {
|
|
67
|
+
txid: string;
|
|
68
|
+
txidResults: sdk.PostTxResultForTxid[];
|
|
69
|
+
status: AggregateStatus;
|
|
70
|
+
vreq: PostReqsToNetworkDetails;
|
|
71
|
+
successCount: number;
|
|
72
|
+
doubleSpendCount: number;
|
|
73
|
+
statusErrorCount: number;
|
|
74
|
+
serviceErrorCount: number;
|
|
75
|
+
competingTxs: string[];
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
See also: [PostReqsToNetworkDetails](./storage.md#interface-postreqstonetworkdetails), [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
80
|
+
|
|
81
|
+
###### Property competingTxs
|
|
82
|
+
|
|
83
|
+
Any competing double spend txids reported for this txid
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
competingTxs: string[]
|
|
87
|
+
```
|
|
59
88
|
|
|
60
89
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
61
90
|
|
|
@@ -321,7 +350,7 @@ export interface ListActionsSpecOp {
|
|
|
321
350
|
name: string;
|
|
322
351
|
labelsToIntercept?: string[];
|
|
323
352
|
setStatusFilter?: () => TransactionStatus[];
|
|
324
|
-
postProcess?: (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListActionsArgs, specOpLabels: string[], txs: Partial<TableTransaction
|
|
353
|
+
postProcess?: (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListActionsArgs, specOpLabels: string[], txs: Array<Partial<TableTransaction>>) => Promise<void>;
|
|
325
354
|
}
|
|
326
355
|
```
|
|
327
356
|
|
|
@@ -518,7 +547,7 @@ export interface ProvenTxReqHistory {
|
|
|
518
547
|
}
|
|
519
548
|
```
|
|
520
549
|
|
|
521
|
-
See also: [ReqHistoryNote](./client.md#
|
|
550
|
+
See also: [ReqHistoryNote](./client.md#interface-reqhistorynote)
|
|
522
551
|
|
|
523
552
|
###### Property notes
|
|
524
553
|
|
|
@@ -528,7 +557,7 @@ Values are a description of what happened.
|
|
|
528
557
|
```ts
|
|
529
558
|
notes?: ReqHistoryNote[]
|
|
530
559
|
```
|
|
531
|
-
See also: [ReqHistoryNote](./client.md#
|
|
560
|
+
See also: [ReqHistoryNote](./client.md#interface-reqhistorynote)
|
|
532
561
|
|
|
533
562
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
534
563
|
|
|
@@ -1166,6 +1195,8 @@ export interface TableProvenTxReq extends TableProvenTxReqDynamics {
|
|
|
1166
1195
|
notify: string;
|
|
1167
1196
|
rawTx: number[];
|
|
1168
1197
|
inputBEEF?: number[];
|
|
1198
|
+
wasBroadcast?: boolean;
|
|
1199
|
+
rebroadcastAttempts?: number;
|
|
1169
1200
|
}
|
|
1170
1201
|
```
|
|
1171
1202
|
|
|
@@ -1213,6 +1244,27 @@ Parses to `ProvenTxReqNotifyApi`.
|
|
|
1213
1244
|
notify: string
|
|
1214
1245
|
```
|
|
1215
1246
|
|
|
1247
|
+
###### Property rebroadcastAttempts
|
|
1248
|
+
|
|
1249
|
+
Count of how many times this req has been reset to 'unsent' for rebroadcast
|
|
1250
|
+
after proof check timeout. Used by the circuit-breaker (maxRebroadcastAttempts).
|
|
1251
|
+
Defaults to 0 (added by migration 2026-04-30-001).
|
|
1252
|
+
|
|
1253
|
+
```ts
|
|
1254
|
+
rebroadcastAttempts?: number
|
|
1255
|
+
```
|
|
1256
|
+
|
|
1257
|
+
###### Property wasBroadcast
|
|
1258
|
+
|
|
1259
|
+
Set to true the first time this req transitions to 'unmined' or 'callback' status,
|
|
1260
|
+
indicating the transaction was successfully broadcast to the network.
|
|
1261
|
+
Used to distinguish rebroadcast candidates from transactions that were never sent.
|
|
1262
|
+
Defaults to false (added by migration 2026-04-30-001).
|
|
1263
|
+
|
|
1264
|
+
```ts
|
|
1265
|
+
wasBroadcast?: boolean
|
|
1266
|
+
```
|
|
1267
|
+
|
|
1216
1268
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1217
1269
|
|
|
1218
1270
|
---
|
|
@@ -1230,6 +1282,8 @@ export interface TableProvenTxReqDynamics extends sdk.EntityTimeStamp {
|
|
|
1230
1282
|
batch?: string;
|
|
1231
1283
|
history: string;
|
|
1232
1284
|
notify: string;
|
|
1285
|
+
wasBroadcast?: boolean;
|
|
1286
|
+
rebroadcastAttempts?: number;
|
|
1233
1287
|
}
|
|
1234
1288
|
```
|
|
1235
1289
|
|
|
@@ -1277,6 +1331,24 @@ Parses to `ProvenTxReqNotifyApi`.
|
|
|
1277
1331
|
notify: string
|
|
1278
1332
|
```
|
|
1279
1333
|
|
|
1334
|
+
###### Property rebroadcastAttempts
|
|
1335
|
+
|
|
1336
|
+
Count of rebroadcast cycles for this req. Used by the circuit-breaker.
|
|
1337
|
+
Defaults to 0 (added by migration 2026-04-30-001).
|
|
1338
|
+
|
|
1339
|
+
```ts
|
|
1340
|
+
rebroadcastAttempts?: number
|
|
1341
|
+
```
|
|
1342
|
+
|
|
1343
|
+
###### Property wasBroadcast
|
|
1344
|
+
|
|
1345
|
+
Set to true the first time this req transitions to 'unmined' or 'callback' status.
|
|
1346
|
+
Defaults to false (added by migration 2026-04-30-001).
|
|
1347
|
+
|
|
1348
|
+
```ts
|
|
1349
|
+
wasBroadcast?: boolean
|
|
1350
|
+
```
|
|
1351
|
+
|
|
1280
1352
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1281
1353
|
|
|
1282
1354
|
---
|
|
@@ -1542,15 +1614,16 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
1542
1614
|
|
|
1543
1615
|
| | | |
|
|
1544
1616
|
| --- | --- | --- |
|
|
1545
|
-
| [AdminServer](#class-adminserver) | [
|
|
1546
|
-
| [EntityBase](#class-entitybase) | [
|
|
1547
|
-
| [EntityCertificate](#class-entitycertificate) | [
|
|
1548
|
-
| [EntityCertificateField](#class-entitycertificatefield) | [
|
|
1549
|
-
| [EntityCommission](#class-entitycommission) | [
|
|
1550
|
-
| [EntityOutput](#class-entityoutput) | [
|
|
1551
|
-
| [EntityOutputBasket](#class-entityoutputbasket) | [
|
|
1552
|
-
| [EntityOutputTag](#class-entityoutputtag) | [
|
|
1553
|
-
| [EntityOutputTagMap](#class-entityoutputtagmap) | [
|
|
1617
|
+
| [AdminServer](#class-adminserver) | [EntityProvenTxReq](#class-entityproventxreq) | [StorageIdb](#class-storageidb) |
|
|
1618
|
+
| [EntityBase](#class-entitybase) | [EntitySyncState](#class-entitysyncstate) | [StorageKnex](#class-storageknex) |
|
|
1619
|
+
| [EntityCertificate](#class-entitycertificate) | [EntityTransaction](#class-entitytransaction) | [StorageProvider](#class-storageprovider) |
|
|
1620
|
+
| [EntityCertificateField](#class-entitycertificatefield) | [EntityTxLabel](#class-entitytxlabel) | [StorageReader](#class-storagereader) |
|
|
1621
|
+
| [EntityCommission](#class-entitycommission) | [EntityTxLabelMap](#class-entitytxlabelmap) | [StorageReaderWriter](#class-storagereaderwriter) |
|
|
1622
|
+
| [EntityOutput](#class-entityoutput) | [EntityUser](#class-entityuser) | [StorageServer](#class-storageserver) |
|
|
1623
|
+
| [EntityOutputBasket](#class-entityoutputbasket) | [KnexMigrations](#class-knexmigrations) | [StorageSyncReader](#class-storagesyncreader) |
|
|
1624
|
+
| [EntityOutputTag](#class-entityoutputtag) | [MergeEntity](#class-mergeentity) | [WalletStorageManager](#class-walletstoragemanager) |
|
|
1625
|
+
| [EntityOutputTagMap](#class-entityoutputtagmap) | [StorageClient](#class-storageclient) | |
|
|
1626
|
+
| [EntityProvenTx](#class-entityproventx) | [StorageClientBase](#class-storageclientbase) | |
|
|
1554
1627
|
|
|
1555
1628
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1556
1629
|
|
|
@@ -2026,9 +2099,9 @@ export class EntityProvenTx extends EntityBase<TableProvenTx> {
|
|
|
2026
2099
|
}>
|
|
2027
2100
|
override async mergeNew(storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: TrxToken): Promise<void>
|
|
2028
2101
|
override async mergeExisting(storage: EntityStorage, since: Date | undefined, ei: TableProvenTx, syncMap: SyncMap, trx?: TrxToken): Promise<boolean>
|
|
2029
|
-
static getProofAttemptsLimit = 8;
|
|
2030
|
-
static getProofMinutes = 60;
|
|
2031
|
-
static async fromReq(req: EntityProvenTxReq, gmpResult: GetMerklePathResult, countsAsAttempt: boolean): Promise<EntityProvenTx | undefined>
|
|
2102
|
+
static readonly getProofAttemptsLimit = 8;
|
|
2103
|
+
static readonly getProofMinutes = 60;
|
|
2104
|
+
static async fromReq(req: EntityProvenTxReq, gmpResult: GetMerklePathResult, countsAsAttempt: boolean, maxRebroadcastAttempts = 0): Promise<EntityProvenTx | undefined>
|
|
2032
2105
|
}
|
|
2033
2106
|
```
|
|
2034
2107
|
|
|
@@ -2039,7 +2112,7 @@ See also: [EntityBase](./storage.md#class-entitybase), [EntityProvenTxReq](./sto
|
|
|
2039
2112
|
How high attempts can go before status is forced to invalid
|
|
2040
2113
|
|
|
2041
2114
|
```ts
|
|
2042
|
-
static getProofAttemptsLimit = 8
|
|
2115
|
+
static readonly getProofAttemptsLimit = 8
|
|
2043
2116
|
```
|
|
2044
2117
|
|
|
2045
2118
|
###### Property getProofMinutes
|
|
@@ -2047,7 +2120,7 @@ static getProofAttemptsLimit = 8
|
|
|
2047
2120
|
How many hours we have to try for a poof
|
|
2048
2121
|
|
|
2049
2122
|
```ts
|
|
2050
|
-
static getProofMinutes = 60
|
|
2123
|
+
static readonly getProofMinutes = 60
|
|
2051
2124
|
```
|
|
2052
2125
|
|
|
2053
2126
|
###### Method fromReq
|
|
@@ -2057,7 +2130,7 @@ Try to create a new ProvenTx from a ProvenTxReq and GetMerkleProofResultApi
|
|
|
2057
2130
|
Otherwise it returns undefined and updates req.status to either 'unknown', 'invalid', or 'unconfirmed'
|
|
2058
2131
|
|
|
2059
2132
|
```ts
|
|
2060
|
-
static async fromReq(req: EntityProvenTxReq, gmpResult: GetMerklePathResult, countsAsAttempt: boolean): Promise<EntityProvenTx | undefined>
|
|
2133
|
+
static async fromReq(req: EntityProvenTxReq, gmpResult: GetMerklePathResult, countsAsAttempt: boolean, maxRebroadcastAttempts = 0): Promise<EntityProvenTx | undefined>
|
|
2061
2134
|
```
|
|
2062
2135
|
See also: [EntityProvenTx](./storage.md#class-entityproventx), [EntityProvenTxReq](./storage.md#class-entityproventxreq), [GetMerklePathResult](./client.md#interface-getmerklepathresult)
|
|
2063
2136
|
|
|
@@ -2095,6 +2168,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
2095
2168
|
|
|
2096
2169
|
```ts
|
|
2097
2170
|
export class EntityProvenTxReq extends EntityBase<TableProvenTxReq> {
|
|
2171
|
+
static readonly wasBroadcastStatuses: ProvenTxReqStatus[] = ["unmined", "callback", "unconfirmed", "completed"];
|
|
2098
2172
|
static async fromStorageTxid(storage: EntityStorage, txid: string, trx?: TrxToken): Promise<EntityProvenTxReq | undefined>
|
|
2099
2173
|
static async fromStorageId(storage: EntityStorage, id: number, trx?: TrxToken): Promise<EntityProvenTxReq>
|
|
2100
2174
|
static fromTxid(txid: string, rawTx: number[], inputBEEF?: number[]): EntityProvenTxReq
|
|
@@ -2144,6 +2218,14 @@ export class EntityProvenTxReq extends EntityBase<TableProvenTxReq> {
|
|
|
2144
2218
|
set notified(v: boolean)
|
|
2145
2219
|
get batch()
|
|
2146
2220
|
set batch(v: string | undefined)
|
|
2221
|
+
get wasBroadcast(): boolean
|
|
2222
|
+
set wasBroadcast(v: boolean)
|
|
2223
|
+
get rebroadcastAttempts(): number
|
|
2224
|
+
set rebroadcastAttempts(v: number)
|
|
2225
|
+
applyProofTimeout(maxRebroadcastAttempts = 0): {
|
|
2226
|
+
action: "invalid" | "rebroadcast";
|
|
2227
|
+
rebroadcastAttempts: number;
|
|
2228
|
+
}
|
|
2147
2229
|
override get id()
|
|
2148
2230
|
override set id(v: number)
|
|
2149
2231
|
override get entityName(): string
|
|
@@ -2163,7 +2245,7 @@ export class EntityProvenTxReq extends EntityBase<TableProvenTxReq> {
|
|
|
2163
2245
|
}
|
|
2164
2246
|
```
|
|
2165
2247
|
|
|
2166
|
-
See also: [EntityBase](./storage.md#class-entitybase), [EntityStorage](./storage.md#type-entitystorage), [ProvenTxReqHistory](./storage.md#interface-proventxreqhistory), [ProvenTxReqHistorySummaryApi](./storage.md#interface-proventxreqhistorysummaryapi), [ProvenTxReqNotify](./storage.md#interface-proventxreqnotify), [ProvenTxReqStatus](./client.md#type-proventxreqstatus), [ReqHistoryNote](./client.md#
|
|
2248
|
+
See also: [EntityBase](./storage.md#class-entitybase), [EntityStorage](./storage.md#type-entitystorage), [ProvenTxReqHistory](./storage.md#interface-proventxreqhistory), [ProvenTxReqHistorySummaryApi](./storage.md#interface-proventxreqhistorysummaryapi), [ProvenTxReqNotify](./storage.md#interface-proventxreqnotify), [ProvenTxReqStatus](./client.md#type-proventxreqstatus), [ReqHistoryNote](./client.md#interface-reqhistorynote), [StorageProvider](./storage.md#class-storageprovider), [SyncMap](./storage.md#interface-syncmap), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TrxToken](./client.md#interface-trxtoken), [WalletStorageManager](./storage.md#class-walletstoragemanager)
|
|
2167
2249
|
|
|
2168
2250
|
###### Method addHistoryNote
|
|
2169
2251
|
|
|
@@ -2173,7 +2255,7 @@ Notes with identical property values to an existing note are ignored.
|
|
|
2173
2255
|
```ts
|
|
2174
2256
|
addHistoryNote(note: ReqHistoryNote, noDupes?: boolean)
|
|
2175
2257
|
```
|
|
2176
|
-
See also: [ReqHistoryNote](./client.md#
|
|
2258
|
+
See also: [ReqHistoryNote](./client.md#interface-reqhistorynote)
|
|
2177
2259
|
|
|
2178
2260
|
Argument Details
|
|
2179
2261
|
|
|
@@ -2299,28 +2381,28 @@ export class EntitySyncState extends EntityBase<TableSyncState> {
|
|
|
2299
2381
|
to storage: ${c.toStorageIdentityKey}
|
|
2300
2382
|
for user: ${c.userIdentityKey}
|
|
2301
2383
|
`;
|
|
2302
|
-
if (c.user)
|
|
2384
|
+
if (c.user != null)
|
|
2303
2385
|
log += ` USER activeStorage ${c.user.activeStorage}\n`;
|
|
2304
|
-
if (
|
|
2305
|
-
log +=
|
|
2386
|
+
if (c.provenTxs != null) {
|
|
2387
|
+
log += " PROVEN_TXS\n";
|
|
2306
2388
|
for (const r of c.provenTxs) {
|
|
2307
2389
|
log += ` ${r.provenTxId} ${r.txid}\n`;
|
|
2308
2390
|
}
|
|
2309
2391
|
}
|
|
2310
|
-
if (
|
|
2311
|
-
log +=
|
|
2392
|
+
if (c.provenTxReqs != null) {
|
|
2393
|
+
log += " PROVEN_TX_REQS\n";
|
|
2312
2394
|
for (const r of c.provenTxReqs) {
|
|
2313
2395
|
log += ` ${r.provenTxReqId} ${r.txid} ${r.status} ${r.provenTxId || ""}\n`;
|
|
2314
2396
|
}
|
|
2315
2397
|
}
|
|
2316
|
-
if (
|
|
2317
|
-
log +=
|
|
2398
|
+
if (c.transactions != null) {
|
|
2399
|
+
log += " TRANSACTIONS\n";
|
|
2318
2400
|
for (const r of c.transactions) {
|
|
2319
2401
|
log += ` ${r.transactionId} ${r.txid} ${r.status} ${r.provenTxId || ""} sats:${r.satoshis}\n`;
|
|
2320
2402
|
}
|
|
2321
2403
|
}
|
|
2322
|
-
if (
|
|
2323
|
-
log +=
|
|
2404
|
+
if (c.outputs != null) {
|
|
2405
|
+
log += " OUTPUTS\n";
|
|
2324
2406
|
for (const r of c.outputs) {
|
|
2325
2407
|
log += ` ${r.outputId} ${r.txid}.${r.vout} ${r.transactionId} ${r.spendable ? "spendable" : ""} sats:${r.satoshis}\n`;
|
|
2326
2408
|
}
|
|
@@ -2642,11 +2724,49 @@ the party making requests of the remote service.
|
|
|
2642
2724
|
For details of the API implemented, follow the "See also" link for the `WalletStorageProvider` interface.
|
|
2643
2725
|
|
|
2644
2726
|
```ts
|
|
2645
|
-
export class StorageClient
|
|
2727
|
+
export class StorageClient extends StorageClientBase {
|
|
2728
|
+
constructor(wallet: WalletInterface, endpointUrl: string)
|
|
2729
|
+
protected async rpcCall<T>(method: string, params: unknown[]): Promise<T>
|
|
2730
|
+
}
|
|
2731
|
+
```
|
|
2732
|
+
|
|
2733
|
+
See also: [StorageClientBase](./storage.md#class-storageclientbase)
|
|
2734
|
+
|
|
2735
|
+
###### Method rpcCall
|
|
2736
|
+
|
|
2737
|
+
Make a JSON-RPC call to the remote server.
|
|
2738
|
+
|
|
2739
|
+
```ts
|
|
2740
|
+
protected async rpcCall<T>(method: string, params: unknown[]): Promise<T>
|
|
2741
|
+
```
|
|
2742
|
+
|
|
2743
|
+
Argument Details
|
|
2744
|
+
|
|
2745
|
+
+ **method**
|
|
2746
|
+
+ The WalletStorage method name to call.
|
|
2747
|
+
+ **params**
|
|
2748
|
+
+ The array of parameters to pass to the method in order.
|
|
2749
|
+
|
|
2750
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2751
|
+
|
|
2752
|
+
---
|
|
2753
|
+
##### Class: StorageClientBase
|
|
2754
|
+
|
|
2755
|
+
Abstract base class shared by `StorageClient` and `StorageMobile`.
|
|
2756
|
+
|
|
2757
|
+
Contains all `WalletStorageProvider` method implementations and entity-validation
|
|
2758
|
+
helpers. Subclasses only need to provide `rpcCall`, which differs between
|
|
2759
|
+
the full (logger-aware) and mobile (lightweight) variants.
|
|
2760
|
+
|
|
2761
|
+
```ts
|
|
2762
|
+
export abstract class StorageClientBase implements WalletStorageProvider {
|
|
2646
2763
|
readonly endpointUrl: string;
|
|
2764
|
+
protected readonly authClient: AuthFetch;
|
|
2765
|
+
protected nextId = 1;
|
|
2647
2766
|
public settings?: TableSettings;
|
|
2648
2767
|
constructor(wallet: WalletInterface, endpointUrl: string)
|
|
2649
2768
|
isStorageProvider(): boolean
|
|
2769
|
+
protected abstract rpcCall<T>(method: string, params: unknown[]): Promise<T>;
|
|
2650
2770
|
isAvailable(): boolean
|
|
2651
2771
|
getSettings(): TableSettings
|
|
2652
2772
|
async makeAvailable(): Promise<TableSettings>
|
|
@@ -2686,7 +2806,7 @@ export class StorageClient implements WalletStorageProvider {
|
|
|
2686
2806
|
}
|
|
2687
2807
|
```
|
|
2688
2808
|
|
|
2689
|
-
See also: [AuthId](./client.md#interface-authid), [EntityTimeStamp](./client.md#interface-entitytimestamp), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [ProcessSyncChunkResult](./client.md#interface-processsyncchunkresult), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [StorageCreateActionResult](./client.md#interface-storagecreateactionresult), [StorageInternalizeActionResult](./client.md#interface-storageinternalizeactionresult), [StorageProcessActionArgs](./client.md#interface-storageprocessactionargs), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [SyncChunk](./client.md#interface-syncchunk), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableUser](./storage.md#interface-tableuser), [UpdateProvenTxReqWithNewProvenTxArgs](./client.md#interface-updateproventxreqwithnewproventxargs), [UpdateProvenTxReqWithNewProvenTxResult](./client.md#interface-updateproventxreqwithnewproventxresult), [WalletServices](./client.md#interface-walletservices), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [createAction](./storage.md#function-createaction), [getSyncChunk](./storage.md#function-getsyncchunk), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [processAction](./storage.md#function-processaction)
|
|
2809
|
+
See also: [AuthId](./client.md#interface-authid), [EntityTimeStamp](./client.md#interface-entitytimestamp), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [ProcessSyncChunkResult](./client.md#interface-processsyncchunkresult), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [StorageCreateActionResult](./client.md#interface-storagecreateactionresult), [StorageInternalizeActionResult](./client.md#interface-storageinternalizeactionresult), [StorageProcessActionArgs](./client.md#interface-storageprocessactionargs), [StorageProcessActionResults](./client.md#interface-storageprocessactionresults), [SyncChunk](./client.md#interface-syncchunk), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableUser](./storage.md#interface-tableuser), [UpdateProvenTxReqWithNewProvenTxArgs](./client.md#interface-updateproventxreqwithnewproventxargs), [UpdateProvenTxReqWithNewProvenTxResult](./client.md#interface-updateproventxreqwithnewproventxresult), [WalletServices](./client.md#interface-walletservices), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [createAction](./storage.md#function-createaction), [getSyncChunk](./storage.md#function-getsyncchunk), [internalizeAction](./storage.md#function-internalizeaction), [listActions](./storage.md#function-listactions), [listCertificates](./storage.md#function-listcertificates), [listOutputs](./storage.md#function-listoutputs), [processAction](./storage.md#function-processaction), [validateDate](./storage.md#function-validatedate), [validateEntities](./storage.md#function-validateentities), [validateEntity](./storage.md#function-validateentity)
|
|
2690
2810
|
|
|
2691
2811
|
###### Method abortAction
|
|
2692
2812
|
|
|
@@ -3176,6 +3296,22 @@ This must match the `AuthFetch` identity securing the remote conneciton.
|
|
|
3176
3296
|
+ **args**
|
|
3177
3297
|
+ original wallet `relinquishOutput` args.
|
|
3178
3298
|
|
|
3299
|
+
###### Method rpcCall
|
|
3300
|
+
|
|
3301
|
+
Make a JSON-RPC call to the remote server.
|
|
3302
|
+
Implemented differently by each subclass (with or without logger support).
|
|
3303
|
+
|
|
3304
|
+
```ts
|
|
3305
|
+
protected abstract rpcCall<T>(method: string, params: unknown[]): Promise<T>
|
|
3306
|
+
```
|
|
3307
|
+
|
|
3308
|
+
Argument Details
|
|
3309
|
+
|
|
3310
|
+
+ **method**
|
|
3311
|
+
+ The WalletStorage method name to call.
|
|
3312
|
+
+ **params**
|
|
3313
|
+
+ The array of parameters to pass to the method in order.
|
|
3314
|
+
|
|
3179
3315
|
###### Method setActive
|
|
3180
3316
|
|
|
3181
3317
|
Ensures up-to-date wallet data replication to all configured backup storage providers,
|
|
@@ -3316,7 +3452,7 @@ export class StorageIdb extends StorageProvider implements WalletStorageProvider
|
|
|
3316
3452
|
async insertTxLabelMap(labelMap: TableTxLabelMap, trx?: TrxToken): Promise<void>
|
|
3317
3453
|
async insertUser(user: TableUser, trx?: TrxToken): Promise<number>
|
|
3318
3454
|
async updateIdb<T>(id: number | number[], update: Partial<T>, keyProp: string, storeName: string, trx?: TrxToken): Promise<number>
|
|
3319
|
-
async updateIdbKey<T>(key:
|
|
3455
|
+
async updateIdbKey<T>(key: Array<number | string>, update: Partial<T>, keyProps: string[], storeName: string, trx?: TrxToken): Promise<number>
|
|
3320
3456
|
async updateCertificate(id: number, update: Partial<TableCertificate>, trx?: TrxToken): Promise<number>
|
|
3321
3457
|
async updateCertificateField(certificateId: number, fieldName: string, update: Partial<TableCertificateField>, trx?: TrxToken): Promise<number>
|
|
3322
3458
|
async updateCommission(id: number, update: Partial<TableCommission>, trx?: TrxToken): Promise<number>
|
|
@@ -3398,7 +3534,7 @@ export class StorageIdb extends StorageProvider implements WalletStorageProvider
|
|
|
3398
3534
|
}
|
|
3399
3535
|
```
|
|
3400
3536
|
|
|
3401
|
-
See also: [AuthId](./client.md#interface-authid), [DBType](./storage.md#type-dbtype), [EntityTimeStamp](./client.md#interface-entitytimestamp), [FindCertificateFieldsArgs](./client.md#interface-findcertificatefieldsargs), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindCommissionsArgs](./client.md#interface-findcommissionsargs), [FindForUserSincePagedArgs](./client.md#interface-findforusersincepagedargs), [FindMonitorEventsArgs](./client.md#interface-findmonitoreventsargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputTagMapsArgs](./client.md#interface-findoutputtagmapsargs), [FindOutputTagsArgs](./client.md#interface-findoutputtagsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [FindProvenTxsArgs](./client.md#interface-findproventxsargs), [FindSyncStatesArgs](./client.md#interface-findsyncstatesargs), [FindTransactionsArgs](./client.md#interface-findtransactionsargs), [FindTxLabelMapsArgs](./client.md#interface-findtxlabelmapsargs), [FindTxLabelsArgs](./client.md#interface-findtxlabelsargs), [FindUsersArgs](./client.md#interface-findusersargs), [ProvenOrRawTx](./client.md#interface-provenorrawtx), [PurgeParams](./client.md#interface-purgeparams), [PurgeResults](./client.md#interface-purgeresults), [StorageAdminStats](./storage.md#interface-storageadminstats), [StorageIdbOptions](./storage.md#interface-storageidboptions), [StorageIdbSchema](./storage.md#interface-storageidbschema), [StorageProvider](./storage.md#class-storageprovider), [TableCertificate](./storage.md#interface-tablecertificate), [TableCertificateField](./storage.md#interface-tablecertificatefield), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableCommission](./storage.md#interface-tablecommission), [TableMonitorEvent](./storage.md#interface-tablemonitorevent), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableOutputTagMap](./storage.md#interface-tableoutputtagmap), [TableProvenTx](./storage.md#interface-tableproventx), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser), [TrxToken](./client.md#interface-trxtoken), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [listActions](./storage.md#function-listactions), [listOutputs](./storage.md#function-listoutputs), [purgeData](./storage.md#function-purgedata), [reviewStatus](./storage.md#function-reviewstatus)
|
|
3537
|
+
See also: [AuthId](./client.md#interface-authid), [DBType](./storage.md#type-dbtype), [EntityTimeStamp](./client.md#interface-entitytimestamp), [FindCertificateFieldsArgs](./client.md#interface-findcertificatefieldsargs), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindCommissionsArgs](./client.md#interface-findcommissionsargs), [FindForUserSincePagedArgs](./client.md#interface-findforusersincepagedargs), [FindMonitorEventsArgs](./client.md#interface-findmonitoreventsargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputTagMapsArgs](./client.md#interface-findoutputtagmapsargs), [FindOutputTagsArgs](./client.md#interface-findoutputtagsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [FindProvenTxsArgs](./client.md#interface-findproventxsargs), [FindSyncStatesArgs](./client.md#interface-findsyncstatesargs), [FindTransactionsArgs](./client.md#interface-findtransactionsargs), [FindTxLabelMapsArgs](./client.md#interface-findtxlabelmapsargs), [FindTxLabelsArgs](./client.md#interface-findtxlabelsargs), [FindUsersArgs](./client.md#interface-findusersargs), [ProvenOrRawTx](./client.md#interface-provenorrawtx), [PurgeParams](./client.md#interface-purgeparams), [PurgeResults](./client.md#interface-purgeresults), [StorageAdminStats](./storage.md#interface-storageadminstats), [StorageIdbOptions](./storage.md#interface-storageidboptions), [StorageIdbSchema](./storage.md#interface-storageidbschema), [StorageProvider](./storage.md#class-storageprovider), [TableCertificate](./storage.md#interface-tablecertificate), [TableCertificateField](./storage.md#interface-tablecertificatefield), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableCommission](./storage.md#interface-tablecommission), [TableMonitorEvent](./storage.md#interface-tablemonitorevent), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableOutputTagMap](./storage.md#interface-tableoutputtagmap), [TableProvenTx](./storage.md#interface-tableproventx), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser), [TrxToken](./client.md#interface-trxtoken), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [listActions](./storage.md#function-listactions), [listOutputs](./storage.md#function-listoutputs), [purgeData](./storage.md#function-purgedata), [reviewStatus](./storage.md#function-reviewstatus), [validateEntities](./storage.md#function-validateentities), [validateEntity](./storage.md#function-validateentity)
|
|
3402
3538
|
|
|
3403
3539
|
###### Method allocateChangeInput
|
|
3404
3540
|
|
|
@@ -3523,7 +3659,7 @@ export class StorageKnex extends StorageProvider implements WalletStorageProvide
|
|
|
3523
3659
|
constructor(options: StorageKnexOptions)
|
|
3524
3660
|
async readSettings(): Promise<TableSettings>
|
|
3525
3661
|
override async getProvenOrRawTx(txid: string, trx?: TrxToken): Promise<ProvenOrRawTx>
|
|
3526
|
-
dbTypeSubstring(source: string, fromOffset: number, forLength?: number)
|
|
3662
|
+
dbTypeSubstring(source: string, fromOffset: number, forLength?: number): string
|
|
3527
3663
|
override async getRawTxOfKnownValidTransaction(txid?: string, offset?: number, length?: number, trx?: TrxToken): Promise<number[] | undefined>
|
|
3528
3664
|
getProvenTxsForUserQuery(args: FindForUserSincePagedArgs): Knex.QueryBuilder
|
|
3529
3665
|
override async getProvenTxsForUser(args: FindForUserSincePagedArgs): Promise<TableProvenTx[]>
|
|
@@ -3623,7 +3759,7 @@ export class StorageKnex extends StorageProvider implements WalletStorageProvide
|
|
|
3623
3759
|
override async migrate(storageName: string, storageIdentityKey: string): Promise<string>
|
|
3624
3760
|
override async dropAllData(): Promise<void>
|
|
3625
3761
|
override async transaction<T>(scope: (trx: TrxToken) => Promise<T>, trx?: TrxToken): Promise<T>
|
|
3626
|
-
toDb(trx?: TrxToken)
|
|
3762
|
+
toDb(trx?: TrxToken): Knex | Knex.Transaction<any, any[]>
|
|
3627
3763
|
async validateRawTransaction(t: TableTransaction, trx?: TrxToken): Promise<void>
|
|
3628
3764
|
_verifiedReadyForDatabaseAccess: boolean = false;
|
|
3629
3765
|
async verifyReadyForDatabaseAccess(trx?: TrxToken): Promise<DBType>
|
|
@@ -3658,81 +3794,81 @@ export class StorageKnex extends StorageProvider implements WalletStorageProvide
|
|
|
3658
3794
|
orderDescending: true,
|
|
3659
3795
|
paged: { limit: 1 }
|
|
3660
3796
|
}));
|
|
3661
|
-
const monitorStats: ServicesCallHistory | undefined = monitorEvent ? JSON.parse(monitorEvent.details
|
|
3797
|
+
const monitorStats: ServicesCallHistory | undefined = (monitorEvent != null) ? JSON.parse(monitorEvent.details as string) : undefined;
|
|
3662
3798
|
const servicesStats = this.getServices().getServicesCallHistory(true);
|
|
3663
|
-
const
|
|
3664
|
-
const
|
|
3665
|
-
const
|
|
3799
|
+
const oneDayAgo = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
|
|
3800
|
+
const oneWeekAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString();
|
|
3801
|
+
const oneMonthAgo = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString();
|
|
3666
3802
|
const [[{ usersDay, usersMonth, usersWeek, usersTotal, transactionsDay, transactionsMonth, transactionsWeek, transactionsTotal, txCompletedDay, txCompletedMonth, txCompletedWeek, txCompletedTotal, txFailedDay, txFailedMonth, txFailedWeek, txFailedTotal, txAbandonedDay, txAbandonedMonth, txAbandonedWeek, txAbandonedTotal, txUnprocessedDay, txUnprocessedMonth, txUnprocessedWeek, txUnprocessedTotal, txSendingDay, txSendingMonth, txSendingWeek, txSendingTotal, txUnprovenDay, txUnprovenMonth, txUnprovenWeek, txUnprovenTotal, txUnsignedDay, txUnsignedMonth, txUnsignedWeek, txUnsignedTotal, txNosendDay, txNosendMonth, txNosendWeek, txNosendTotal, txNonfinalDay, txNonfinalMonth, txNonfinalWeek, txNonfinalTotal, txUnfailDay, txUnfailMonth, txUnfailWeek, txUnfailTotal, satoshisDefaultDay, satoshisDefaultMonth, satoshisDefaultWeek, satoshisDefaultTotal, satoshisOtherDay, satoshisOtherMonth, satoshisOtherWeek, satoshisOtherTotal, basketsDay, basketsMonth, basketsWeek, basketsTotal, labelsDay, labelsMonth, labelsWeek, labelsTotal, tagsDay, tagsMonth, tagsWeek, tagsTotal }]] = await this.knex.raw(`
|
|
3667
3803
|
select
|
|
3668
|
-
(select count(*) from users where created_at > '${
|
|
3669
|
-
(select count(*) from users where created_at > '${
|
|
3670
|
-
(select count(*) from users where created_at > '${
|
|
3671
|
-
|
|
3672
|
-
(select count(*) from transactions where created_at > '${
|
|
3673
|
-
(select count(*) from transactions where created_at > '${
|
|
3674
|
-
(select count(*) from transactions where created_at > '${
|
|
3675
|
-
|
|
3676
|
-
(select count(*) from transactions where status = 'completed' and created_at > '${
|
|
3677
|
-
(select count(*) from transactions where status = 'completed' and created_at > '${
|
|
3678
|
-
(select count(*) from transactions where status = 'completed' and created_at > '${
|
|
3679
|
-
|
|
3680
|
-
(select count(*) from transactions where status = 'failed' and not txid is null and created_at > '${
|
|
3681
|
-
(select count(*) from transactions where status = 'failed' and not txid is null and created_at > '${
|
|
3682
|
-
(select count(*) from transactions where status = 'failed' and not txid is null and created_at > '${
|
|
3683
|
-
|
|
3684
|
-
(select count(*) from transactions where status = 'failed' and txid is null and created_at > '${
|
|
3685
|
-
(select count(*) from transactions where status = 'failed' and txid is null and created_at > '${
|
|
3686
|
-
(select count(*) from transactions where status = 'failed' and txid is null and created_at > '${
|
|
3687
|
-
|
|
3688
|
-
(select count(*) from transactions where status = 'unprocessed' and created_at > '${
|
|
3689
|
-
(select count(*) from transactions where status = 'unprocessed' and created_at > '${
|
|
3690
|
-
(select count(*) from transactions where status = 'unprocessed' and created_at > '${
|
|
3691
|
-
|
|
3692
|
-
(select count(*) from transactions where status = 'sending' and created_at > '${
|
|
3693
|
-
(select count(*) from transactions where status = 'sending' and created_at > '${
|
|
3694
|
-
(select count(*) from transactions where status = 'sending' and created_at > '${
|
|
3695
|
-
|
|
3696
|
-
(select count(*) from transactions where status = 'unproven' and created_at > '${
|
|
3697
|
-
(select count(*) from transactions where status = 'unproven' and created_at > '${
|
|
3698
|
-
(select count(*) from transactions where status = 'unproven' and created_at > '${
|
|
3699
|
-
|
|
3700
|
-
(select count(*) from transactions where status = 'unsigned' and created_at > '${
|
|
3701
|
-
(select count(*) from transactions where status = 'unsigned' and created_at > '${
|
|
3702
|
-
(select count(*) from transactions where status = 'unsigned' and created_at > '${
|
|
3703
|
-
|
|
3704
|
-
(select count(*) from transactions where status = 'nosend' and created_at > '${
|
|
3705
|
-
(select count(*) from transactions where status = 'nosend' and created_at > '${
|
|
3706
|
-
(select count(*) from transactions where status = 'nosend' and created_at > '${
|
|
3707
|
-
|
|
3708
|
-
(select count(*) from transactions where status = 'nonfinal' and created_at > '${
|
|
3709
|
-
(select count(*) from transactions where status = 'nonfinal' and created_at > '${
|
|
3710
|
-
(select count(*) from transactions where status = 'nonfinal' and created_at > '${
|
|
3711
|
-
|
|
3712
|
-
(select count(*) from transactions where status = 'unfail' and created_at > '${
|
|
3713
|
-
(select count(*) from transactions where status = 'unfail' and created_at > '${
|
|
3714
|
-
(select count(*) from transactions where status = 'unfail' and created_at > '${
|
|
3715
|
-
|
|
3716
|
-
(select sum(satoshis) from outputs where spendable = 1 and
|
|
3717
|
-
(select sum(satoshis) from outputs where spendable = 1 and
|
|
3718
|
-
(select sum(satoshis) from outputs where spendable = 1 and
|
|
3719
|
-
|
|
3720
|
-
(select sum(satoshis) from outputs where spendable = 1 and
|
|
3721
|
-
(select sum(satoshis) from outputs where spendable = 1 and
|
|
3722
|
-
(select sum(satoshis) from outputs where spendable = 1 and
|
|
3723
|
-
|
|
3724
|
-
(select count(*) from output_baskets where created_at > '${
|
|
3725
|
-
(select count(*) from output_baskets where created_at > '${
|
|
3726
|
-
(select count(*) from output_baskets where created_at > '${
|
|
3727
|
-
|
|
3728
|
-
(select count(*) from tx_labels where created_at > '${
|
|
3729
|
-
(select count(*) from tx_labels where created_at > '${
|
|
3730
|
-
(select count(*) from tx_labels where created_at > '${
|
|
3731
|
-
|
|
3732
|
-
(select count(*) from output_tags where created_at > '${
|
|
3733
|
-
(select count(*) from output_tags where created_at > '${
|
|
3734
|
-
(select count(*) from output_tags where created_at > '${
|
|
3735
|
-
|
|
3804
|
+
(select count(*) from users where created_at > '${oneDayAgo}') as usersDay,
|
|
3805
|
+
(select count(*) from users where created_at > '${oneWeekAgo}') as usersWeek,
|
|
3806
|
+
(select count(*) from users where created_at > '${oneMonthAgo}') as usersMonth,
|
|
3807
|
+
(select count(*) from users) as usersTotal,
|
|
3808
|
+
(select count(*) from transactions where created_at > '${oneDayAgo}') as transactionsDay,
|
|
3809
|
+
(select count(*) from transactions where created_at > '${oneWeekAgo}') as transactionsWeek,
|
|
3810
|
+
(select count(*) from transactions where created_at > '${oneMonthAgo}') as transactionsMonth,
|
|
3811
|
+
(select count(*) from transactions) as transactionsTotal,
|
|
3812
|
+
(select count(*) from transactions where status = 'completed' and created_at > '${oneDayAgo}') as txCompletedDay,
|
|
3813
|
+
(select count(*) from transactions where status = 'completed' and created_at > '${oneWeekAgo}') as txCompletedWeek,
|
|
3814
|
+
(select count(*) from transactions where status = 'completed' and created_at > '${oneMonthAgo}') as txCompletedMonth,
|
|
3815
|
+
(select count(*) from transactions where status = 'completed') as txCompletedTotal,
|
|
3816
|
+
(select count(*) from transactions where status = 'failed' and not txid is null and created_at > '${oneDayAgo}') as txFailedDay,
|
|
3817
|
+
(select count(*) from transactions where status = 'failed' and not txid is null and created_at > '${oneWeekAgo}') as txFailedWeek,
|
|
3818
|
+
(select count(*) from transactions where status = 'failed' and not txid is null and created_at > '${oneMonthAgo}') as txFailedMonth,
|
|
3819
|
+
(select count(*) from transactions where status = 'failed' and not txid is null) as txFailedTotal,
|
|
3820
|
+
(select count(*) from transactions where status = 'failed' and txid is null and created_at > '${oneDayAgo}') as txAbandonedDay,
|
|
3821
|
+
(select count(*) from transactions where status = 'failed' and txid is null and created_at > '${oneWeekAgo}') as txAbandonedWeek,
|
|
3822
|
+
(select count(*) from transactions where status = 'failed' and txid is null and created_at > '${oneMonthAgo}') as txAbandonedMonth,
|
|
3823
|
+
(select count(*) from transactions where status = 'failed' and txid is null) as txAbandonedTotal,
|
|
3824
|
+
(select count(*) from transactions where status = 'unprocessed' and created_at > '${oneDayAgo}') as txUnprocessedDay,
|
|
3825
|
+
(select count(*) from transactions where status = 'unprocessed' and created_at > '${oneWeekAgo}') as txUnprocessedWeek,
|
|
3826
|
+
(select count(*) from transactions where status = 'unprocessed' and created_at > '${oneMonthAgo}') as txUnprocessedMonth,
|
|
3827
|
+
(select count(*) from transactions where status = 'unprocessed') as txUnprocessedTotal,
|
|
3828
|
+
(select count(*) from transactions where status = 'sending' and created_at > '${oneDayAgo}') as txSendingDay,
|
|
3829
|
+
(select count(*) from transactions where status = 'sending' and created_at > '${oneWeekAgo}') as txSendingWeek,
|
|
3830
|
+
(select count(*) from transactions where status = 'sending' and created_at > '${oneMonthAgo}') as txSendingMonth,
|
|
3831
|
+
(select count(*) from transactions where status = 'sending') as txSendingTotal,
|
|
3832
|
+
(select count(*) from transactions where status = 'unproven' and created_at > '${oneDayAgo}') as txUnprovenDay,
|
|
3833
|
+
(select count(*) from transactions where status = 'unproven' and created_at > '${oneWeekAgo}') as txUnprovenWeek,
|
|
3834
|
+
(select count(*) from transactions where status = 'unproven' and created_at > '${oneMonthAgo}') as txUnprovenMonth,
|
|
3835
|
+
(select count(*) from transactions where status = 'unproven') as txUnprovenTotal,
|
|
3836
|
+
(select count(*) from transactions where status = 'unsigned' and created_at > '${oneDayAgo}') as txUnsignedDay,
|
|
3837
|
+
(select count(*) from transactions where status = 'unsigned' and created_at > '${oneWeekAgo}') as txUnsignedWeek,
|
|
3838
|
+
(select count(*) from transactions where status = 'unsigned' and created_at > '${oneMonthAgo}') as txUnsignedMonth,
|
|
3839
|
+
(select count(*) from transactions where status = 'unsigned') as txUnsignedTotal,
|
|
3840
|
+
(select count(*) from transactions where status = 'nosend' and created_at > '${oneDayAgo}') as txNosendDay,
|
|
3841
|
+
(select count(*) from transactions where status = 'nosend' and created_at > '${oneWeekAgo}') as txNosendWeek,
|
|
3842
|
+
(select count(*) from transactions where status = 'nosend' and created_at > '${oneMonthAgo}') as txNosendMonth,
|
|
3843
|
+
(select count(*) from transactions where status = 'nosend') as txNosendTotal,
|
|
3844
|
+
(select count(*) from transactions where status = 'nonfinal' and created_at > '${oneDayAgo}') as txNonfinalDay,
|
|
3845
|
+
(select count(*) from transactions where status = 'nonfinal' and created_at > '${oneWeekAgo}') as txNonfinalWeek,
|
|
3846
|
+
(select count(*) from transactions where status = 'nonfinal' and created_at > '${oneMonthAgo}') as txNonfinalMonth,
|
|
3847
|
+
(select count(*) from transactions where status = 'nonfinal') as txNonfinalTotal,
|
|
3848
|
+
(select count(*) from transactions where status = 'unfail' and created_at > '${oneDayAgo}') as txUnfailDay,
|
|
3849
|
+
(select count(*) from transactions where status = 'unfail' and created_at > '${oneWeekAgo}') as txUnfailWeek,
|
|
3850
|
+
(select count(*) from transactions where status = 'unfail' and created_at > '${oneMonthAgo}') as txUnfailMonth,
|
|
3851
|
+
(select count(*) from transactions where status = 'unfail') as txUnfailTotal,
|
|
3852
|
+
(select sum(o.satoshis) from outputs o, transactions t where o.transactionId = t.transactionId and t.status = 'completed' and o.spendable = 1 and o.change = 1 and o.created_at > '${oneDayAgo}') as satoshisDefaultDay,
|
|
3853
|
+
(select sum(o.satoshis) from outputs o, transactions t where o.transactionId = t.transactionId and t.status = 'completed' and o.spendable = 1 and o.change = 1 and o.created_at > '${oneWeekAgo}') as satoshisDefaultWeek,
|
|
3854
|
+
(select sum(o.satoshis) from outputs o, transactions t where o.transactionId = t.transactionId and t.status = 'completed' and o.spendable = 1 and o.change = 1 and o.created_at > '${oneMonthAgo}') as satoshisDefaultMonth,
|
|
3855
|
+
(select sum(o.satoshis) from outputs o, transactions t where o.transactionId = t.transactionId and t.status = 'completed' and o.spendable = 1 and o.change = 1) as satoshisDefaultTotal,
|
|
3856
|
+
(select sum(o.satoshis) from outputs o, transactions t where o.transactionId = t.transactionId and t.status = 'completed' and o.spendable = 1 and o.change = 0 and not o.basketId is null and o.created_at > '${oneDayAgo}') as satoshisOtherDay,
|
|
3857
|
+
(select sum(o.satoshis) from outputs o, transactions t where o.transactionId = t.transactionId and t.status = 'completed' and o.spendable = 1 and o.change = 0 and not o.basketId is null and o.created_at > '${oneWeekAgo}') as satoshisOtherWeek,
|
|
3858
|
+
(select sum(o.satoshis) from outputs o, transactions t where o.transactionId = t.transactionId and t.status = 'completed' and o.spendable = 1 and o.change = 0 and not o.basketId is null and o.created_at > '${oneMonthAgo}') as satoshisOtherMonth,
|
|
3859
|
+
(select sum(o.satoshis) from outputs o, transactions t where o.transactionId = t.transactionId and t.status = 'completed' and o.spendable = 1 and o.change = 0 and not o.basketId is null) as satoshisOtherTotal,
|
|
3860
|
+
(select count(*) from output_baskets where created_at > '${oneDayAgo}') as basketsDay,
|
|
3861
|
+
(select count(*) from output_baskets where created_at > '${oneWeekAgo}') as basketsWeek,
|
|
3862
|
+
(select count(*) from output_baskets where created_at > '${oneMonthAgo}') as basketsMonth,
|
|
3863
|
+
(select count(*) from output_baskets) as basketsTotal,
|
|
3864
|
+
(select count(*) from tx_labels where created_at > '${oneDayAgo}') as labelsDay,
|
|
3865
|
+
(select count(*) from tx_labels where created_at > '${oneWeekAgo}') as labelsWeek,
|
|
3866
|
+
(select count(*) from tx_labels where created_at > '${oneMonthAgo}') as labelsMonth,
|
|
3867
|
+
(select count(*) from tx_labels) as labelsTotal,
|
|
3868
|
+
(select count(*) from output_tags where created_at > '${oneDayAgo}') as tagsDay,
|
|
3869
|
+
(select count(*) from output_tags where created_at > '${oneWeekAgo}') as tagsWeek,
|
|
3870
|
+
(select count(*) from output_tags where created_at > '${oneMonthAgo}') as tagsMonth,
|
|
3871
|
+
(select count(*) from output_tags) as tagsTotal
|
|
3736
3872
|
`);
|
|
3737
3873
|
const r: AdminStatsResult = {
|
|
3738
3874
|
monitorStats,
|
|
@@ -3813,7 +3949,7 @@ select
|
|
|
3813
3949
|
}
|
|
3814
3950
|
```
|
|
3815
3951
|
|
|
3816
|
-
See also: [AdminStatsResult](./storage.md#interface-adminstatsresult), [AuthId](./client.md#interface-authid), [DBType](./storage.md#type-dbtype), [EntityTimeStamp](./client.md#interface-entitytimestamp), [FindCertificateFieldsArgs](./client.md#interface-findcertificatefieldsargs), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindCommissionsArgs](./client.md#interface-findcommissionsargs), [FindForUserSincePagedArgs](./client.md#interface-findforusersincepagedargs), [FindMonitorEventsArgs](./client.md#interface-findmonitoreventsargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputTagMapsArgs](./client.md#interface-findoutputtagmapsargs), [FindOutputTagsArgs](./client.md#interface-findoutputtagsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindPartialSincePagedArgs](./client.md#interface-findpartialsincepagedargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [FindProvenTxsArgs](./client.md#interface-findproventxsargs), [FindStaleMerkleRootsArgs](./client.md#interface-findstalemerklerootsargs), [FindSyncStatesArgs](./client.md#interface-findsyncstatesargs), [FindTransactionsArgs](./client.md#interface-findtransactionsargs), [FindTxLabelMapsArgs](./client.md#interface-findtxlabelmapsargs), [FindTxLabelsArgs](./client.md#interface-findtxlabelsargs), [FindUsersArgs](./client.md#interface-findusersargs), [ProvenOrRawTx](./client.md#interface-provenorrawtx), [PurgeParams](./client.md#interface-purgeparams), [PurgeResults](./client.md#interface-purgeresults), [ServicesCallHistory](./client.md#
|
|
3952
|
+
See also: [AdminStatsResult](./storage.md#interface-adminstatsresult), [AuthId](./client.md#interface-authid), [DBType](./storage.md#type-dbtype), [EntityTimeStamp](./client.md#interface-entitytimestamp), [FindCertificateFieldsArgs](./client.md#interface-findcertificatefieldsargs), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindCommissionsArgs](./client.md#interface-findcommissionsargs), [FindForUserSincePagedArgs](./client.md#interface-findforusersincepagedargs), [FindMonitorEventsArgs](./client.md#interface-findmonitoreventsargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputTagMapsArgs](./client.md#interface-findoutputtagmapsargs), [FindOutputTagsArgs](./client.md#interface-findoutputtagsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindPartialSincePagedArgs](./client.md#interface-findpartialsincepagedargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [FindProvenTxsArgs](./client.md#interface-findproventxsargs), [FindStaleMerkleRootsArgs](./client.md#interface-findstalemerklerootsargs), [FindSyncStatesArgs](./client.md#interface-findsyncstatesargs), [FindTransactionsArgs](./client.md#interface-findtransactionsargs), [FindTxLabelMapsArgs](./client.md#interface-findtxlabelmapsargs), [FindTxLabelsArgs](./client.md#interface-findtxlabelsargs), [FindUsersArgs](./client.md#interface-findusersargs), [ProvenOrRawTx](./client.md#interface-provenorrawtx), [PurgeParams](./client.md#interface-purgeparams), [PurgeResults](./client.md#interface-purgeresults), [ServicesCallHistory](./client.md#interface-servicescallhistory), [StorageKnexOptions](./storage.md#interface-storageknexoptions), [StorageProvider](./storage.md#class-storageprovider), [TableCertificate](./storage.md#interface-tablecertificate), [TableCertificateField](./storage.md#interface-tablecertificatefield), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableCommission](./storage.md#interface-tablecommission), [TableMonitorEvent](./storage.md#interface-tablemonitorevent), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableOutputTagMap](./storage.md#interface-tableoutputtagmap), [TableProvenTx](./storage.md#interface-tableproventx), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser), [TrxToken](./client.md#interface-trxtoken), [WERR_NOT_IMPLEMENTED](./client.md#class-werr_not_implemented), [WalletStorageProvider](./client.md#interface-walletstorageprovider), [listActions](./storage.md#function-listactions), [listOutputs](./storage.md#function-listoutputs), [purgeData](./storage.md#function-purgedata), [reviewStatus](./storage.md#function-reviewstatus), [validateEntities](./storage.md#function-validateentities), [validateEntity](./storage.md#function-validateentity), [verifyOneOrNone](./client.md#function-verifyoneornone)
|
|
3817
3953
|
|
|
3818
3954
|
###### Method allocateChangeInput
|
|
3819
3955
|
|
|
@@ -3844,7 +3980,7 @@ Convert the standard optional `TrxToken` parameter into either a direct knex dat
|
|
|
3844
3980
|
or a Knex.Transaction as appropriate.
|
|
3845
3981
|
|
|
3846
3982
|
```ts
|
|
3847
|
-
toDb(trx?: TrxToken)
|
|
3983
|
+
toDb(trx?: TrxToken): Knex | Knex.Transaction<any, any[]>
|
|
3848
3984
|
```
|
|
3849
3985
|
See also: [TrxToken](./client.md#interface-trxtoken)
|
|
3850
3986
|
|
|
@@ -3917,7 +4053,11 @@ export abstract class StorageProvider extends StorageReaderWriter implements Wal
|
|
|
3917
4053
|
commissionSatoshis: number;
|
|
3918
4054
|
commissionPubKeyHex?: PubKeyHex;
|
|
3919
4055
|
maxRecursionDepth?: number;
|
|
3920
|
-
static defaultOptions()
|
|
4056
|
+
static defaultOptions(): {
|
|
4057
|
+
feeModel: StorageFeeModel;
|
|
4058
|
+
commissionSatoshis: number;
|
|
4059
|
+
commissionPubKeyHex: undefined;
|
|
4060
|
+
}
|
|
3921
4061
|
static createStorageBaseOptions(chain: Chain): StorageProviderOptions
|
|
3922
4062
|
constructor(options: StorageProviderOptions)
|
|
3923
4063
|
abstract reviewStatus(args: {
|
|
@@ -3951,7 +4091,7 @@ export abstract class StorageProvider extends StorageReaderWriter implements Wal
|
|
|
3951
4091
|
abstract adminStats(adminIdentityKey: string): Promise<AdminStatsResult>;
|
|
3952
4092
|
async recentlyActiveUsers(limit = 50, trx?: TrxToken): Promise<TableUser[]>
|
|
3953
4093
|
override isStorageProvider(): boolean
|
|
3954
|
-
setServices(v: WalletServices)
|
|
4094
|
+
setServices(v: WalletServices): void
|
|
3955
4095
|
getServices(): WalletServices
|
|
3956
4096
|
async abortAction(auth: AuthId, args: AbortActionArgs): Promise<AbortActionResult>
|
|
3957
4097
|
async internalizeAction(auth: AuthId, args: InternalizeActionArgs): Promise<StorageInternalizeActionResult>
|
|
@@ -4001,21 +4141,6 @@ Returns
|
|
|
4001
4141
|
|
|
4002
4142
|
object with invalidSpendableOutputs array. A good result is an empty array.
|
|
4003
4143
|
|
|
4004
|
-
###### Method getProvenOrReq
|
|
4005
|
-
|
|
4006
|
-
Checks if txid is a known valid ProvenTx and returns it if found.
|
|
4007
|
-
Next checks if txid is a current ProvenTxReq and returns that if found.
|
|
4008
|
-
If `newReq` is provided and an existing ProvenTxReq isn't found,
|
|
4009
|
-
use `newReq` to create a new ProvenTxReq.
|
|
4010
|
-
|
|
4011
|
-
This is safe "findOrInsert" operation using retry if unique index constraint
|
|
4012
|
-
is violated by a race condition insert.
|
|
4013
|
-
|
|
4014
|
-
```ts
|
|
4015
|
-
async getProvenOrReq(txid: string, newReq?: TableProvenTxReq, trx?: TrxToken): Promise<StorageProvenOrReq>
|
|
4016
|
-
```
|
|
4017
|
-
See also: [StorageProvenOrReq](./client.md#interface-storageprovenorreq), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TrxToken](./client.md#interface-trxtoken)
|
|
4018
|
-
|
|
4019
4144
|
###### Method getReqsAndBeefToShareWithWorld
|
|
4020
4145
|
|
|
4021
4146
|
Given an array of transaction txids with current ProvenTxReq ready-to-share status,
|
|
@@ -4135,7 +4260,7 @@ export abstract class StorageReader implements sdk.WalletStorageSyncReader {
|
|
|
4135
4260
|
}
|
|
4136
4261
|
```
|
|
4137
4262
|
|
|
4138
|
-
See also: [Chain](./client.md#type-chain), [DBType](./storage.md#type-dbtype), [FindCertificateFieldsArgs](./client.md#interface-findcertificatefieldsargs), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindCommissionsArgs](./client.md#interface-findcommissionsargs), [FindForUserSincePagedArgs](./client.md#interface-findforusersincepagedargs), [FindMonitorEventsArgs](./client.md#interface-findmonitoreventsargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputTagsArgs](./client.md#interface-findoutputtagsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindSyncStatesArgs](./client.md#interface-findsyncstatesargs), [FindTransactionsArgs](./client.md#interface-findtransactionsargs), [FindTxLabelsArgs](./client.md#interface-findtxlabelsargs), [FindUsersArgs](./client.md#interface-findusersargs), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [StorageReaderOptions](./storage.md#interface-storagereaderoptions), [SyncChunk](./client.md#interface-syncchunk), [TableCertificateField](./storage.md#interface-tablecertificatefield), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableCommission](./storage.md#interface-tablecommission), [TableMonitorEvent](./storage.md#interface-tablemonitorevent), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableOutputTagMap](./storage.md#interface-tableoutputtagmap), [TableProvenTx](./storage.md#interface-tableproventx), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser), [TrxToken](./client.md#interface-trxtoken), [WalletStorageSyncReader](./client.md#interface-walletstoragesyncreader), [getSyncChunk](./storage.md#function-getsyncchunk)
|
|
4263
|
+
See also: [Chain](./client.md#type-chain), [DBType](./storage.md#type-dbtype), [FindCertificateFieldsArgs](./client.md#interface-findcertificatefieldsargs), [FindCertificatesArgs](./client.md#interface-findcertificatesargs), [FindCommissionsArgs](./client.md#interface-findcommissionsargs), [FindForUserSincePagedArgs](./client.md#interface-findforusersincepagedargs), [FindMonitorEventsArgs](./client.md#interface-findmonitoreventsargs), [FindOutputBasketsArgs](./client.md#interface-findoutputbasketsargs), [FindOutputTagsArgs](./client.md#interface-findoutputtagsargs), [FindOutputsArgs](./client.md#interface-findoutputsargs), [FindSyncStatesArgs](./client.md#interface-findsyncstatesargs), [FindTransactionsArgs](./client.md#interface-findtransactionsargs), [FindTxLabelsArgs](./client.md#interface-findtxlabelsargs), [FindUsersArgs](./client.md#interface-findusersargs), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [StorageReaderOptions](./storage.md#interface-storagereaderoptions), [SyncChunk](./client.md#interface-syncchunk), [TableCertificateField](./storage.md#interface-tablecertificatefield), [TableCertificateX](./storage.md#interface-tablecertificatex), [TableCommission](./storage.md#interface-tablecommission), [TableMonitorEvent](./storage.md#interface-tablemonitorevent), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableOutputTagMap](./storage.md#interface-tableoutputtagmap), [TableProvenTx](./storage.md#interface-tableproventx), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSettings](./storage.md#interface-tablesettings), [TableSyncState](./storage.md#interface-tablesyncstate), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser), [TrxToken](./client.md#interface-trxtoken), [WalletStorageSyncReader](./client.md#interface-walletstoragesyncreader), [getSyncChunk](./storage.md#function-getsyncchunk), [validateDate](./storage.md#function-validatedate)
|
|
4139
4264
|
|
|
4140
4265
|
###### Method validateEntityDate
|
|
4141
4266
|
|
|
@@ -4163,7 +4288,6 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4163
4288
|
|
|
4164
4289
|
```ts
|
|
4165
4290
|
export abstract class StorageReaderWriter extends StorageReader {
|
|
4166
|
-
constructor(options: StorageReaderWriterOptions)
|
|
4167
4291
|
abstract dropAllData(): Promise<void>;
|
|
4168
4292
|
abstract migrate(storageName: string, storageIdentityKey: string): Promise<string>;
|
|
4169
4293
|
abstract findOutputTagMaps(args: FindOutputTagMapsArgs): Promise<TableOutputTagMap[]>;
|
|
@@ -4247,7 +4371,7 @@ export abstract class StorageReaderWriter extends StorageReader {
|
|
|
4247
4371
|
}
|
|
4248
4372
|
```
|
|
4249
4373
|
|
|
4250
|
-
See also: [AuthId](./client.md#interface-authid), [FindOutputTagMapsArgs](./client.md#interface-findoutputtagmapsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [FindProvenTxsArgs](./client.md#interface-findproventxsargs), [FindStaleMerkleRootsArgs](./client.md#interface-findstalemerklerootsargs), [FindTxLabelMapsArgs](./client.md#interface-findtxlabelmapsargs), [ProcessSyncChunkResult](./client.md#interface-processsyncchunkresult), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [StorageReader](./storage.md#class-storagereader), [
|
|
4374
|
+
See also: [AuthId](./client.md#interface-authid), [FindOutputTagMapsArgs](./client.md#interface-findoutputtagmapsargs), [FindProvenTxReqsArgs](./client.md#interface-findproventxreqsargs), [FindProvenTxsArgs](./client.md#interface-findproventxsargs), [FindStaleMerkleRootsArgs](./client.md#interface-findstalemerklerootsargs), [FindTxLabelMapsArgs](./client.md#interface-findtxlabelmapsargs), [ProcessSyncChunkResult](./client.md#interface-processsyncchunkresult), [RequestSyncChunkArgs](./client.md#interface-requestsyncchunkargs), [StorageReader](./storage.md#class-storagereader), [SyncChunk](./client.md#interface-syncchunk), [TableCertificate](./storage.md#interface-tablecertificate), [TableCertificateField](./storage.md#interface-tablecertificatefield), [TableCommission](./storage.md#interface-tablecommission), [TableMonitorEvent](./storage.md#interface-tablemonitorevent), [TableOutput](./storage.md#interface-tableoutput), [TableOutputBasket](./storage.md#interface-tableoutputbasket), [TableOutputTag](./storage.md#interface-tableoutputtag), [TableOutputTagMap](./storage.md#interface-tableoutputtagmap), [TableProvenTx](./storage.md#interface-tableproventx), [TableProvenTxReq](./storage.md#interface-tableproventxreq), [TableSyncState](./storage.md#interface-tablesyncstate), [TableTransaction](./storage.md#interface-tabletransaction), [TableTxLabel](./storage.md#interface-tabletxlabel), [TableTxLabelMap](./storage.md#interface-tabletxlabelmap), [TableUser](./storage.md#interface-tableuser), [TrxToken](./client.md#interface-trxtoken)
|
|
4251
4375
|
|
|
4252
4376
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4253
4377
|
|
|
@@ -4266,7 +4390,7 @@ export class StorageServer {
|
|
|
4266
4390
|
}
|
|
4267
4391
|
```
|
|
4268
4392
|
|
|
4269
|
-
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp), [StorageProvider](./storage.md#class-storageprovider), [WalletStorageServerOptions](./storage.md#interface-walletstorageserveroptions)
|
|
4393
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp), [StorageProvider](./storage.md#class-storageprovider), [WalletStorageServerOptions](./storage.md#interface-walletstorageserveroptions), [validateDate](./storage.md#function-validatedate), [validateEntities](./storage.md#function-validateentities), [validateEntity](./storage.md#function-validateentity)
|
|
4270
4394
|
|
|
4271
4395
|
###### Method validateEntities
|
|
4272
4396
|
|
|
@@ -4306,7 +4430,7 @@ and the `StorageBaseReader` to be protected.
|
|
|
4306
4430
|
export class StorageSyncReader implements sdk.WalletStorageSyncReader {
|
|
4307
4431
|
constructor(public auth: sdk.AuthId, public storage: StorageReader)
|
|
4308
4432
|
async makeAvailable(): Promise<TableSettings>
|
|
4309
|
-
destroy(): Promise<void>
|
|
4433
|
+
async destroy(): Promise<void>
|
|
4310
4434
|
async getSyncChunk(args: sdk.RequestSyncChunkArgs): Promise<sdk.SyncChunk>
|
|
4311
4435
|
}
|
|
4312
4436
|
```
|
|
@@ -4363,7 +4487,7 @@ export class WalletStorageManager implements sdk.WalletStorage {
|
|
|
4363
4487
|
async runAsStorageProvider<R>(sync: (active: StorageProvider) => Promise<R>): Promise<R>
|
|
4364
4488
|
isActiveStorageProvider(): boolean
|
|
4365
4489
|
async addWalletStorageProvider(provider: sdk.WalletStorageProvider): Promise<void>
|
|
4366
|
-
setServices(v: sdk.WalletServices)
|
|
4490
|
+
setServices(v: sdk.WalletServices): void
|
|
4367
4491
|
getServices(): sdk.WalletServices
|
|
4368
4492
|
getSettings(): TableSettings
|
|
4369
4493
|
async migrate(storageName: string, storageIdentityKey: string): Promise<string>
|
|
@@ -4504,26 +4628,6 @@ Returns
|
|
|
4504
4628
|
|
|
4505
4629
|
true if the active `WalletStorageProvider` also implements `StorageProvider`
|
|
4506
4630
|
|
|
4507
|
-
###### Method makeAvailable
|
|
4508
|
-
|
|
4509
|
-
This async function must be called after construction and before
|
|
4510
|
-
any other async function can proceed.
|
|
4511
|
-
|
|
4512
|
-
Runs through `_stores` validating all properties and partitioning across `_active`, `_backups`, `_conflictingActives`.
|
|
4513
|
-
|
|
4514
|
-
```ts
|
|
4515
|
-
async makeAvailable(): Promise<TableSettings>
|
|
4516
|
-
```
|
|
4517
|
-
See also: [TableSettings](./storage.md#interface-tablesettings)
|
|
4518
|
-
|
|
4519
|
-
Returns
|
|
4520
|
-
|
|
4521
|
-
from the active storage.
|
|
4522
|
-
|
|
4523
|
-
Throws
|
|
4524
|
-
|
|
4525
|
-
WERR_INVALID_PARAMETER if canMakeAvailable returns false.
|
|
4526
|
-
|
|
4527
4631
|
###### Method reproveHeader
|
|
4528
4632
|
|
|
4529
4633
|
For each proven_txs record currently sourcing its transaction merkle proof from the given deactivated header,
|
|
@@ -4552,23 +4656,6 @@ async reproveHeightMerkleRoot(height: number, staleMerkleRoot: string): Promise<
|
|
|
4552
4656
|
```
|
|
4553
4657
|
See also: [ReproveHeaderResult](./client.md#interface-reproveheaderresult)
|
|
4554
4658
|
|
|
4555
|
-
###### Method reproveProven
|
|
4556
|
-
|
|
4557
|
-
Attempt to reprove the transaction against the current chain,
|
|
4558
|
-
If a new valid proof is found and noUpdate is not true,
|
|
4559
|
-
update the proven_txs record with new block and merkle proof data.
|
|
4560
|
-
If noUpdate is true, the update to be applied is available in the returned result.
|
|
4561
|
-
|
|
4562
|
-
```ts
|
|
4563
|
-
async reproveProven(ptx: TableProvenTx, noUpdate?: boolean): Promise<sdk.ReproveProvenResult>
|
|
4564
|
-
```
|
|
4565
|
-
See also: [ReproveProvenResult](./client.md#interface-reproveprovenresult), [TableProvenTx](./storage.md#interface-tableproventx)
|
|
4566
|
-
|
|
4567
|
-
Argument Details
|
|
4568
|
-
|
|
4569
|
-
+ **ptx**
|
|
4570
|
-
+ proven_txs record to reprove
|
|
4571
|
-
|
|
4572
4659
|
###### Method runAsSync
|
|
4573
4660
|
|
|
4574
4661
|
```ts
|
|
@@ -4605,18 +4692,32 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4605
4692
|
|
|
4606
4693
|
| | | |
|
|
4607
4694
|
| --- | --- | --- |
|
|
4608
|
-
| [attemptToPostReqsToNetwork](#function-attempttopostreqstonetwork) | [
|
|
4609
|
-
| [
|
|
4610
|
-
| [
|
|
4611
|
-
| [
|
|
4612
|
-
| [
|
|
4613
|
-
| [
|
|
4614
|
-
| [
|
|
4615
|
-
| [
|
|
4616
|
-
| [
|
|
4617
|
-
| [
|
|
4618
|
-
| [
|
|
4619
|
-
| [
|
|
4695
|
+
| [attemptToPostReqsToNetwork](#function-attempttopostreqstonetwork) | [matchesOutputPartial](#function-matchesoutputpartial) | [transactionSize](#function-transactionsize) |
|
|
4696
|
+
| [classifyReqStatus](#function-classifyreqstatus) | [matchesOutputTagMapPartial](#function-matchesoutputtagmappartial) | [updateReqsFromAggregateResults](#function-updatereqsfromaggregateresults) |
|
|
4697
|
+
| [createAction](#function-createaction) | [matchesOutputTagPartial](#function-matchesoutputtagpartial) | [upgradeAllStoresV1](#function-upgradeallstoresv1) |
|
|
4698
|
+
| [createStorageServiceChargeScript](#function-createstorageservicechargescript) | [matchesProvenTxPartial](#function-matchesproventxpartial) | [upgradeCertificateFields](#function-upgradecertificatefields) |
|
|
4699
|
+
| [createSyncMap](#function-createsyncmap) | [matchesProvenTxReqPartial](#function-matchesproventxreqpartial) | [upgradeCertificates](#function-upgradecertificates) |
|
|
4700
|
+
| [dateMatches](#function-datematches) | [matchesSyncStatePartial](#function-matchessyncstatepartial) | [upgradeCommissions](#function-upgradecommissions) |
|
|
4701
|
+
| [determineDBType](#function-determinedbtype) | [matchesTransactionPartial](#function-matchestransactionpartial) | [upgradeMonitorEvents](#function-upgrademonitorevents) |
|
|
4702
|
+
| [generateChangeSdk](#function-generatechangesdk) | [matchesTxLabelMapPartial](#function-matchestxlabelmappartial) | [upgradeOutputBaskets](#function-upgradeoutputbaskets) |
|
|
4703
|
+
| [generateChangeSdkMakeStorage](#function-generatechangesdkmakestorage) | [matchesTxLabelPartial](#function-matchestxlabelpartial) | [upgradeOutputTags](#function-upgradeoutputtags) |
|
|
4704
|
+
| [getBeefForTransaction](#function-getbeeffortransaction) | [mergeInputBeefs](#function-mergeinputbeefs) | [upgradeOutputTagsMap](#function-upgradeoutputtagsmap) |
|
|
4705
|
+
| [getListOutputsSpecOp](#function-getlistoutputsspecop) | [mergeInputsIntoBeef](#function-mergeinputsintobeef) | [upgradeOutputs](#function-upgradeoutputs) |
|
|
4706
|
+
| [getSyncChunk](#function-getsyncchunk) | [notifyTransactionsOfProof](#function-notifytransactionsofproof) | [upgradeProvenTxReqs](#function-upgradeproventxreqs) |
|
|
4707
|
+
| [internalizeAction](#function-internalizeaction) | [offsetPrivKey](#function-offsetprivkey) | [upgradeProvenTxs](#function-upgradeproventxs) |
|
|
4708
|
+
| [keyOffsetToHashedSecret](#function-keyoffsettohashedsecret) | [offsetPubKey](#function-offsetpubkey) | [upgradeSyncStates](#function-upgradesyncstates) |
|
|
4709
|
+
| [listActions](#function-listactions) | [partitionActionLabels](#function-partitionactionlabels) | [upgradeTransactions](#function-upgradetransactions) |
|
|
4710
|
+
| [listActionsIdb](#function-listactionsidb) | [processAction](#function-processaction) | [upgradeTxLabels](#function-upgradetxlabels) |
|
|
4711
|
+
| [listCertificates](#function-listcertificates) | [purgeData](#function-purgedata) | [upgradeTxLabelsMap](#function-upgradetxlabelsmap) |
|
|
4712
|
+
| [listOutputs](#function-listoutputs) | [purgeDataIdb](#function-purgedataidb) | [upgradeUsers](#function-upgradeusers) |
|
|
4713
|
+
| [listOutputsIdb](#function-listoutputsidb) | [redeemServiceCharges](#function-redeemservicecharges) | [validateDate](#function-validatedate) |
|
|
4714
|
+
| [lockScriptWithKeyOffsetFromPubKey](#function-lockscriptwithkeyoffsetfrompubkey) | [renderAdminPage](#function-renderadminpage) | [validateEntities](#function-validateentities) |
|
|
4715
|
+
| [markStaleInputsAsSpent](#function-markstaleinputsasspent) | [reviewStatus](#function-reviewstatus) | [validateEntity](#function-validateentity) |
|
|
4716
|
+
| [matchesCertificateFieldPartial](#function-matchescertificatefieldpartial) | [reviewStatusIdb](#function-reviewstatusidb) | [validateGenerateChangeSdkParams](#function-validategeneratechangesdkparams) |
|
|
4717
|
+
| [matchesCertificatePartial](#function-matchescertificatepartial) | [setDisableDoubleSpendCheckForTest](#function-setdisabledoublespendcheckfortest) | [validateGenerateChangeSdkResult](#function-validategeneratechangesdkresult) |
|
|
4718
|
+
| [matchesCommissionPartial](#function-matchescommissionpartial) | [shareReqsWithWorld](#function-sharereqswithworld) | [validateStorageFeeModel](#function-validatestoragefeemodel) |
|
|
4719
|
+
| [matchesMonitorEventPartial](#function-matchesmonitoreventpartial) | [transactionInputSize](#function-transactioninputsize) | [validateSyncChunkEntities](#function-validatesyncchunkentities) |
|
|
4720
|
+
| [matchesOutputBasketPartial](#function-matchesoutputbasketpartial) | [transactionOutputSize](#function-transactionoutputsize) | [varUintSize](#function-varuintsize) |
|
|
4620
4721
|
|
|
4621
4722
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4622
4723
|
|
|
@@ -4635,6 +4736,20 @@ See also: [EntityProvenTxReq](./storage.md#class-entityproventxreq), [PostReqsTo
|
|
|
4635
4736
|
|
|
4636
4737
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4637
4738
|
|
|
4739
|
+
---
|
|
4740
|
+
##### Function: classifyReqStatus
|
|
4741
|
+
|
|
4742
|
+
Classify a ProvenTxReq status into beef-sharing lifecycle status.
|
|
4743
|
+
Mutates `d` in place.
|
|
4744
|
+
|
|
4745
|
+
```ts
|
|
4746
|
+
export function classifyReqStatus(d: GetReqsAndBeefDetail, req: TableProvenTxReq): void
|
|
4747
|
+
```
|
|
4748
|
+
|
|
4749
|
+
See also: [GetReqsAndBeefDetail](./storage.md#interface-getreqsandbeefdetail), [TableProvenTxReq](./storage.md#interface-tableproventxreq)
|
|
4750
|
+
|
|
4751
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4752
|
+
|
|
4638
4753
|
---
|
|
4639
4754
|
##### Function: createAction
|
|
4640
4755
|
|
|
@@ -4669,6 +4784,15 @@ See also: [SyncMap](./storage.md#interface-syncmap)
|
|
|
4669
4784
|
|
|
4670
4785
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4671
4786
|
|
|
4787
|
+
---
|
|
4788
|
+
##### Function: dateMatches
|
|
4789
|
+
|
|
4790
|
+
```ts
|
|
4791
|
+
export function dateMatches(a: Date | undefined, b: Date | undefined): boolean
|
|
4792
|
+
```
|
|
4793
|
+
|
|
4794
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4795
|
+
|
|
4672
4796
|
---
|
|
4673
4797
|
##### Function: determineDBType
|
|
4674
4798
|
|
|
@@ -4892,6 +5016,264 @@ export function lockScriptWithKeyOffsetFromPubKey(pubKey: string, keyOffset?: st
|
|
|
4892
5016
|
|
|
4893
5017
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4894
5018
|
|
|
5019
|
+
---
|
|
5020
|
+
##### Function: markStaleInputsAsSpent
|
|
5021
|
+
|
|
5022
|
+
After any failed broadcast (doubleSpend, invalidTx, etc.), query each
|
|
5023
|
+
consumed-input outpoint of the failed transaction against on-chain
|
|
5024
|
+
UTXO state. For inputs the chain authoritatively confirms are spent
|
|
5025
|
+
(i.e. NOT a UTXO), update the corresponding wallet basket entry to
|
|
5026
|
+
spendable=false.
|
|
5027
|
+
|
|
5028
|
+
Background: `updateTransactionStatus(failed)` optimistically restores
|
|
5029
|
+
all consumed-input outputs to spendable=true so the user can retry
|
|
5030
|
+
with the same inputs. For some failures (genuine doubleSpend, or any
|
|
5031
|
+
'missing-inputs' outcome where the input has been spent on chain by
|
|
5032
|
+
a different transaction), restoration is incorrect — the input is
|
|
5033
|
+
gone and restoring it produces an infinite missing-inputs loop on
|
|
5034
|
+
the next createAction → broadcast cycle. Apps cannot evict from the
|
|
5035
|
+
default basket on app-isolated wallets (admin-only policy), so this
|
|
5036
|
+
self-heal must run inside the wallet.
|
|
5037
|
+
|
|
5038
|
+
Different broadcasters classify the same on-chain reality differently
|
|
5039
|
+
(ARC → doubleSpend, WhatsOnChain/Bitails → invalidTx via
|
|
5040
|
+
'missing-inputs'); this helper is broadcaster-agnostic because its
|
|
5041
|
+
decision is based on services.isUtxo, not the aggregate failure
|
|
5042
|
+
classification.
|
|
5043
|
+
|
|
5044
|
+
Pre-broadcast races where concurrent createActions reach the same
|
|
5045
|
+
UTXO across separate app processes are out of scope; see PR
|
|
5046
|
+
description.
|
|
5047
|
+
|
|
5048
|
+
Conservatively scoped:
|
|
5049
|
+
- Only inputs found in the failing user's basket are touched.
|
|
5050
|
+
- Inputs whose on-chain UTXO status cannot be determined (service
|
|
5051
|
+
error / inconclusive) are left spendable=true. Eviction is opt-in
|
|
5052
|
+
based on positive evidence of stale state.
|
|
5053
|
+
- Inputs the chain confirms are still UTXOs (e.g. a competing tx
|
|
5054
|
+
itself failed, or a malformed/fee failure where inputs are intact)
|
|
5055
|
+
are left spendable=true — preserving the existing transient-retry
|
|
5056
|
+
semantics callers depend on.
|
|
5057
|
+
|
|
5058
|
+
Returns counts for instrumentation and the set of stale outpoints
|
|
5059
|
+
that were actually evicted (added to history note for diagnostics).
|
|
5060
|
+
|
|
5061
|
+
```ts
|
|
5062
|
+
export async function markStaleInputsAsSpent(ar: AggregatePostBeefTxResult, storage: StorageProvider, services: sdk.WalletServices, trx?: sdk.TrxToken, logger?: WalletLoggerInterface): Promise<{
|
|
5063
|
+
checked: number;
|
|
5064
|
+
staleConfirmed: number;
|
|
5065
|
+
staleOutpoints: string[];
|
|
5066
|
+
}>
|
|
5067
|
+
```
|
|
5068
|
+
|
|
5069
|
+
See also: [AggregatePostBeefTxResult](./storage.md#interface-aggregatepostbeeftxresult), [StorageProvider](./storage.md#class-storageprovider), [TrxToken](./client.md#interface-trxtoken), [WalletServices](./client.md#interface-walletservices), [logger](./client.md#variable-logger)
|
|
5070
|
+
|
|
5071
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5072
|
+
|
|
5073
|
+
---
|
|
5074
|
+
##### Function: matchesCertificateFieldPartial
|
|
5075
|
+
|
|
5076
|
+
```ts
|
|
5077
|
+
export function matchesCertificateFieldPartial(r: TableCertificateField, partial: Partial<TableCertificateField>): boolean
|
|
5078
|
+
```
|
|
5079
|
+
|
|
5080
|
+
See also: [TableCertificateField](./storage.md#interface-tablecertificatefield)
|
|
5081
|
+
|
|
5082
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5083
|
+
|
|
5084
|
+
---
|
|
5085
|
+
##### Function: matchesCertificatePartial
|
|
5086
|
+
|
|
5087
|
+
```ts
|
|
5088
|
+
export function matchesCertificatePartial(r: TableCertificate, partial: Partial<TableCertificate>): boolean
|
|
5089
|
+
```
|
|
5090
|
+
|
|
5091
|
+
See also: [TableCertificate](./storage.md#interface-tablecertificate)
|
|
5092
|
+
|
|
5093
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5094
|
+
|
|
5095
|
+
---
|
|
5096
|
+
##### Function: matchesCommissionPartial
|
|
5097
|
+
|
|
5098
|
+
```ts
|
|
5099
|
+
export function matchesCommissionPartial(r: TableCommission, partial: Partial<TableCommission>): boolean
|
|
5100
|
+
```
|
|
5101
|
+
|
|
5102
|
+
See also: [TableCommission](./storage.md#interface-tablecommission)
|
|
5103
|
+
|
|
5104
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5105
|
+
|
|
5106
|
+
---
|
|
5107
|
+
##### Function: matchesMonitorEventPartial
|
|
5108
|
+
|
|
5109
|
+
```ts
|
|
5110
|
+
export function matchesMonitorEventPartial(r: TableMonitorEvent, partial: Partial<TableMonitorEvent>): boolean
|
|
5111
|
+
```
|
|
5112
|
+
|
|
5113
|
+
See also: [TableMonitorEvent](./storage.md#interface-tablemonitorevent)
|
|
5114
|
+
|
|
5115
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5116
|
+
|
|
5117
|
+
---
|
|
5118
|
+
##### Function: matchesOutputBasketPartial
|
|
5119
|
+
|
|
5120
|
+
```ts
|
|
5121
|
+
export function matchesOutputBasketPartial(r: TableOutputBasket, partial: Partial<TableOutputBasket>): boolean
|
|
5122
|
+
```
|
|
5123
|
+
|
|
5124
|
+
See also: [TableOutputBasket](./storage.md#interface-tableoutputbasket)
|
|
5125
|
+
|
|
5126
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5127
|
+
|
|
5128
|
+
---
|
|
5129
|
+
##### Function: matchesOutputPartial
|
|
5130
|
+
|
|
5131
|
+
```ts
|
|
5132
|
+
export function matchesOutputPartial(r: TableOutput, partial: Partial<TableOutput>): boolean
|
|
5133
|
+
```
|
|
5134
|
+
|
|
5135
|
+
See also: [TableOutput](./storage.md#interface-tableoutput)
|
|
5136
|
+
|
|
5137
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5138
|
+
|
|
5139
|
+
---
|
|
5140
|
+
##### Function: matchesOutputTagMapPartial
|
|
5141
|
+
|
|
5142
|
+
```ts
|
|
5143
|
+
export function matchesOutputTagMapPartial(r: TableOutputTagMap, partial: Partial<TableOutputTagMap>): boolean
|
|
5144
|
+
```
|
|
5145
|
+
|
|
5146
|
+
See also: [TableOutputTagMap](./storage.md#interface-tableoutputtagmap)
|
|
5147
|
+
|
|
5148
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5149
|
+
|
|
5150
|
+
---
|
|
5151
|
+
##### Function: matchesOutputTagPartial
|
|
5152
|
+
|
|
5153
|
+
```ts
|
|
5154
|
+
export function matchesOutputTagPartial(r: TableOutputTag, partial: Partial<TableOutputTag>): boolean
|
|
5155
|
+
```
|
|
5156
|
+
|
|
5157
|
+
See also: [TableOutputTag](./storage.md#interface-tableoutputtag)
|
|
5158
|
+
|
|
5159
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5160
|
+
|
|
5161
|
+
---
|
|
5162
|
+
##### Function: matchesProvenTxPartial
|
|
5163
|
+
|
|
5164
|
+
```ts
|
|
5165
|
+
export function matchesProvenTxPartial(r: TableProvenTx, partial: Partial<TableProvenTx>): boolean
|
|
5166
|
+
```
|
|
5167
|
+
|
|
5168
|
+
See also: [TableProvenTx](./storage.md#interface-tableproventx)
|
|
5169
|
+
|
|
5170
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5171
|
+
|
|
5172
|
+
---
|
|
5173
|
+
##### Function: matchesProvenTxReqPartial
|
|
5174
|
+
|
|
5175
|
+
```ts
|
|
5176
|
+
export function matchesProvenTxReqPartial(r: TableProvenTxReq, partial: Partial<TableProvenTxReq>): boolean
|
|
5177
|
+
```
|
|
5178
|
+
|
|
5179
|
+
See also: [TableProvenTxReq](./storage.md#interface-tableproventxreq)
|
|
5180
|
+
|
|
5181
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5182
|
+
|
|
5183
|
+
---
|
|
5184
|
+
##### Function: matchesSyncStatePartial
|
|
5185
|
+
|
|
5186
|
+
```ts
|
|
5187
|
+
export function matchesSyncStatePartial(r: TableSyncState, partial: Partial<TableSyncState>): boolean
|
|
5188
|
+
```
|
|
5189
|
+
|
|
5190
|
+
See also: [TableSyncState](./storage.md#interface-tablesyncstate)
|
|
5191
|
+
|
|
5192
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5193
|
+
|
|
5194
|
+
---
|
|
5195
|
+
##### Function: matchesTransactionPartial
|
|
5196
|
+
|
|
5197
|
+
```ts
|
|
5198
|
+
export function matchesTransactionPartial(r: TableTransaction, partial: Partial<TableTransaction>): boolean
|
|
5199
|
+
```
|
|
5200
|
+
|
|
5201
|
+
See also: [TableTransaction](./storage.md#interface-tabletransaction)
|
|
5202
|
+
|
|
5203
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5204
|
+
|
|
5205
|
+
---
|
|
5206
|
+
##### Function: matchesTxLabelMapPartial
|
|
5207
|
+
|
|
5208
|
+
```ts
|
|
5209
|
+
export function matchesTxLabelMapPartial(r: TableTxLabelMap, partial: Partial<TableTxLabelMap>): boolean
|
|
5210
|
+
```
|
|
5211
|
+
|
|
5212
|
+
See also: [TableTxLabelMap](./storage.md#interface-tabletxlabelmap)
|
|
5213
|
+
|
|
5214
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5215
|
+
|
|
5216
|
+
---
|
|
5217
|
+
##### Function: matchesTxLabelPartial
|
|
5218
|
+
|
|
5219
|
+
```ts
|
|
5220
|
+
export function matchesTxLabelPartial(r: TableTxLabel, partial: Partial<TableTxLabel>): boolean
|
|
5221
|
+
```
|
|
5222
|
+
|
|
5223
|
+
See also: [TableTxLabel](./storage.md#interface-tabletxlabel)
|
|
5224
|
+
|
|
5225
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5226
|
+
|
|
5227
|
+
---
|
|
5228
|
+
##### Function: mergeInputBeefs
|
|
5229
|
+
|
|
5230
|
+
For each input of `rawTx`, ensure the source txid is represented in `beef`.
|
|
5231
|
+
|
|
5232
|
+
When `requiredLevels` is undefined/0 and `knownTxids` contains the source txid,
|
|
5233
|
+
a txid-only stub is merged rather than recursing into storage.
|
|
5234
|
+
|
|
5235
|
+
```ts
|
|
5236
|
+
export async function mergeInputBeefs(rawTx: number[], beef: Beef, trustSelf: "known" | undefined, knownTxids: string[] | undefined, trx: TrxToken | undefined, requiredLevels: number | undefined, getValidBeef: (txid: string, beef: Beef, trustSelf: "known" | undefined, knownTxids: string[] | undefined, trx: TrxToken | undefined, requiredLevels: number | undefined) => Promise<unknown>): Promise<void>
|
|
5237
|
+
```
|
|
5238
|
+
|
|
5239
|
+
See also: [TrxToken](./client.md#interface-trxtoken)
|
|
5240
|
+
|
|
5241
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5242
|
+
|
|
5243
|
+
---
|
|
5244
|
+
##### Function: mergeInputsIntoBeef
|
|
5245
|
+
|
|
5246
|
+
Convenience wrapper for the external-sharing path where `trustSelf` and
|
|
5247
|
+
`requiredLevels` are always absent.
|
|
5248
|
+
|
|
5249
|
+
```ts
|
|
5250
|
+
export async function mergeInputsIntoBeef(rawTx: number[], beef: Beef, knownTxids: string[], trx: TrxToken | undefined, getValidBeef: (txid: string, beef: Beef, trustSelf: undefined, knownTxids: string[], trx: TrxToken | undefined) => Promise<unknown>): Promise<void>
|
|
5251
|
+
```
|
|
5252
|
+
|
|
5253
|
+
See also: [TrxToken](./client.md#interface-trxtoken)
|
|
5254
|
+
|
|
5255
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5256
|
+
|
|
5257
|
+
---
|
|
5258
|
+
##### Function: notifyTransactionsOfProof
|
|
5259
|
+
|
|
5260
|
+
Notify each transaction that a proof has been found.
|
|
5261
|
+
Mutates `req` history notes in place.
|
|
5262
|
+
|
|
5263
|
+
The `addNote` and `flushNotes` callbacks avoid coupling this helper to a
|
|
5264
|
+
specific entity type.
|
|
5265
|
+
|
|
5266
|
+
```ts
|
|
5267
|
+
export async function notifyTransactionsOfProof(ids: number[], provenTxId: number, addNote: (note: ReqHistoryNote) => void, flushNotes: () => Promise<void>, updateTransaction: (id: number, update: {
|
|
5268
|
+
provenTxId: number;
|
|
5269
|
+
status: "completed";
|
|
5270
|
+
}) => Promise<unknown>): Promise<void>
|
|
5271
|
+
```
|
|
5272
|
+
|
|
5273
|
+
See also: [ReqHistoryNote](./client.md#interface-reqhistorynote)
|
|
5274
|
+
|
|
5275
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5276
|
+
|
|
4895
5277
|
---
|
|
4896
5278
|
##### Function: offsetPrivKey
|
|
4897
5279
|
|
|
@@ -4916,6 +5298,21 @@ export function offsetPubKey(pubKey: string, keyOffset?: string): {
|
|
|
4916
5298
|
|
|
4917
5299
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4918
5300
|
|
|
5301
|
+
---
|
|
5302
|
+
##### Function: partitionActionLabels
|
|
5303
|
+
|
|
5304
|
+
```ts
|
|
5305
|
+
export function partitionActionLabels(ordinaryLabels: string[]): {
|
|
5306
|
+
specOp: ListActionsSpecOp | undefined;
|
|
5307
|
+
specOpLabels: string[];
|
|
5308
|
+
labels: string[];
|
|
5309
|
+
}
|
|
5310
|
+
```
|
|
5311
|
+
|
|
5312
|
+
See also: [ListActionsSpecOp](./storage.md#interface-listactionsspecop)
|
|
5313
|
+
|
|
5314
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5315
|
+
|
|
4919
5316
|
---
|
|
4920
5317
|
##### Function: processAction
|
|
4921
5318
|
|
|
@@ -4953,7 +5350,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4953
5350
|
##### Function: redeemServiceCharges
|
|
4954
5351
|
|
|
4955
5352
|
```ts
|
|
4956
|
-
export function redeemServiceCharges(privateKeyWif: string, charges: TableCommission[]): {}
|
|
5353
|
+
export function redeemServiceCharges(privateKeyWif: string, charges: TableCommission[]): Array<{}>
|
|
4957
5354
|
```
|
|
4958
5355
|
|
|
4959
5356
|
See also: [TableCommission](./storage.md#interface-tablecommission)
|
|
@@ -5025,10 +5422,6 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5025
5422
|
---
|
|
5026
5423
|
##### Function: shareReqsWithWorld
|
|
5027
5424
|
|
|
5028
|
-
Verifies that all the txids are known reqs with ready-to-share status.
|
|
5029
|
-
Assigns a batch identifier and updates all the provenTxReqs.
|
|
5030
|
-
If not isDelayed, triggers an initial attempt to broadcast the batch and returns the results.
|
|
5031
|
-
|
|
5032
5425
|
```ts
|
|
5033
5426
|
export async function shareReqsWithWorld(storage: StorageProvider, userId: number, txids: string[], isDelayed: boolean, r?: GetReqsAndBeefResult, logger?: WalletLoggerInterface): Promise<{
|
|
5034
5427
|
swr: SendWithResult[];
|
|
@@ -5038,11 +5431,6 @@ export async function shareReqsWithWorld(storage: StorageProvider, userId: numbe
|
|
|
5038
5431
|
|
|
5039
5432
|
See also: [GetReqsAndBeefResult](./storage.md#interface-getreqsandbeefresult), [ReviewActionResult](./client.md#interface-reviewactionresult), [StorageProvider](./storage.md#class-storageprovider), [logger](./client.md#variable-logger)
|
|
5040
5433
|
|
|
5041
|
-
Argument Details
|
|
5042
|
-
|
|
5043
|
-
+ **r**
|
|
5044
|
-
+ Optional. Ignores txids and allows ProvenTxReqs and merged beef to be passed in.
|
|
5045
|
-
|
|
5046
5434
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5047
5435
|
|
|
5048
5436
|
---
|
|
@@ -5105,6 +5493,263 @@ Argument Details
|
|
|
5105
5493
|
|
|
5106
5494
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5107
5495
|
|
|
5496
|
+
---
|
|
5497
|
+
##### Function: updateReqsFromAggregateResults
|
|
5498
|
+
|
|
5499
|
+
For each txid in submitted `txids`:
|
|
5500
|
+
|
|
5501
|
+
Based on its aggregate status, and whether broadcast happening in background (isDelayed) or immediately (!isDelayed),
|
|
5502
|
+
and iff current req.status is not 'unproven' or 'completed':
|
|
5503
|
+
|
|
5504
|
+
'success':
|
|
5505
|
+
req.status => 'unmined', tx.status => 'unproven'
|
|
5506
|
+
'doubleSpend':
|
|
5507
|
+
req.status => 'doubleSpend', tx.status => 'failed'
|
|
5508
|
+
'invalidTx':
|
|
5509
|
+
req.status => 'invalid', tx.status => 'failed'
|
|
5510
|
+
'serviceError':
|
|
5511
|
+
increment req.attempts
|
|
5512
|
+
|
|
5513
|
+
```ts
|
|
5514
|
+
export async function updateReqsFromAggregateResults(txids: string[], r: PostReqsToNetworkResult, apbrs: Record<string, AggregatePostBeefTxResult>, storage: StorageProvider, services?: sdk.WalletServices, trx?: sdk.TrxToken, logger?: WalletLoggerInterface): Promise<void>
|
|
5515
|
+
```
|
|
5516
|
+
|
|
5517
|
+
See also: [AggregatePostBeefTxResult](./storage.md#interface-aggregatepostbeeftxresult), [PostReqsToNetworkResult](./storage.md#interface-postreqstonetworkresult), [StorageProvider](./storage.md#class-storageprovider), [TrxToken](./client.md#interface-trxtoken), [WalletServices](./client.md#interface-walletservices), [logger](./client.md#variable-logger)
|
|
5518
|
+
|
|
5519
|
+
Argument Details
|
|
5520
|
+
|
|
5521
|
+
+ **services**
|
|
5522
|
+
+ if valid, doubleSpend results will be verified (but only if not within a trx. e.g. trx must be undefined)
|
|
5523
|
+
|
|
5524
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5525
|
+
|
|
5526
|
+
---
|
|
5527
|
+
##### Function: upgradeAllStoresV1
|
|
5528
|
+
|
|
5529
|
+
Upgrade handler for every store that existed at schema version 1.
|
|
5530
|
+
|
|
5531
|
+
```ts
|
|
5532
|
+
export function upgradeAllStoresV1(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5533
|
+
```
|
|
5534
|
+
|
|
5535
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5536
|
+
|
|
5537
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5538
|
+
|
|
5539
|
+
---
|
|
5540
|
+
##### Function: upgradeCertificateFields
|
|
5541
|
+
|
|
5542
|
+
```ts
|
|
5543
|
+
export function upgradeCertificateFields(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5544
|
+
```
|
|
5545
|
+
|
|
5546
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5547
|
+
|
|
5548
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5549
|
+
|
|
5550
|
+
---
|
|
5551
|
+
##### Function: upgradeCertificates
|
|
5552
|
+
|
|
5553
|
+
```ts
|
|
5554
|
+
export function upgradeCertificates(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5555
|
+
```
|
|
5556
|
+
|
|
5557
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5558
|
+
|
|
5559
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5560
|
+
|
|
5561
|
+
---
|
|
5562
|
+
##### Function: upgradeCommissions
|
|
5563
|
+
|
|
5564
|
+
```ts
|
|
5565
|
+
export function upgradeCommissions(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5566
|
+
```
|
|
5567
|
+
|
|
5568
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5569
|
+
|
|
5570
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5571
|
+
|
|
5572
|
+
---
|
|
5573
|
+
##### Function: upgradeMonitorEvents
|
|
5574
|
+
|
|
5575
|
+
```ts
|
|
5576
|
+
export function upgradeMonitorEvents(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5577
|
+
```
|
|
5578
|
+
|
|
5579
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5580
|
+
|
|
5581
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5582
|
+
|
|
5583
|
+
---
|
|
5584
|
+
##### Function: upgradeOutputBaskets
|
|
5585
|
+
|
|
5586
|
+
```ts
|
|
5587
|
+
export function upgradeOutputBaskets(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5588
|
+
```
|
|
5589
|
+
|
|
5590
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5591
|
+
|
|
5592
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5593
|
+
|
|
5594
|
+
---
|
|
5595
|
+
##### Function: upgradeOutputTags
|
|
5596
|
+
|
|
5597
|
+
```ts
|
|
5598
|
+
export function upgradeOutputTags(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5599
|
+
```
|
|
5600
|
+
|
|
5601
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5602
|
+
|
|
5603
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5604
|
+
|
|
5605
|
+
---
|
|
5606
|
+
##### Function: upgradeOutputTagsMap
|
|
5607
|
+
|
|
5608
|
+
```ts
|
|
5609
|
+
export function upgradeOutputTagsMap(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5610
|
+
```
|
|
5611
|
+
|
|
5612
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5613
|
+
|
|
5614
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5615
|
+
|
|
5616
|
+
---
|
|
5617
|
+
##### Function: upgradeOutputs
|
|
5618
|
+
|
|
5619
|
+
```ts
|
|
5620
|
+
export function upgradeOutputs(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5621
|
+
```
|
|
5622
|
+
|
|
5623
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5624
|
+
|
|
5625
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5626
|
+
|
|
5627
|
+
---
|
|
5628
|
+
##### Function: upgradeProvenTxReqs
|
|
5629
|
+
|
|
5630
|
+
```ts
|
|
5631
|
+
export function upgradeProvenTxReqs(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5632
|
+
```
|
|
5633
|
+
|
|
5634
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5635
|
+
|
|
5636
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5637
|
+
|
|
5638
|
+
---
|
|
5639
|
+
##### Function: upgradeProvenTxs
|
|
5640
|
+
|
|
5641
|
+
```ts
|
|
5642
|
+
export function upgradeProvenTxs(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5643
|
+
```
|
|
5644
|
+
|
|
5645
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5646
|
+
|
|
5647
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5648
|
+
|
|
5649
|
+
---
|
|
5650
|
+
##### Function: upgradeSyncStates
|
|
5651
|
+
|
|
5652
|
+
```ts
|
|
5653
|
+
export function upgradeSyncStates(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5654
|
+
```
|
|
5655
|
+
|
|
5656
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5657
|
+
|
|
5658
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5659
|
+
|
|
5660
|
+
---
|
|
5661
|
+
##### Function: upgradeTransactions
|
|
5662
|
+
|
|
5663
|
+
```ts
|
|
5664
|
+
export function upgradeTransactions(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5665
|
+
```
|
|
5666
|
+
|
|
5667
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5668
|
+
|
|
5669
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5670
|
+
|
|
5671
|
+
---
|
|
5672
|
+
##### Function: upgradeTxLabels
|
|
5673
|
+
|
|
5674
|
+
```ts
|
|
5675
|
+
export function upgradeTxLabels(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5676
|
+
```
|
|
5677
|
+
|
|
5678
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5679
|
+
|
|
5680
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5681
|
+
|
|
5682
|
+
---
|
|
5683
|
+
##### Function: upgradeTxLabelsMap
|
|
5684
|
+
|
|
5685
|
+
```ts
|
|
5686
|
+
export function upgradeTxLabelsMap(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5687
|
+
```
|
|
5688
|
+
|
|
5689
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5690
|
+
|
|
5691
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5692
|
+
|
|
5693
|
+
---
|
|
5694
|
+
##### Function: upgradeUsers
|
|
5695
|
+
|
|
5696
|
+
```ts
|
|
5697
|
+
export function upgradeUsers(db: IDBPDatabase<StorageIdbSchema>): void
|
|
5698
|
+
```
|
|
5699
|
+
|
|
5700
|
+
See also: [StorageIdbSchema](./storage.md#interface-storageidbschema)
|
|
5701
|
+
|
|
5702
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5703
|
+
|
|
5704
|
+
---
|
|
5705
|
+
##### Function: validateDate
|
|
5706
|
+
|
|
5707
|
+
Shared entity-validation helpers used by both client-side storage remoting
|
|
5708
|
+
(StorageClientBase / StorageMobile) and the server-side StorageServer.
|
|
5709
|
+
|
|
5710
|
+
These helpers normalise records returned from remote calls or database queries:
|
|
5711
|
+
- Coerce date strings / timestamps to `Date` objects.
|
|
5712
|
+
- Replace `null` values with `undefined`.
|
|
5713
|
+
- Replace `Uint8Array` / `Buffer` values with plain `number[]` arrays.
|
|
5714
|
+
|
|
5715
|
+
```ts
|
|
5716
|
+
export function validateDate(date: Date | string | number): Date
|
|
5717
|
+
```
|
|
5718
|
+
|
|
5719
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5720
|
+
|
|
5721
|
+
---
|
|
5722
|
+
##### Function: validateEntities
|
|
5723
|
+
|
|
5724
|
+
Force uniform behaviour across database engines.
|
|
5725
|
+
Use to process all arrays of records with timestamps retrieved from database.
|
|
5726
|
+
|
|
5727
|
+
```ts
|
|
5728
|
+
export function validateEntities<T extends EntityTimeStamp>(entities: T[], dateFields?: string[]): T[]
|
|
5729
|
+
```
|
|
5730
|
+
|
|
5731
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
5732
|
+
|
|
5733
|
+
Returns
|
|
5734
|
+
|
|
5735
|
+
input `entities` array with contained values validated.
|
|
5736
|
+
|
|
5737
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5738
|
+
|
|
5739
|
+
---
|
|
5740
|
+
##### Function: validateEntity
|
|
5741
|
+
|
|
5742
|
+
Force uniform behaviour across database engines.
|
|
5743
|
+
Use to process all individual records with timestamps retrieved from database.
|
|
5744
|
+
|
|
5745
|
+
```ts
|
|
5746
|
+
export function validateEntity<T extends EntityTimeStamp>(entity: T, dateFields?: string[]): T
|
|
5747
|
+
```
|
|
5748
|
+
|
|
5749
|
+
See also: [EntityTimeStamp](./client.md#interface-entitytimestamp)
|
|
5750
|
+
|
|
5751
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5752
|
+
|
|
5108
5753
|
---
|
|
5109
5754
|
##### Function: validateGenerateChangeSdkParams
|
|
5110
5755
|
|
|
@@ -5141,6 +5786,20 @@ See also: [StorageFeeModel](./client.md#interface-storagefeemodel)
|
|
|
5141
5786
|
|
|
5142
5787
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5143
5788
|
|
|
5789
|
+
---
|
|
5790
|
+
##### Function: validateSyncChunkEntities
|
|
5791
|
+
|
|
5792
|
+
Validate all entity arrays within a `SyncChunk` received from a remote storage call.
|
|
5793
|
+
Normalises timestamps, nulls, and binary fields in-place.
|
|
5794
|
+
|
|
5795
|
+
```ts
|
|
5796
|
+
export function validateSyncChunkEntities(r: SyncChunk): SyncChunk
|
|
5797
|
+
```
|
|
5798
|
+
|
|
5799
|
+
See also: [SyncChunk](./client.md#interface-syncchunk)
|
|
5800
|
+
|
|
5801
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5802
|
+
|
|
5144
5803
|
---
|
|
5145
5804
|
##### Function: varUintSize
|
|
5146
5805
|
|
|
@@ -5150,7 +5809,13 @@ Returns the byte size required to encode number as Bitcoin VarUint
|
|
|
5150
5809
|
export function varUintSize(val: number): 1 | 3 | 5 | 9 {
|
|
5151
5810
|
if (val < 0)
|
|
5152
5811
|
throw new WERR_INVALID_PARAMETER("varUint", "non-negative");
|
|
5153
|
-
|
|
5812
|
+
if (val <= 252)
|
|
5813
|
+
return 1;
|
|
5814
|
+
if (val <= 65535)
|
|
5815
|
+
return 3;
|
|
5816
|
+
if (val <= 4294967295)
|
|
5817
|
+
return 5;
|
|
5818
|
+
return 9;
|
|
5154
5819
|
}
|
|
5155
5820
|
```
|
|
5156
5821
|
|
|
@@ -5234,8 +5899,8 @@ getLabelToSpecOp: () => Record<string, ListActionsSpecOp> = () => {
|
|
|
5234
5899
|
name: "noSendActions",
|
|
5235
5900
|
labelsToIntercept: ["abort"],
|
|
5236
5901
|
setStatusFilter: () => ["nosend"],
|
|
5237
|
-
postProcess: async (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListActionsArgs, specOpLabels: string[], txs: Partial<TableTransaction
|
|
5238
|
-
if (specOpLabels.
|
|
5902
|
+
postProcess: async (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListActionsArgs, specOpLabels: string[], txs: Array<Partial<TableTransaction>>): Promise<void> => {
|
|
5903
|
+
if (specOpLabels.includes("abort")) {
|
|
5239
5904
|
for (const tx of txs) {
|
|
5240
5905
|
if (tx.status === "nosend") {
|
|
5241
5906
|
await s.abortAction(auth, { reference: tx.reference! });
|
|
@@ -5249,8 +5914,8 @@ getLabelToSpecOp: () => Record<string, ListActionsSpecOp> = () => {
|
|
|
5249
5914
|
name: "failedActions",
|
|
5250
5915
|
labelsToIntercept: ["unfail"],
|
|
5251
5916
|
setStatusFilter: () => ["failed"],
|
|
5252
|
-
postProcess: async (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListActionsArgs, specOpLabels: string[], txs: Partial<TableTransaction
|
|
5253
|
-
if (specOpLabels.
|
|
5917
|
+
postProcess: async (s: StorageProvider, auth: AuthId, vargs: Validation.ValidListActionsArgs, specOpLabels: string[], txs: Array<Partial<TableTransaction>>): Promise<void> => {
|
|
5918
|
+
if (specOpLabels.includes("unfail")) {
|
|
5254
5919
|
for (const tx of txs) {
|
|
5255
5920
|
if (tx.status === "failed") {
|
|
5256
5921
|
await s.updateTransaction(tx.transactionId!, { status: "unfail" });
|