@bsv/wallet-toolbox 2.1.24 → 2.1.26
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 +2 -7
- package/docs/client.md +1683 -1111
- 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 +5228 -11040
- package/out/src/CWIStyleWalletManager.d.ts +33 -7
- package/out/src/CWIStyleWalletManager.d.ts.map +1 -1
- package/out/src/CWIStyleWalletManager.js +281 -313
- package/out/src/CWIStyleWalletManager.js.map +1 -1
- package/out/src/Setup.d.ts +6 -6
- package/out/src/Setup.d.ts.map +1 -1
- package/out/src/Setup.js +5 -5
- package/out/src/Setup.js.map +1 -1
- package/out/src/SetupClient.d.ts +6 -6
- package/out/src/SetupClient.d.ts.map +1 -1
- package/out/src/SetupClient.js +5 -5
- package/out/src/SetupClient.js.map +1 -1
- package/out/src/SetupWallet.d.ts.map +1 -1
- package/out/src/ShamirWalletManager.d.ts +3 -3
- package/out/src/ShamirWalletManager.d.ts.map +1 -1
- package/out/src/ShamirWalletManager.js +6 -6
- package/out/src/ShamirWalletManager.js.map +1 -1
- package/out/src/SimpleWalletManager.d.ts +12 -2
- package/out/src/SimpleWalletManager.d.ts.map +1 -1
- package/out/src/SimpleWalletManager.js +46 -30
- package/out/src/SimpleWalletManager.js.map +1 -1
- package/out/src/Wallet.d.ts +1 -1
- package/out/src/Wallet.d.ts.map +1 -1
- package/out/src/Wallet.js +102 -100
- package/out/src/Wallet.js.map +1 -1
- package/out/src/WalletAuthenticationManager.d.ts +1 -1
- package/out/src/WalletAuthenticationManager.d.ts.map +1 -1
- package/out/src/WalletAuthenticationManager.js +3 -3
- package/out/src/WalletAuthenticationManager.js.map +1 -1
- package/out/src/WalletLogger.d.ts.map +1 -1
- package/out/src/WalletLogger.js +16 -8
- package/out/src/WalletLogger.js.map +1 -1
- package/out/src/WalletPermissionsManager.d.ts +89 -18
- package/out/src/WalletPermissionsManager.d.ts.map +1 -1
- package/out/src/WalletPermissionsManager.js +656 -870
- package/out/src/WalletPermissionsManager.js.map +1 -1
- package/out/src/WalletSettingsManager.d.ts +2 -2
- package/out/src/WalletSettingsManager.d.ts.map +1 -1
- package/out/src/WalletSettingsManager.js.map +1 -1
- package/out/src/__tests/CWIStyleWalletManager.test.js +9 -8
- 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 +16 -16
- package/out/src/__tests/WalletPermissionsManager.encryption.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts +2 -3
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.js +12 -22
- 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 +9 -9
- 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 +3 -2
- package/out/src/__tests/WalletPermissionsManager.tokens.test.js.map +1 -1
- package/out/src/entropy/EntropyCollector.d.ts +1 -1
- package/out/src/entropy/EntropyCollector.d.ts.map +1 -1
- package/out/src/entropy/EntropyCollector.js +3 -3
- package/out/src/entropy/EntropyCollector.js.map +1 -1
- package/out/src/fundWalletP2PKH.d.ts +2 -2
- package/out/src/fundWalletP2PKH.d.ts.map +1 -1
- package/out/src/fundWalletP2PKH.js +11 -10
- package/out/src/fundWalletP2PKH.js.map +1 -1
- package/out/src/mockchain/MockChainMigrations.d.ts +3 -3
- package/out/src/mockchain/MockChainMigrations.d.ts.map +1 -1
- package/out/src/mockchain/MockChainMigrations.js.map +1 -1
- package/out/src/mockchain/MockChainStorage.d.ts.map +1 -1
- package/out/src/mockchain/MockChainStorage.js +8 -8
- package/out/src/mockchain/MockChainStorage.js.map +1 -1
- package/out/src/mockchain/MockChainTracker.d.ts.map +1 -1
- package/out/src/mockchain/MockChainTracker.js +10 -10
- package/out/src/mockchain/MockChainTracker.js.map +1 -1
- package/out/src/mockchain/MockMiner.d.ts.map +1 -1
- package/out/src/mockchain/MockMiner.js +3 -3
- package/out/src/mockchain/MockMiner.js.map +1 -1
- package/out/src/mockchain/MockServices.d.ts +9 -0
- package/out/src/mockchain/MockServices.d.ts.map +1 -1
- package/out/src/mockchain/MockServices.js +201 -243
- package/out/src/mockchain/MockServices.js.map +1 -1
- package/out/src/mockchain/merkleTree.d.ts.map +1 -1
- package/out/src/mockchain/merkleTree.js +21 -12
- package/out/src/mockchain/merkleTree.js.map +1 -1
- package/out/src/monitor/Monitor.d.ts +17 -0
- package/out/src/monitor/Monitor.d.ts.map +1 -1
- package/out/src/monitor/Monitor.js +63 -80
- 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 +29 -30
- package/out/src/monitor/MonitorDaemon.js.map +1 -1
- package/out/src/monitor/__test/MonitorDaemon.man.test.js.map +1 -1
- package/out/src/monitor/tasks/TaskArcSSE.d.ts +2 -2
- package/out/src/monitor/tasks/TaskArcSSE.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskArcSSE.js +10 -23
- package/out/src/monitor/tasks/TaskArcSSE.js.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts +2 -2
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.js +28 -16
- package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -1
- package/out/src/monitor/tasks/TaskCheckNoSends.d.ts +1 -1
- package/out/src/monitor/tasks/TaskCheckNoSends.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskCheckNoSends.js +1 -2
- package/out/src/monitor/tasks/TaskCheckNoSends.js.map +1 -1
- package/out/src/monitor/tasks/TaskClock.d.ts +1 -1
- package/out/src/monitor/tasks/TaskClock.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskClock.js +0 -1
- package/out/src/monitor/tasks/TaskClock.js.map +1 -1
- package/out/src/monitor/tasks/TaskFailAbandoned.d.ts +1 -1
- package/out/src/monitor/tasks/TaskFailAbandoned.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskFailAbandoned.js.map +1 -1
- package/out/src/monitor/tasks/TaskMineBlock.d.ts +1 -1
- package/out/src/monitor/tasks/TaskMineBlock.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskMineBlock.js.map +1 -1
- package/out/src/monitor/tasks/TaskMonitorCallHistory.d.ts +1 -1
- package/out/src/monitor/tasks/TaskMonitorCallHistory.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskMonitorCallHistory.js +1 -1
- package/out/src/monitor/tasks/TaskMonitorCallHistory.js.map +1 -1
- package/out/src/monitor/tasks/TaskNewHeader.d.ts +2 -2
- package/out/src/monitor/tasks/TaskNewHeader.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskNewHeader.js +7 -5
- package/out/src/monitor/tasks/TaskNewHeader.js.map +1 -1
- package/out/src/monitor/tasks/TaskPurge.d.ts +1 -1
- package/out/src/monitor/tasks/TaskPurge.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskPurge.js.map +1 -1
- package/out/src/monitor/tasks/TaskReorg.d.ts +1 -1
- package/out/src/monitor/tasks/TaskReorg.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReorg.js +2 -2
- package/out/src/monitor/tasks/TaskReorg.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewDoubleSpends.d.ts +1 -1
- package/out/src/monitor/tasks/TaskReviewDoubleSpends.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReviewDoubleSpends.js +10 -10
- package/out/src/monitor/tasks/TaskReviewDoubleSpends.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewProvenTxs.d.ts +1 -1
- package/out/src/monitor/tasks/TaskReviewProvenTxs.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReviewProvenTxs.js +2 -2
- package/out/src/monitor/tasks/TaskReviewProvenTxs.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewStatus.d.ts +1 -1
- package/out/src/monitor/tasks/TaskReviewStatus.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReviewStatus.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewUtxos.d.ts +1 -1
- package/out/src/monitor/tasks/TaskReviewUtxos.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReviewUtxos.js.map +1 -1
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts +1 -1
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskSendWaiting.js +4 -5
- package/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -1
- package/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts +1 -1
- package/out/src/monitor/tasks/TaskSyncWhenIdle.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskSyncWhenIdle.js +1 -4
- package/out/src/monitor/tasks/TaskSyncWhenIdle.js.map +1 -1
- package/out/src/monitor/tasks/TaskUnFail.d.ts +1 -1
- package/out/src/monitor/tasks/TaskUnFail.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskUnFail.js +13 -15
- package/out/src/monitor/tasks/TaskUnFail.js.map +1 -1
- package/out/src/monitor/tasks/WalletMonitorTask.d.ts.map +1 -1
- package/out/src/monitor/tasks/WalletMonitorTask.js +3 -1
- package/out/src/monitor/tasks/WalletMonitorTask.js.map +1 -1
- package/out/src/monitor/tasks/__tests/TaskArcSSE.test.js.map +1 -1
- package/out/src/monitor/tasks/__tests/TaskReviewDoubleSpends.test.js.map +1 -1
- package/out/src/monitor/tasks/__tests/TaskReviewProvenTxs.test.js.map +1 -1
- package/out/src/monitor/tasks/__tests/TaskReviewUtxos.test.js.map +1 -1
- package/out/src/monitor/tasks/__tests/TaskSendWaiting.test.js.map +1 -1
- package/out/src/sdk/CertOpsWallet.d.ts +3 -3
- package/out/src/sdk/CertOpsWallet.d.ts.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.d.ts +3 -3
- package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.js +32 -24
- package/out/src/sdk/PrivilegedKeyManager.js.map +1 -1
- package/out/src/sdk/WERR_errors.d.ts.map +1 -1
- package/out/src/sdk/WERR_errors.js +5 -5
- package/out/src/sdk/WERR_errors.js.map +1 -1
- package/out/src/sdk/WalletError.d.ts +1 -1
- package/out/src/sdk/WalletError.d.ts.map +1 -1
- package/out/src/sdk/WalletError.js +28 -20
- package/out/src/sdk/WalletError.js.map +1 -1
- package/out/src/sdk/WalletErrorFromJson.d.ts.map +1 -1
- package/out/src/sdk/WalletErrorFromJson.js +1 -3
- package/out/src/sdk/WalletErrorFromJson.js.map +1 -1
- package/out/src/sdk/WalletServices.interfaces.d.ts +19 -19
- package/out/src/sdk/WalletServices.interfaces.d.ts.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/sdk/__test/CertificateLifeCycle.test.js +3 -3
- package/out/src/sdk/__test/CertificateLifeCycle.test.js.map +1 -1
- package/out/src/sdk/__test/WalletError.test.js +4 -4
- package/out/src/sdk/__test/WalletError.test.js.map +1 -1
- package/out/src/sdk/types.d.ts +4 -4
- package/out/src/sdk/types.d.ts.map +1 -1
- package/out/src/sdk/types.js +3 -3
- package/out/src/sdk/types.js.map +1 -1
- package/out/src/services/ServiceCollection.d.ts +6 -6
- package/out/src/services/ServiceCollection.d.ts.map +1 -1
- package/out/src/services/ServiceCollection.js +6 -8
- package/out/src/services/ServiceCollection.js.map +1 -1
- package/out/src/services/Services.d.ts +5 -0
- package/out/src/services/Services.d.ts.map +1 -1
- package/out/src/services/Services.js +190 -196
- package/out/src/services/Services.js.map +1 -1
- package/out/src/services/__tests/ARC.man.test.js.map +1 -1
- package/out/src/services/__tests/ARC.timeout.man.test.js +3 -3
- package/out/src/services/__tests/ARC.timeout.man.test.js.map +1 -1
- package/out/src/services/__tests/ArcGorillaPool.man.test.js.map +1 -1
- package/out/src/services/__tests/bitrails.test.js +3 -2
- package/out/src/services/__tests/bitrails.test.js.map +1 -1
- package/out/src/services/__tests/getFiatExchangeRate.test.js.map +1 -1
- package/out/src/services/__tests/postBeef.test.js.map +1 -1
- package/out/src/services/chaintracker/BHServiceClient.d.ts.map +1 -1
- package/out/src/services/chaintracker/BHServiceClient.js +7 -7
- package/out/src/services/chaintracker/BHServiceClient.js.map +1 -1
- package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts.map +1 -1
- package/out/src/services/chaintracker/ChaintracksChainTracker.js +5 -5
- package/out/src/services/chaintracker/ChaintracksChainTracker.js.map +1 -1
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.js +2 -2
- package/out/src/services/chaintracker/__tests/ChaintracksChainTracker.test.js.map +1 -1
- package/out/src/services/chaintracker/__tests/ChaintracksServiceClient.test.js +1 -1
- package/out/src/services/chaintracker/__tests/ChaintracksServiceClient.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Api/BlockHeaderApi.d.ts +5 -3
- package/out/src/services/chaintracker/chaintracks/Api/BlockHeaderApi.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Api/BlockHeaderApi.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Api/BulkStorageApi.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Chaintracks.d.ts +20 -10
- package/out/src/services/chaintracker/chaintracks/Chaintracks.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Chaintracks.js +228 -221
- package/out/src/services/chaintracker/chaintracks/Chaintracks.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksService.d.ts +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksService.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksService.js +5 -22
- package/out/src/services/chaintracker/chaintracks/ChaintracksService.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +9 -10
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorBase.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorBase.js +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.d.ts +1 -2
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.js +3 -3
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDN.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDNBabbage.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorCDNBabbage.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.js +3 -3
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainCdn.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorWhatsOnChainWs.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorBase.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorBase.js +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorTeranodeP2P.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorTeranodeP2P.js +1 -8
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorTeranodeP2P.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.js +2 -2
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainPoll.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorWhatsOnChainWs.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.d.ts +2 -2
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.js +6 -39
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.d.ts +3 -3
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.js +8 -6
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/BulkIngestorCDNBabbage.test.js +2 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/BulkIngestorCDNBabbage.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/LiveIngestorWhatsOnChainPoll.test.js +4 -3
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/LiveIngestorWhatsOnChainPoll.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/WhatsOnChainServices.man.test.js +11 -10
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/WhatsOnChainServices.man.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.js +9 -16
- package/out/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.d.ts +3 -3
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.js +13 -13
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksKnexMigrations.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.js +34 -22
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.js +31 -30
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.d.ts +1 -2
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.js +25 -22
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageMemory.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageMemory.js +0 -21
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageMemory.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.d.ts +2 -2
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.js +11 -10
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/__tests/ChaintracksStorageIdb.test.js +2 -1
- package/out/src/services/chaintracker/chaintracks/Storage/__tests/ChaintracksStorageIdb.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/__tests/Chaintracks.test.js +8 -7
- package/out/src/services/chaintracker/chaintracks/__tests/Chaintracks.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/__tests/ChaintracksCDN.man.test.js +6 -5
- package/out/src/services/chaintracker/chaintracks/__tests/ChaintracksCDN.man.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/__tests/ChaintracksClientApi.test.js +10 -9
- package/out/src/services/chaintracker/chaintracks/__tests/ChaintracksClientApi.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/__tests/LocalCdnServer.d.ts +1 -1
- package/out/src/services/chaintracker/chaintracks/__tests/LocalCdnServer.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/__tests/LocalCdnServer.js +14 -17
- package/out/src/services/chaintracker/chaintracks/__tests/LocalCdnServer.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/__tests/createIdbChaintracks.test.js +3 -2
- package/out/src/services/chaintracker/chaintracks/__tests/createIdbChaintracks.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.js +6 -8
- package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createIdbChaintracks.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createKnexChaintracks.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createKnexChaintracks.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createNoDbChaintracks.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.d.ts +6 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js +247 -227
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataReader.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataReader.js +8 -7
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataReader.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFilesReader.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFilesReader.js +35 -25
- package/out/src/services/chaintracker/chaintracks/util/BulkFilesReader.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkHeaderFile.d.ts +5 -5
- package/out/src/services/chaintracker/chaintracks/util/BulkHeaderFile.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkHeaderFile.js +13 -11
- package/out/src/services/chaintracker/chaintracks/util/BulkHeaderFile.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.d.ts +0 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFetch.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.d.ts +2 -2
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.js +13 -13
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/HeightRange.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/HeightRange.js +21 -13
- package/out/src/services/chaintracker/chaintracks/util/HeightRange.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.d.ts +2 -2
- package/out/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/SingleWriterMultiReaderLock.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/__tests/BulkFileDataManager.test.js +11 -11
- package/out/src/services/chaintracker/chaintracks/util/__tests/BulkFileDataManager.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/__tests/ChaintracksFetch.test.js +1 -1
- package/out/src/services/chaintracker/chaintracks/util/__tests/ChaintracksFetch.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/__tests/SingleWriterMultiReaderLock.test.js +2 -2
- package/out/src/services/chaintracker/chaintracks/util/__tests/SingleWriterMultiReaderLock.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.d.ts +1 -1
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js +28 -24
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/dirtyHashes.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/dirtyHashes.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.js +9 -10
- package/out/src/services/chaintracker/chaintracks/util/validBulkHeaderFilesByFileHash.js.map +1 -1
- package/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -1
- package/out/src/services/createDefaultWalletServicesOptions.js +3 -3
- package/out/src/services/createDefaultWalletServicesOptions.js.map +1 -1
- package/out/src/services/providers/ARC.d.ts.map +1 -1
- package/out/src/services/providers/ARC.js +7 -14
- package/out/src/services/providers/ARC.js.map +1 -1
- package/out/src/services/providers/ArcSSEClient.d.ts.map +1 -1
- package/out/src/services/providers/ArcSSEClient.js +1 -1
- package/out/src/services/providers/ArcSSEClient.js.map +1 -1
- package/out/src/services/providers/Bitails.d.ts.map +1 -1
- package/out/src/services/providers/Bitails.js +17 -17
- package/out/src/services/providers/Bitails.js.map +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.d.ts.map +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.js.map +1 -1
- package/out/src/services/providers/WhatsOnChain.d.ts +2 -0
- package/out/src/services/providers/WhatsOnChain.d.ts.map +1 -1
- package/out/src/services/providers/WhatsOnChain.js +109 -233
- package/out/src/services/providers/WhatsOnChain.js.map +1 -1
- package/out/src/services/providers/__tests/ArcSSEClient.test.js.map +1 -1
- package/out/src/services/providers/exchangeRates.d.ts.map +1 -1
- package/out/src/services/providers/exchangeRates.js +3 -3
- package/out/src/services/providers/exchangeRates.js.map +1 -1
- package/out/src/services/providers/getBeefForTxid.d.ts +1 -1
- package/out/src/services/providers/getBeefForTxid.d.ts.map +1 -1
- package/out/src/services/providers/getBeefForTxid.js.map +1 -1
- package/out/src/services/providers/whatsOnChainHelpers.d.ts +68 -0
- package/out/src/services/providers/whatsOnChainHelpers.d.ts.map +1 -0
- package/out/src/services/providers/whatsOnChainHelpers.js +147 -0
- package/out/src/services/providers/whatsOnChainHelpers.js.map +1 -0
- package/out/src/signer/WalletSigner.d.ts.map +1 -1
- package/out/src/signer/WalletSigner.js.map +1 -1
- package/out/src/signer/methods/acquireDirectCertificate.js +1 -1
- package/out/src/signer/methods/acquireDirectCertificate.js.map +1 -1
- package/out/src/signer/methods/buildSignableTransaction.d.ts.map +1 -1
- package/out/src/signer/methods/buildSignableTransaction.js +21 -13
- package/out/src/signer/methods/buildSignableTransaction.js.map +1 -1
- package/out/src/signer/methods/completeSignedTransaction.d.ts.map +1 -1
- package/out/src/signer/methods/completeSignedTransaction.js +20 -21
- package/out/src/signer/methods/completeSignedTransaction.js.map +1 -1
- package/out/src/signer/methods/createAction.d.ts.map +1 -1
- package/out/src/signer/methods/createAction.js +8 -7
- package/out/src/signer/methods/createAction.js.map +1 -1
- package/out/src/signer/methods/internalizeAction.d.ts.map +1 -1
- package/out/src/signer/methods/internalizeAction.js +8 -6
- package/out/src/signer/methods/internalizeAction.js.map +1 -1
- package/out/src/signer/methods/proveCertificate.js +1 -1
- package/out/src/signer/methods/signAction.d.ts.map +1 -1
- package/out/src/signer/methods/signAction.js +8 -10
- package/out/src/signer/methods/signAction.js.map +1 -1
- package/out/src/storage/StorageIdb.d.ts +16 -1
- package/out/src/storage/StorageIdb.d.ts.map +1 -1
- package/out/src/storage/StorageIdb.js +578 -1258
- package/out/src/storage/StorageIdb.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts +11 -1
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +316 -303
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts +10 -0
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +171 -197
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/src/storage/StorageReader.d.ts.map +1 -1
- package/out/src/storage/StorageReader.js +14 -13
- 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 +32 -35
- package/out/src/storage/StorageReaderWriter.js.map +1 -1
- package/out/src/storage/StorageSyncReader.d.ts.map +1 -1
- package/out/src/storage/StorageSyncReader.js +4 -4
- package/out/src/storage/StorageSyncReader.js.map +1 -1
- package/out/src/storage/WalletStorageManager.d.ts +3 -0
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
- package/out/src/storage/WalletStorageManager.js +95 -84
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/__test/StorageIdb.test.js +1 -1
- package/out/src/storage/__test/WalletStorageManager.test.js +1 -1
- package/out/src/storage/__test/WalletStorageManager.test.js.map +1 -1
- package/out/src/storage/__test/adminStats.man.test.js +1 -1
- package/out/src/storage/__test/adminStats.man.test.js.map +1 -1
- package/out/src/storage/__test/findStaleMerkleRoots.test.js.map +1 -1
- package/out/src/storage/__test/findStaleMerkleRootsKnex.test.js.map +1 -1
- package/out/src/storage/__test/getBeefForTransaction.test.js +1 -1
- package/out/src/storage/__test/getBeefForTransaction.test.js.map +1 -1
- package/out/src/storage/adminServer/adminServer.d.ts +1 -1
- package/out/src/storage/adminServer/adminServer.d.ts.map +1 -1
- package/out/src/storage/adminServer/adminServer.js +12 -12
- package/out/src/storage/adminServer/adminServer.js.map +1 -1
- package/out/src/storage/adminServer/adminUi.d.ts.map +1 -1
- package/out/src/storage/idbHelpers.d.ts +42 -0
- package/out/src/storage/idbHelpers.d.ts.map +1 -0
- package/out/src/storage/idbHelpers.js +375 -0
- package/out/src/storage/idbHelpers.js.map +1 -0
- 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/methods/ListActionsSpecOp.d.ts +6 -1
- package/out/src/storage/methods/ListActionsSpecOp.d.ts.map +1 -1
- package/out/src/storage/methods/ListActionsSpecOp.js +28 -2
- package/out/src/storage/methods/ListActionsSpecOp.js.map +1 -1
- package/out/src/storage/methods/ListOutputsSpecOp.d.ts.map +1 -1
- package/out/src/storage/methods/ListOutputsSpecOp.js +8 -11
- package/out/src/storage/methods/ListOutputsSpecOp.js.map +1 -1
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.js +3 -3
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.js.map +1 -1
- package/out/src/storage/methods/__test/offsetKey.test.js +1 -1
- package/out/src/storage/methods/__test/offsetKey.test.js.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts +83 -0
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js +224 -61
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -1
- package/out/src/storage/methods/createAction.d.ts.map +1 -1
- package/out/src/storage/methods/createAction.js +230 -270
- package/out/src/storage/methods/createAction.js.map +1 -1
- package/out/src/storage/methods/generateChange.d.ts.map +1 -1
- package/out/src/storage/methods/generateChange.js +99 -80
- package/out/src/storage/methods/generateChange.js.map +1 -1
- package/out/src/storage/methods/getBeefForTransaction.js +15 -13
- package/out/src/storage/methods/getBeefForTransaction.js.map +1 -1
- package/out/src/storage/methods/getSyncChunk.d.ts.map +1 -1
- package/out/src/storage/methods/getSyncChunk.js +4 -3
- package/out/src/storage/methods/getSyncChunk.js.map +1 -1
- package/out/src/storage/methods/internalizeAction.js +41 -51
- package/out/src/storage/methods/internalizeAction.js.map +1 -1
- package/out/src/storage/methods/listActionsIdb.d.ts.map +1 -1
- package/out/src/storage/methods/listActionsIdb.js +85 -110
- package/out/src/storage/methods/listActionsIdb.js.map +1 -1
- package/out/src/storage/methods/listActionsKnex.d.ts +1 -1
- package/out/src/storage/methods/listActionsKnex.d.ts.map +1 -1
- package/out/src/storage/methods/listActionsKnex.js +94 -117
- package/out/src/storage/methods/listActionsKnex.js.map +1 -1
- package/out/src/storage/methods/listCertificates.d.ts +1 -1
- package/out/src/storage/methods/listCertificates.d.ts.map +1 -1
- package/out/src/storage/methods/listCertificates.js +7 -7
- package/out/src/storage/methods/listCertificates.js.map +1 -1
- package/out/src/storage/methods/listOutputsIdb.d.ts.map +1 -1
- package/out/src/storage/methods/listOutputsIdb.js +24 -27
- package/out/src/storage/methods/listOutputsIdb.js.map +1 -1
- package/out/src/storage/methods/listOutputsKnex.d.ts +1 -1
- package/out/src/storage/methods/listOutputsKnex.d.ts.map +1 -1
- package/out/src/storage/methods/listOutputsKnex.js +27 -28
- package/out/src/storage/methods/listOutputsKnex.js.map +1 -1
- package/out/src/storage/methods/offsetKey.d.ts +1 -1
- package/out/src/storage/methods/offsetKey.d.ts.map +1 -1
- package/out/src/storage/methods/offsetKey.js +3 -5
- package/out/src/storage/methods/offsetKey.js.map +1 -1
- package/out/src/storage/methods/processAction.d.ts +0 -11
- package/out/src/storage/methods/processAction.d.ts.map +1 -1
- package/out/src/storage/methods/processAction.js +90 -83
- package/out/src/storage/methods/processAction.js.map +1 -1
- package/out/src/storage/methods/purgeData.d.ts +1 -1
- package/out/src/storage/methods/purgeData.d.ts.map +1 -1
- package/out/src/storage/methods/purgeData.js +35 -16
- package/out/src/storage/methods/purgeData.js.map +1 -1
- package/out/src/storage/methods/purgeDataIdb.d.ts.map +1 -1
- package/out/src/storage/methods/purgeDataIdb.js +1 -1
- package/out/src/storage/methods/purgeDataIdb.js.map +1 -1
- package/out/src/storage/methods/reviewStatus.d.ts +1 -1
- package/out/src/storage/methods/reviewStatus.d.ts.map +1 -1
- package/out/src/storage/methods/reviewStatus.js +20 -12
- package/out/src/storage/methods/reviewStatus.js.map +1 -1
- package/out/src/storage/methods/reviewStatusIdb.d.ts +1 -1
- package/out/src/storage/methods/reviewStatusIdb.d.ts.map +1 -1
- package/out/src/storage/methods/reviewStatusIdb.js.map +1 -1
- package/out/src/storage/methods/utils.Buffer.d.ts.map +1 -1
- package/out/src/storage/methods/utils.Buffer.js.map +1 -1
- package/out/src/storage/methods/utils.d.ts.map +1 -1
- package/out/src/storage/methods/utils.js +7 -1
- package/out/src/storage/methods/utils.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/remoting/StorageClient.d.ts +4 -270
- package/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageClient.js +16 -423
- package/out/src/storage/remoting/StorageClient.js.map +1 -1
- package/out/src/storage/remoting/StorageClientBase.d.ts +289 -0
- package/out/src/storage/remoting/StorageClientBase.d.ts.map +1 -0
- package/out/src/storage/remoting/StorageClientBase.js +375 -0
- package/out/src/storage/remoting/StorageClientBase.js.map +1 -0
- package/out/src/storage/remoting/StorageMobile.d.ts +7 -275
- package/out/src/storage/remoting/StorageMobile.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageMobile.js +12 -421
- package/out/src/storage/remoting/StorageMobile.js.map +1 -1
- package/out/src/storage/remoting/StorageServer.d.ts +11 -8
- package/out/src/storage/remoting/StorageServer.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageServer.js +51 -102
- package/out/src/storage/remoting/StorageServer.js.map +1 -1
- package/out/src/storage/remoting/__test/StorageClient.man.test.js +6 -6
- package/out/src/storage/remoting/__test/StorageClient.man.test.js.map +1 -1
- package/out/src/storage/remoting/__test/StorageClient.test.js +8 -8
- package/out/src/storage/remoting/__test/StorageClient.test.js.map +1 -1
- package/out/src/storage/remoting/__tests__/entityValidationHelpers.test.d.ts +2 -0
- package/out/src/storage/remoting/__tests__/entityValidationHelpers.test.d.ts.map +1 -0
- package/out/src/storage/remoting/__tests__/entityValidationHelpers.test.js +268 -0
- package/out/src/storage/remoting/__tests__/entityValidationHelpers.test.js.map +1 -0
- package/out/src/storage/remoting/entityValidationHelpers.d.ts +29 -0
- package/out/src/storage/remoting/entityValidationHelpers.d.ts.map +1 -0
- package/out/src/storage/remoting/entityValidationHelpers.js +91 -0
- package/out/src/storage/remoting/entityValidationHelpers.js.map +1 -0
- package/out/src/storage/schema/KnexMigrations.d.ts +3 -3
- package/out/src/storage/schema/KnexMigrations.d.ts.map +1 -1
- package/out/src/storage/schema/KnexMigrations.js +26 -9
- package/out/src/storage/schema/KnexMigrations.js.map +1 -1
- package/out/src/storage/schema/StorageIdbSchema.d.ts +1 -1
- package/out/src/storage/schema/StorageIdbSchema.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityBase.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityBase.js.map +1 -1
- package/out/src/storage/schema/entities/EntityCertificate.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityCertificate.js +5 -4
- package/out/src/storage/schema/entities/EntityCertificate.js.map +1 -1
- package/out/src/storage/schema/entities/EntityCertificateField.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityCertificateField.js +5 -7
- package/out/src/storage/schema/entities/EntityCertificateField.js.map +1 -1
- package/out/src/storage/schema/entities/EntityCommission.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityCommission.js +6 -8
- package/out/src/storage/schema/entities/EntityCommission.js.map +1 -1
- package/out/src/storage/schema/entities/EntityOutput.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityOutput.js +21 -24
- package/out/src/storage/schema/entities/EntityOutput.js.map +1 -1
- package/out/src/storage/schema/entities/EntityOutputBasket.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityOutputBasket.js +6 -6
- package/out/src/storage/schema/entities/EntityOutputBasket.js.map +1 -1
- package/out/src/storage/schema/entities/EntityOutputTag.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityOutputTag.js +2 -2
- package/out/src/storage/schema/entities/EntityOutputTag.js.map +1 -1
- package/out/src/storage/schema/entities/EntityOutputTagMap.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityOutputTagMap.js +4 -6
- package/out/src/storage/schema/entities/EntityOutputTagMap.js.map +1 -1
- package/out/src/storage/schema/entities/EntityProvenTx.d.ts +3 -3
- package/out/src/storage/schema/entities/EntityProvenTx.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityProvenTx.js +22 -23
- package/out/src/storage/schema/entities/EntityProvenTx.js.map +1 -1
- package/out/src/storage/schema/entities/EntityProvenTxReq.d.ts +9 -0
- package/out/src/storage/schema/entities/EntityProvenTxReq.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityProvenTxReq.js +116 -68
- package/out/src/storage/schema/entities/EntityProvenTxReq.js.map +1 -1
- package/out/src/storage/schema/entities/EntitySyncState.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntitySyncState.js +19 -18
- package/out/src/storage/schema/entities/EntitySyncState.js.map +1 -1
- package/out/src/storage/schema/entities/EntityTransaction.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityTransaction.js +25 -26
- package/out/src/storage/schema/entities/EntityTransaction.js.map +1 -1
- package/out/src/storage/schema/entities/EntityTxLabel.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityTxLabel.js +2 -2
- package/out/src/storage/schema/entities/EntityTxLabel.js.map +1 -1
- package/out/src/storage/schema/entities/EntityTxLabelMap.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityTxLabelMap.js +4 -6
- package/out/src/storage/schema/entities/EntityTxLabelMap.js.map +1 -1
- package/out/src/storage/schema/entities/EntityUser.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityUser.js +3 -3
- package/out/src/storage/schema/entities/EntityUser.js.map +1 -1
- package/out/src/storage/schema/entities/MergeEntity.d.ts.map +1 -1
- package/out/src/storage/schema/entities/MergeEntity.js +6 -6
- package/out/src/storage/schema/entities/MergeEntity.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.js +1 -1
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.js +3 -3
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/OutputTests.test.js +1 -1
- package/out/src/storage/schema/entities/__tests/OutputTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.js +32 -0
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js +6 -6
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.js +3 -3
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.js +3 -3
- package/out/src/storage/schema/entities/__tests/usersTests.test.js +1 -1
- package/out/src/storage/schema/entities/__tests/usersTests.test.js.map +1 -1
- package/out/src/storage/schema/tables/TableCertificate.d.ts +2 -1
- package/out/src/storage/schema/tables/TableCertificate.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableCertificateField.d.ts +1 -1
- package/out/src/storage/schema/tables/TableCertificateField.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableCommission.d.ts +1 -1
- package/out/src/storage/schema/tables/TableCommission.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableMonitorEvent.d.ts +1 -1
- package/out/src/storage/schema/tables/TableMonitorEvent.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableOutput.d.ts +3 -2
- package/out/src/storage/schema/tables/TableOutput.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableOutput.js +1 -1
- package/out/src/storage/schema/tables/TableOutput.js.map +1 -1
- package/out/src/storage/schema/tables/TableOutputBasket.d.ts +1 -1
- package/out/src/storage/schema/tables/TableOutputBasket.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableOutputTag.d.ts +1 -1
- package/out/src/storage/schema/tables/TableOutputTag.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableOutputTagMap.d.ts +1 -1
- package/out/src/storage/schema/tables/TableOutputTagMap.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableProvenTx.d.ts +1 -1
- package/out/src/storage/schema/tables/TableProvenTx.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableProvenTxReq.d.ts +24 -1
- package/out/src/storage/schema/tables/TableProvenTxReq.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableSettings.d.ts +1 -1
- package/out/src/storage/schema/tables/TableSettings.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableSyncState.d.ts +1 -1
- package/out/src/storage/schema/tables/TableSyncState.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableTransaction.d.ts +1 -1
- package/out/src/storage/schema/tables/TableTransaction.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableTxLabel.d.ts +1 -1
- package/out/src/storage/schema/tables/TableTxLabel.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableTxLabelMap.d.ts +1 -1
- package/out/src/storage/schema/tables/TableTxLabelMap.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableUser.d.ts +1 -1
- package/out/src/storage/schema/tables/TableUser.d.ts.map +1 -1
- package/out/src/storage/storageProviderHelpers.d.ts +34 -0
- package/out/src/storage/storageProviderHelpers.d.ts.map +1 -0
- package/out/src/storage/storageProviderHelpers.js +100 -0
- package/out/src/storage/storageProviderHelpers.js.map +1 -0
- package/out/src/storage/sync/StorageMySQLDojoReader.d.ts +1 -2
- package/out/src/storage/sync/StorageMySQLDojoReader.d.ts.map +1 -1
- package/out/src/storage/sync/StorageMySQLDojoReader.js +37 -32
- package/out/src/storage/sync/StorageMySQLDojoReader.js.map +1 -1
- package/out/src/utility/Format.d.ts.map +1 -1
- package/out/src/utility/Format.js +16 -49
- 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 +4 -2
- package/out/src/utility/ScriptTemplateBRC29.js.map +1 -1
- package/out/src/utility/aggregateResults.d.ts +1 -1
- package/out/src/utility/aggregateResults.d.ts.map +1 -1
- package/out/src/utility/aggregateResults.js +2 -2
- package/out/src/utility/aggregateResults.js.map +1 -1
- package/out/src/utility/brc114ActionTimeLabels.d.ts +2 -2
- package/out/src/utility/brc114ActionTimeLabels.d.ts.map +1 -1
- package/out/src/utility/brc114ActionTimeLabels.js +17 -10
- package/out/src/utility/brc114ActionTimeLabels.js.map +1 -1
- package/out/src/utility/identityUtils.d.ts.map +1 -1
- package/out/src/utility/identityUtils.js +6 -6
- 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/parseTxScriptOffsets.d.ts +4 -4
- package/out/src/utility/parseTxScriptOffsets.d.ts.map +1 -1
- package/out/src/utility/parseTxScriptOffsets.js.map +1 -1
- package/out/src/utility/stampLog.d.ts.map +1 -1
- package/out/src/utility/stampLog.js +6 -4
- package/out/src/utility/stampLog.js.map +1 -1
- package/out/src/utility/tscProofToMerklePath.d.ts.map +1 -1
- package/out/src/utility/tscProofToMerklePath.js +1 -1
- package/out/src/utility/tscProofToMerklePath.js.map +1 -1
- package/out/src/utility/utilityHelpers.buffer.d.ts +5 -3
- package/out/src/utility/utilityHelpers.buffer.d.ts.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 +1 -2
- package/out/src/utility/utilityHelpers.d.ts.map +1 -1
- package/out/src/utility/utilityHelpers.js +12 -12
- package/out/src/utility/utilityHelpers.js.map +1 -1
- package/out/src/utility/utilityHelpers.noBuffer.d.ts +7 -3
- package/out/src/utility/utilityHelpers.noBuffer.d.ts.map +1 -1
- package/out/src/utility/utilityHelpers.noBuffer.js +3 -3
- package/out/src/utility/utilityHelpers.noBuffer.js.map +1 -1
- package/out/src/wab-client/WABClient.d.ts +3 -3
- package/out/src/wab-client/WABClient.d.ts.map +1 -1
- package/out/src/wab-client/WABClient.js +12 -12
- package/out/src/wab-client/WABClient.js.map +1 -1
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts.map +1 -1
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js +3 -3
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js.map +1 -1
- package/package.json +24 -20
|
@@ -14,8 +14,8 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
14
14
|
constructor(options) {
|
|
15
15
|
super(options);
|
|
16
16
|
this._verifiedReadyForDatabaseAccess = false;
|
|
17
|
-
if (
|
|
18
|
-
throw new WERR_errors_1.WERR_INVALID_PARAMETER('options.knex',
|
|
17
|
+
if (options.knex == null)
|
|
18
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('options.knex', 'valid');
|
|
19
19
|
this.knex = options.knex;
|
|
20
20
|
}
|
|
21
21
|
async readSettings() {
|
|
@@ -28,13 +28,13 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
28
28
|
rawTx: undefined,
|
|
29
29
|
inputBEEF: undefined
|
|
30
30
|
};
|
|
31
|
-
r.proven = (0, utilityHelpers_1.verifyOneOrNone)(await this.findProvenTxs({ partial: { txid
|
|
32
|
-
if (
|
|
31
|
+
r.proven = (0, utilityHelpers_1.verifyOneOrNone)(await this.findProvenTxs({ partial: { txid } }));
|
|
32
|
+
if (r.proven == null) {
|
|
33
33
|
const reqRawTx = (0, utilityHelpers_1.verifyOneOrNone)(await k('proven_tx_reqs')
|
|
34
34
|
.where('txid', txid)
|
|
35
35
|
.whereIn('status', ['unsent', 'unmined', 'unconfirmed', 'sending', 'nosend', 'completed'])
|
|
36
36
|
.select('rawTx', 'inputBEEF'));
|
|
37
|
-
if (reqRawTx) {
|
|
37
|
+
if (reqRawTx != null) {
|
|
38
38
|
r.rawTx = Array.from(reqRawTx.rawTx);
|
|
39
39
|
r.inputBEEF = Array.from(reqRawTx.inputBEEF);
|
|
40
40
|
}
|
|
@@ -43,55 +43,49 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
43
43
|
}
|
|
44
44
|
dbTypeSubstring(source, fromOffset, forLength) {
|
|
45
45
|
if (this.dbtype === 'MySQL')
|
|
46
|
-
return `substring(${source} from ${fromOffset} for ${forLength})`;
|
|
47
|
-
return `substr(${source}, ${fromOffset}, ${forLength})`;
|
|
46
|
+
return `substring(${source} from ${fromOffset} for ${String(forLength)})`;
|
|
47
|
+
return `substr(${source}, ${fromOffset}, ${String(forLength)})`;
|
|
48
|
+
}
|
|
49
|
+
normaliseKnexRawResult(rs) {
|
|
50
|
+
if (this.dbtype === 'MySQL')
|
|
51
|
+
return rs[0];
|
|
52
|
+
return rs;
|
|
53
|
+
}
|
|
54
|
+
async getRawTxSlice(txid, offset, length, trx) {
|
|
55
|
+
const sub = this.dbTypeSubstring('rawTx', offset + 1, length);
|
|
56
|
+
let rs = await this.toDb(trx).raw(`select ${sub} as rawTx from proven_txs where txid = '${txid}'`);
|
|
57
|
+
const proven = (0, utilityHelpers_1.verifyOneOrNone)(this.normaliseKnexRawResult(rs));
|
|
58
|
+
if ((proven === null || proven === void 0 ? void 0 : proven.rawTx) != null)
|
|
59
|
+
return Array.from(proven.rawTx);
|
|
60
|
+
rs = await this.toDb(trx).raw(`select ${sub} as rawTx from proven_tx_reqs where txid = '${txid}' and status in ('unsent', 'nosend', 'sending', 'unmined', 'completed', 'unfail')`);
|
|
61
|
+
const req = (0, utilityHelpers_1.verifyOneOrNone)(this.normaliseKnexRawResult(rs));
|
|
62
|
+
return (req === null || req === void 0 ? void 0 : req.rawTx) != null ? Array.from(req.rawTx) : undefined;
|
|
48
63
|
}
|
|
49
64
|
async getRawTxOfKnownValidTransaction(txid, offset, length, trx) {
|
|
50
|
-
if (
|
|
65
|
+
if (txid == null || txid === '')
|
|
51
66
|
return undefined;
|
|
52
67
|
if (!this.isAvailable())
|
|
53
68
|
await this.makeAvailable();
|
|
54
|
-
let rawTx = undefined;
|
|
55
69
|
if (Number.isInteger(offset) && Number.isInteger(length)) {
|
|
56
|
-
|
|
57
|
-
if (this.dbtype === 'MySQL')
|
|
58
|
-
rs = rs[0];
|
|
59
|
-
const r = (0, utilityHelpers_1.verifyOneOrNone)(rs);
|
|
60
|
-
if (r && r.rawTx) {
|
|
61
|
-
rawTx = Array.from(r.rawTx);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
let rs = await this.toDb(trx).raw(`select ${this.dbTypeSubstring('rawTx', offset + 1, length)} as rawTx from proven_tx_reqs where txid = '${txid}' and status in ('unsent', 'nosend', 'sending', 'unmined', 'completed', 'unfail')`);
|
|
65
|
-
if (this.dbtype === 'MySQL')
|
|
66
|
-
rs = rs[0];
|
|
67
|
-
const r = (0, utilityHelpers_1.verifyOneOrNone)(rs);
|
|
68
|
-
if (r && r.rawTx) {
|
|
69
|
-
rawTx = Array.from(r.rawTx);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
const r = await this.getProvenOrRawTx(txid, trx);
|
|
75
|
-
if (r.proven)
|
|
76
|
-
rawTx = r.proven.rawTx;
|
|
77
|
-
else
|
|
78
|
-
rawTx = r.rawTx;
|
|
70
|
+
return await this.getRawTxSlice(txid, offset, length, trx);
|
|
79
71
|
}
|
|
80
|
-
|
|
72
|
+
const r = await this.getProvenOrRawTx(txid, trx);
|
|
73
|
+
return r.proven != null ? r.proven.rawTx : r.rawTx;
|
|
81
74
|
}
|
|
82
75
|
getProvenTxsForUserQuery(args) {
|
|
76
|
+
var _a;
|
|
83
77
|
const k = this.toDb(args.trx);
|
|
84
78
|
let q = k('proven_txs').where(function () {
|
|
85
|
-
this.whereExists(k
|
|
79
|
+
void this.whereExists(k
|
|
86
80
|
.select('*')
|
|
87
81
|
.from('transactions')
|
|
88
82
|
.whereRaw(`proven_txs.provenTxId = transactions.provenTxId and transactions.userId = ${args.userId}`));
|
|
89
83
|
});
|
|
90
|
-
if (args.paged) {
|
|
84
|
+
if (args.paged != null) {
|
|
91
85
|
q = q.limit(args.paged.limit);
|
|
92
|
-
q = q.offset(args.paged.offset
|
|
86
|
+
q = q.offset((_a = args.paged.offset) !== null && _a !== void 0 ? _a : 0);
|
|
93
87
|
}
|
|
94
|
-
if (args.since)
|
|
88
|
+
if (args.since != null)
|
|
95
89
|
q = q.where('updated_at', '>=', this.validateDateForWhere(args.since));
|
|
96
90
|
return q;
|
|
97
91
|
}
|
|
@@ -101,18 +95,19 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
101
95
|
return this.validateEntities(rs);
|
|
102
96
|
}
|
|
103
97
|
getProvenTxReqsForUserQuery(args) {
|
|
98
|
+
var _a;
|
|
104
99
|
const k = this.toDb(args.trx);
|
|
105
100
|
let q = k('proven_tx_reqs').where(function () {
|
|
106
|
-
this.whereExists(k
|
|
101
|
+
void this.whereExists(k
|
|
107
102
|
.select('*')
|
|
108
103
|
.from('transactions')
|
|
109
104
|
.whereRaw(`proven_tx_reqs.txid = transactions.txid and transactions.userId = ${args.userId}`));
|
|
110
105
|
});
|
|
111
|
-
if (args.paged) {
|
|
106
|
+
if (args.paged != null) {
|
|
112
107
|
q = q.limit(args.paged.limit);
|
|
113
|
-
q = q.offset(args.paged.offset
|
|
108
|
+
q = q.offset((_a = args.paged.offset) !== null && _a !== void 0 ? _a : 0);
|
|
114
109
|
}
|
|
115
|
-
if (args.since)
|
|
110
|
+
if (args.since != null)
|
|
116
111
|
q = q.where('updated_at', '>=', this.validateDateForWhere(args.since));
|
|
117
112
|
return q;
|
|
118
113
|
}
|
|
@@ -122,16 +117,17 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
122
117
|
return this.validateEntities(rs, undefined, ['notified']);
|
|
123
118
|
}
|
|
124
119
|
getTxLabelMapsForUserQuery(args) {
|
|
120
|
+
var _a;
|
|
125
121
|
const k = this.toDb(args.trx);
|
|
126
122
|
let q = k('tx_labels_map').whereExists(k
|
|
127
123
|
.select('*')
|
|
128
124
|
.from('tx_labels')
|
|
129
125
|
.whereRaw(`tx_labels.txLabelId = tx_labels_map.txLabelId and tx_labels.userId = ${args.userId}`));
|
|
130
|
-
if (args.since)
|
|
126
|
+
if (args.since != null)
|
|
131
127
|
q = q.where('updated_at', '>=', this.validateDateForWhere(args.since));
|
|
132
|
-
if (args.paged) {
|
|
128
|
+
if (args.paged != null) {
|
|
133
129
|
q = q.limit(args.paged.limit);
|
|
134
|
-
q = q.offset(args.paged.offset
|
|
130
|
+
q = q.offset((_a = args.paged.offset) !== null && _a !== void 0 ? _a : 0);
|
|
135
131
|
}
|
|
136
132
|
return q;
|
|
137
133
|
}
|
|
@@ -141,16 +137,17 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
141
137
|
return this.validateEntities(rs, undefined, ['isDeleted']);
|
|
142
138
|
}
|
|
143
139
|
getOutputTagMapsForUserQuery(args) {
|
|
140
|
+
var _a;
|
|
144
141
|
const k = this.toDb(args.trx);
|
|
145
142
|
let q = k('output_tags_map').whereExists(k
|
|
146
143
|
.select('*')
|
|
147
144
|
.from('output_tags')
|
|
148
145
|
.whereRaw(`output_tags.outputTagId = output_tags_map.outputTagId and output_tags.userId = ${args.userId}`));
|
|
149
|
-
if (args.since)
|
|
146
|
+
if (args.since != null)
|
|
150
147
|
q = q.where('updated_at', '>=', this.validateDateForWhere(args.since));
|
|
151
|
-
if (args.paged) {
|
|
148
|
+
if (args.paged != null) {
|
|
152
149
|
q = q.limit(args.paged.limit);
|
|
153
|
-
q = q.offset(args.paged.offset
|
|
150
|
+
q = q.offset((_a = args.paged.offset) !== null && _a !== void 0 ? _a : 0);
|
|
154
151
|
}
|
|
155
152
|
return q;
|
|
156
153
|
}
|
|
@@ -160,12 +157,12 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
160
157
|
return this.validateEntities(rs, undefined, ['isDeleted']);
|
|
161
158
|
}
|
|
162
159
|
async listActions(auth, vargs) {
|
|
163
|
-
if (
|
|
160
|
+
if (auth.userId == null)
|
|
164
161
|
throw new WERR_errors_1.WERR_UNAUTHORIZED();
|
|
165
162
|
return await (0, listActionsKnex_1.listActions)(this, auth, vargs);
|
|
166
163
|
}
|
|
167
164
|
async listOutputs(auth, vargs) {
|
|
168
|
-
if (
|
|
165
|
+
if (auth.userId == null)
|
|
169
166
|
throw new WERR_errors_1.WERR_UNAUTHORIZED();
|
|
170
167
|
return await (0, listOutputsKnex_1.listOutputs)(this, auth, vargs);
|
|
171
168
|
}
|
|
@@ -194,7 +191,7 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
194
191
|
return user.userId;
|
|
195
192
|
}
|
|
196
193
|
async insertCertificateAuth(auth, certificate) {
|
|
197
|
-
if (
|
|
194
|
+
if (auth.userId == null || (certificate.userId != null && certificate.userId !== 0 && certificate.userId !== auth.userId))
|
|
198
195
|
throw new WERR_errors_1.WERR_UNAUTHORIZED();
|
|
199
196
|
certificate.userId = auth.userId;
|
|
200
197
|
return await this.insertCertificate(certificate);
|
|
@@ -203,15 +200,14 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
203
200
|
const e = await this.validateEntityForInsert(certificate, trx, undefined, ['isDeleted']);
|
|
204
201
|
if (e.certificateId === 0)
|
|
205
202
|
delete e.certificateId;
|
|
206
|
-
|
|
207
|
-
if (e.logger)
|
|
203
|
+
if (e.logger != null)
|
|
208
204
|
delete e.logger;
|
|
209
205
|
const fields = e.fields;
|
|
210
|
-
if (e.fields)
|
|
206
|
+
if (e.fields != null)
|
|
211
207
|
delete e.fields;
|
|
212
208
|
const [id] = await this.toDb(trx)('certificates').insert(e);
|
|
213
209
|
certificate.certificateId = id;
|
|
214
|
-
if (fields) {
|
|
210
|
+
if (fields != null) {
|
|
215
211
|
for (const field of fields) {
|
|
216
212
|
field.certificateId = id;
|
|
217
213
|
field.userId = certificate.userId;
|
|
@@ -249,17 +245,12 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
249
245
|
return commission.commissionId;
|
|
250
246
|
}
|
|
251
247
|
async insertOutput(output, trx) {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
return output.outputId;
|
|
259
|
-
}
|
|
260
|
-
catch (e) {
|
|
261
|
-
throw e;
|
|
262
|
-
}
|
|
248
|
+
const e = await this.validateEntityForInsert(output, trx);
|
|
249
|
+
if (e.outputId === 0)
|
|
250
|
+
delete e.outputId;
|
|
251
|
+
const [id] = await this.toDb(trx)('outputs').insert(e);
|
|
252
|
+
output.outputId = id;
|
|
253
|
+
return output.outputId;
|
|
263
254
|
}
|
|
264
255
|
async insertOutputTag(tag, trx) {
|
|
265
256
|
const e = await this.validateEntityForInsert(tag, trx, undefined, ['isDeleted']);
|
|
@@ -271,7 +262,7 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
271
262
|
}
|
|
272
263
|
async insertOutputTagMap(tagMap, trx) {
|
|
273
264
|
const e = await this.validateEntityForInsert(tagMap, trx, undefined, ['isDeleted']);
|
|
274
|
-
|
|
265
|
+
await this.toDb(trx)('output_tags_map').insert(e);
|
|
275
266
|
}
|
|
276
267
|
async insertTxLabel(label, trx) {
|
|
277
268
|
const e = await this.validateEntityForInsert(label, trx, undefined, ['isDeleted']);
|
|
@@ -283,7 +274,7 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
283
274
|
}
|
|
284
275
|
async insertTxLabelMap(labelMap, trx) {
|
|
285
276
|
const e = await this.validateEntityForInsert(labelMap, trx, undefined, ['isDeleted']);
|
|
286
|
-
|
|
277
|
+
await this.toDb(trx)('tx_labels_map').insert(e);
|
|
287
278
|
}
|
|
288
279
|
async insertMonitorEvent(event, trx) {
|
|
289
280
|
const e = await this.validateEntityForInsert(event, trx);
|
|
@@ -379,12 +370,12 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
379
370
|
if (Array.isArray(id)) {
|
|
380
371
|
r = await this.toDb(trx)('transactions')
|
|
381
372
|
.whereIn('transactionId', id)
|
|
382
|
-
.update(
|
|
373
|
+
.update(this.validatePartialForUpdate(update));
|
|
383
374
|
}
|
|
384
375
|
else if (Number.isInteger(id)) {
|
|
385
376
|
r = await this.toDb(trx)('transactions')
|
|
386
377
|
.where({ transactionId: id })
|
|
387
|
-
.update(
|
|
378
|
+
.update(this.validatePartialForUpdate(update));
|
|
388
379
|
}
|
|
389
380
|
else {
|
|
390
381
|
throw new WERR_errors_1.WERR_INVALID_PARAMETER('id', 'transactionId or array of transactionId');
|
|
@@ -414,12 +405,13 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
414
405
|
.update(this.validatePartialForUpdate(update));
|
|
415
406
|
}
|
|
416
407
|
setupQuery(table, args) {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
408
|
+
var _a;
|
|
409
|
+
const q = this.toDb(args.trx)(table);
|
|
410
|
+
if (args.partial != null && Object.keys(args.partial).length > 0)
|
|
411
|
+
void q.where(args.partial);
|
|
412
|
+
if (args.since != null)
|
|
413
|
+
void q.where('updated_at', '>=', this.validateDateForWhere(args.since));
|
|
414
|
+
if (args.orderDescending === true) {
|
|
423
415
|
let sortColumn = '';
|
|
424
416
|
switch (table) {
|
|
425
417
|
case 'certificates':
|
|
@@ -462,12 +454,12 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
462
454
|
break;
|
|
463
455
|
}
|
|
464
456
|
if (sortColumn !== '') {
|
|
465
|
-
q.orderBy(sortColumn, 'desc');
|
|
457
|
+
void q.orderBy(sortColumn, 'desc');
|
|
466
458
|
}
|
|
467
459
|
}
|
|
468
|
-
if (args.paged) {
|
|
469
|
-
q.limit(args.paged.limit);
|
|
470
|
-
q.offset(args.paged.offset
|
|
460
|
+
if (args.paged != null) {
|
|
461
|
+
void q.limit(args.paged.limit);
|
|
462
|
+
void q.offset((_a = args.paged.offset) !== null && _a !== void 0 ? _a : 0);
|
|
471
463
|
}
|
|
472
464
|
return q;
|
|
473
465
|
}
|
|
@@ -476,97 +468,105 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
476
468
|
}
|
|
477
469
|
findCertificatesQuery(args) {
|
|
478
470
|
const q = this.setupQuery('certificates', args);
|
|
479
|
-
if (args.certifiers && args.certifiers.length > 0)
|
|
480
|
-
q.whereIn('certifier', args.certifiers);
|
|
481
|
-
if (args.types && args.types.length > 0)
|
|
482
|
-
q.whereIn('type', args.types);
|
|
471
|
+
if ((args.certifiers != null) && args.certifiers.length > 0)
|
|
472
|
+
void q.whereIn('certifier', args.certifiers);
|
|
473
|
+
if ((args.types != null) && args.types.length > 0)
|
|
474
|
+
void q.whereIn('type', args.types);
|
|
483
475
|
return q;
|
|
484
476
|
}
|
|
485
477
|
findCommissionsQuery(args) {
|
|
486
|
-
if (args.partial.lockingScript)
|
|
487
|
-
throw new WERR_errors_1.WERR_INVALID_PARAMETER('partial.lockingScript',
|
|
478
|
+
if (args.partial.lockingScript != null) {
|
|
479
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('partial.lockingScript', 'undefined. Commissions may not be found by lockingScript value.');
|
|
480
|
+
}
|
|
488
481
|
return this.setupQuery('commissions', args);
|
|
489
482
|
}
|
|
490
483
|
findOutputBasketsQuery(args) {
|
|
491
484
|
return this.setupQuery('output_baskets', args);
|
|
492
485
|
}
|
|
493
486
|
findOutputsQuery(args, count) {
|
|
494
|
-
if (args.partial.lockingScript)
|
|
495
|
-
throw new WERR_errors_1.WERR_INVALID_PARAMETER('args.partial.lockingScript',
|
|
487
|
+
if (args.partial.lockingScript != null) {
|
|
488
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('args.partial.lockingScript', 'undefined. Outputs may not be found by lockingScript value.');
|
|
489
|
+
}
|
|
496
490
|
const q = this.setupQuery('outputs', args);
|
|
497
|
-
if (args.txStatus && args.txStatus.length > 0) {
|
|
498
|
-
q.whereRaw(`(select status from transactions where transactions.transactionId = outputs.transactionId) in (${args.txStatus.map(s =>
|
|
491
|
+
if ((args.txStatus != null) && args.txStatus.length > 0) {
|
|
492
|
+
void q.whereRaw(`(select status from transactions where transactions.transactionId = outputs.transactionId) in (${args.txStatus.map(s => "'" + s + "'").join(',')})`);
|
|
499
493
|
}
|
|
500
|
-
if (args.noScript &&
|
|
494
|
+
if ((args.noScript === true) && count !== true) {
|
|
501
495
|
const columns = tables_1.outputColumnsWithoutLockingScript.map(c => `outputs.${c}`);
|
|
502
|
-
q.select(columns);
|
|
496
|
+
void q.select(columns);
|
|
503
497
|
}
|
|
504
498
|
return q;
|
|
505
499
|
}
|
|
506
500
|
findOutputTagMapsQuery(args) {
|
|
507
501
|
const q = this.setupQuery('output_tags_map', args);
|
|
508
|
-
if (args.tagIds && args.tagIds.length > 0)
|
|
509
|
-
q.whereIn('outputTagId', args.tagIds);
|
|
502
|
+
if ((args.tagIds != null) && args.tagIds.length > 0)
|
|
503
|
+
void q.whereIn('outputTagId', args.tagIds);
|
|
510
504
|
return q;
|
|
511
505
|
}
|
|
512
506
|
findOutputTagsQuery(args) {
|
|
513
507
|
return this.setupQuery('output_tags', args);
|
|
514
508
|
}
|
|
515
509
|
findProvenTxReqsQuery(args) {
|
|
516
|
-
if (args.partial.rawTx)
|
|
517
|
-
throw new WERR_errors_1.WERR_INVALID_PARAMETER('args.partial.rawTx',
|
|
518
|
-
|
|
519
|
-
|
|
510
|
+
if (args.partial.rawTx != null) {
|
|
511
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('args.partial.rawTx', 'undefined. ProvenTxReqs may not be found by rawTx value.');
|
|
512
|
+
}
|
|
513
|
+
if (args.partial.inputBEEF != null) {
|
|
514
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('args.partial.inputBEEF', 'undefined. ProvenTxReqs may not be found by inputBEEF value.');
|
|
515
|
+
}
|
|
520
516
|
const q = this.setupQuery('proven_tx_reqs', args);
|
|
521
|
-
if (args.status && args.status.length > 0)
|
|
522
|
-
q.whereIn('status', args.status);
|
|
523
|
-
if (args.txids) {
|
|
517
|
+
if ((args.status != null) && args.status.length > 0)
|
|
518
|
+
void q.whereIn('status', args.status);
|
|
519
|
+
if (args.txids != null) {
|
|
524
520
|
const txids = args.txids.filter(txid => txid !== undefined);
|
|
525
521
|
if (txids.length > 0)
|
|
526
|
-
q.whereIn('txid', txids);
|
|
522
|
+
void q.whereIn('txid', txids);
|
|
527
523
|
}
|
|
528
524
|
return q;
|
|
529
525
|
}
|
|
530
526
|
findProvenTxsQuery(args) {
|
|
531
|
-
if (args.partial.rawTx)
|
|
532
|
-
throw new WERR_errors_1.WERR_INVALID_PARAMETER('args.partial.rawTx',
|
|
533
|
-
|
|
534
|
-
|
|
527
|
+
if (args.partial.rawTx != null) {
|
|
528
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('args.partial.rawTx', 'undefined. ProvenTxs may not be found by rawTx value.');
|
|
529
|
+
}
|
|
530
|
+
if (args.partial.merklePath != null) {
|
|
531
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('args.partial.merklePath', 'undefined. ProvenTxs may not be found by merklePath value.');
|
|
532
|
+
}
|
|
535
533
|
return this.setupQuery('proven_txs', args);
|
|
536
534
|
}
|
|
537
535
|
findStaleMerkleRootsQuery(args) {
|
|
538
|
-
|
|
539
|
-
q.where('height', '=', args.height);
|
|
540
|
-
q.where('merkleRoot', '!=', args.merkleRoot);
|
|
541
|
-
q.select('merkleRoot');
|
|
542
|
-
q.distinct('merkleRoot');
|
|
536
|
+
const q = this.toDb(args.trx)('proven_txs');
|
|
537
|
+
void q.where('height', '=', args.height);
|
|
538
|
+
void q.where('merkleRoot', '!=', args.merkleRoot);
|
|
539
|
+
void q.select('merkleRoot');
|
|
540
|
+
void q.distinct('merkleRoot');
|
|
543
541
|
return q;
|
|
544
542
|
}
|
|
545
543
|
findSyncStatesQuery(args) {
|
|
546
544
|
return this.setupQuery('sync_states', args);
|
|
547
545
|
}
|
|
548
546
|
findTransactionsQuery(args, count) {
|
|
549
|
-
if (args.partial.rawTx)
|
|
550
|
-
throw new WERR_errors_1.WERR_INVALID_PARAMETER('args.partial.rawTx',
|
|
551
|
-
|
|
552
|
-
|
|
547
|
+
if (args.partial.rawTx != null) {
|
|
548
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('args.partial.rawTx', 'undefined. Transactions may not be found by rawTx value.');
|
|
549
|
+
}
|
|
550
|
+
if (args.partial.inputBEEF != null) {
|
|
551
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('args.partial.inputBEEF', 'undefined. Transactions may not be found by inputBEEF value.');
|
|
552
|
+
}
|
|
553
553
|
const q = this.setupQuery('transactions', args);
|
|
554
|
-
if (args.status && args.status.length > 0)
|
|
555
|
-
q.whereIn('status', args.status);
|
|
556
|
-
if (args.from)
|
|
557
|
-
q.where('created_at', '>=', this.validateDateForWhere(args.from));
|
|
558
|
-
if (args.to)
|
|
559
|
-
q.where('created_at', '<', this.validateDateForWhere(args.to));
|
|
560
|
-
if (args.noRawTx &&
|
|
554
|
+
if ((args.status != null) && args.status.length > 0)
|
|
555
|
+
void q.whereIn('status', args.status);
|
|
556
|
+
if (args.from != null)
|
|
557
|
+
void q.where('created_at', '>=', this.validateDateForWhere(args.from));
|
|
558
|
+
if (args.to != null)
|
|
559
|
+
void q.where('created_at', '<', this.validateDateForWhere(args.to));
|
|
560
|
+
if ((args.noRawTx === true) && count !== true) {
|
|
561
561
|
const columns = tables_1.transactionColumnsWithoutRawTx.map(c => `transactions.${c}`);
|
|
562
|
-
q.select(columns);
|
|
562
|
+
void q.select(columns);
|
|
563
563
|
}
|
|
564
564
|
return q;
|
|
565
565
|
}
|
|
566
566
|
findTxLabelMapsQuery(args) {
|
|
567
567
|
const q = this.setupQuery('tx_labels_map', args);
|
|
568
|
-
if (args.labelIds && args.labelIds.length > 0)
|
|
569
|
-
q.whereIn('txLabelId', args.labelIds);
|
|
568
|
+
if ((args.labelIds != null) && args.labelIds.length > 0)
|
|
569
|
+
void q.whereIn('txLabelId', args.labelIds);
|
|
570
570
|
return q;
|
|
571
571
|
}
|
|
572
572
|
findTxLabelsQuery(args) {
|
|
@@ -579,19 +579,19 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
579
579
|
return this.setupQuery('monitor_events', args);
|
|
580
580
|
}
|
|
581
581
|
async findCertificatesAuth(auth, args) {
|
|
582
|
-
if (
|
|
582
|
+
if (auth.userId == null || (args.partial.userId != null && args.partial.userId !== 0 && args.partial.userId !== auth.userId))
|
|
583
583
|
throw new WERR_errors_1.WERR_UNAUTHORIZED();
|
|
584
584
|
args.partial.userId = auth.userId;
|
|
585
585
|
return await this.findCertificates(args);
|
|
586
586
|
}
|
|
587
587
|
async findOutputBasketsAuth(auth, args) {
|
|
588
|
-
if (
|
|
588
|
+
if (auth.userId == null || (args.partial.userId != null && args.partial.userId !== 0 && args.partial.userId !== auth.userId))
|
|
589
589
|
throw new WERR_errors_1.WERR_UNAUTHORIZED();
|
|
590
590
|
args.partial.userId = auth.userId;
|
|
591
591
|
return await this.findOutputBaskets(args);
|
|
592
592
|
}
|
|
593
593
|
async findOutputsAuth(auth, args) {
|
|
594
|
-
if (
|
|
594
|
+
if (auth.userId == null || (args.partial.userId != null && args.partial.userId !== 0 && args.partial.userId !== auth.userId))
|
|
595
595
|
throw new WERR_errors_1.WERR_UNAUTHORIZED();
|
|
596
596
|
args.partial.userId = auth.userId;
|
|
597
597
|
return await this.findOutputs(args);
|
|
@@ -603,7 +603,7 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
603
603
|
const q = this.findCertificatesQuery(args);
|
|
604
604
|
let r = await q;
|
|
605
605
|
r = this.validateEntities(r, undefined, ['isDeleted']);
|
|
606
|
-
if (args.includeFields) {
|
|
606
|
+
if (args.includeFields === true) {
|
|
607
607
|
for (const c of r) {
|
|
608
608
|
c.fields = this.validateEntities(await this.findCertificateFields({
|
|
609
609
|
partial: { certificateId: c.certificateId, userId: c.userId },
|
|
@@ -626,7 +626,7 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
626
626
|
async findOutputs(args) {
|
|
627
627
|
const q = this.findOutputsQuery(args);
|
|
628
628
|
const r = await q;
|
|
629
|
-
if (
|
|
629
|
+
if (args.noScript !== true) {
|
|
630
630
|
for (const o of r) {
|
|
631
631
|
await this.validateOutputScript(o, args.trx);
|
|
632
632
|
}
|
|
@@ -646,7 +646,7 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
646
646
|
async findProvenTxReqs(args) {
|
|
647
647
|
const q = this.findProvenTxReqsQuery(args);
|
|
648
648
|
const r = await q;
|
|
649
|
-
return this.validateEntities(r, undefined, ['notified']);
|
|
649
|
+
return this.validateEntities(r, undefined, ['notified', 'wasBroadcast']);
|
|
650
650
|
}
|
|
651
651
|
async findProvenTxs(args) {
|
|
652
652
|
const q = this.findProvenTxsQuery(args);
|
|
@@ -666,7 +666,7 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
666
666
|
async findTransactions(args) {
|
|
667
667
|
const q = this.findTransactionsQuery(args);
|
|
668
668
|
const r = await q;
|
|
669
|
-
if (
|
|
669
|
+
if (args.noRawTx !== true) {
|
|
670
670
|
for (const t of r) {
|
|
671
671
|
await this.validateRawTransaction(t, args.trx);
|
|
672
672
|
}
|
|
@@ -708,7 +708,7 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
708
708
|
return this.validateEntities(r, ['when'], undefined);
|
|
709
709
|
}
|
|
710
710
|
async getCount(q) {
|
|
711
|
-
q.count();
|
|
711
|
+
void q.count();
|
|
712
712
|
const r = await q;
|
|
713
713
|
return r[0]['count(*)'];
|
|
714
714
|
}
|
|
@@ -762,9 +762,9 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
762
762
|
await ((_a = this.knex) === null || _a === void 0 ? void 0 : _a.destroy());
|
|
763
763
|
}
|
|
764
764
|
async migrate(storageName, storageIdentityKey) {
|
|
765
|
-
var _a;
|
|
765
|
+
var _a, _b;
|
|
766
766
|
// Check if this is a SQLite database by looking at the Knex client config
|
|
767
|
-
const clientName = ((_a = this.knex.client.config) === null || _a === void 0 ? void 0 : _a.client)
|
|
767
|
+
const clientName = (_b = (_a = this.knex.client.config) === null || _a === void 0 ? void 0 : _a.client) !== null && _b !== void 0 ? _b : '';
|
|
768
768
|
const isSQLite = clientName.includes('sqlite');
|
|
769
769
|
// For SQLite, disable transactions during migrations and turn off foreign keys.
|
|
770
770
|
// PRAGMA foreign_keys is silently ignored inside transactions, so we must
|
|
@@ -786,11 +786,11 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
786
786
|
return version;
|
|
787
787
|
}
|
|
788
788
|
async dropAllData() {
|
|
789
|
-
var _a;
|
|
789
|
+
var _a, _b;
|
|
790
790
|
// Only using migrations to migrate down, don't need valid properties for settings table.
|
|
791
791
|
const migrationSource = new KnexMigrations_1.KnexMigrations('test', '', '', 1024);
|
|
792
792
|
// Check if this is a SQLite database by looking at the Knex client config
|
|
793
|
-
const clientName = ((_a = this.knex.client.config) === null || _a === void 0 ? void 0 : _a.client)
|
|
793
|
+
const clientName = (_b = (_a = this.knex.client.config) === null || _a === void 0 ? void 0 : _a.client) !== null && _b !== void 0 ? _b : '';
|
|
794
794
|
const isSQLite = clientName.includes('sqlite');
|
|
795
795
|
// For SQLite, disable transactions during migrations and turn off foreign keys.
|
|
796
796
|
// PRAGMA foreign_keys is silently ignored inside transactions, so we must
|
|
@@ -809,12 +809,15 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
809
809
|
for (let i = 0; i < count; i++) {
|
|
810
810
|
try {
|
|
811
811
|
const r = await this.knex.migrate.down(config);
|
|
812
|
-
if (
|
|
813
|
-
console.error(
|
|
812
|
+
if (r == null) {
|
|
813
|
+
console.error('Migration returned falsy result await this.knex.migrate.down(config)');
|
|
814
814
|
break;
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
|
-
catch (
|
|
817
|
+
catch (migrationError) {
|
|
818
|
+
// migrate.down throws when there are no more migrations to roll back — this is
|
|
819
|
+
// the expected terminal condition, so we stop iterating rather than propagating.
|
|
820
|
+
console.debug('migrate.down stopped (no more migrations or error):', migrationError);
|
|
818
821
|
break;
|
|
819
822
|
}
|
|
820
823
|
}
|
|
@@ -824,7 +827,7 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
824
827
|
}
|
|
825
828
|
}
|
|
826
829
|
async transaction(scope, trx) {
|
|
827
|
-
if (trx)
|
|
830
|
+
if (trx != null)
|
|
828
831
|
return await scope(trx);
|
|
829
832
|
return await this.knex.transaction(async (knextrx) => {
|
|
830
833
|
const trx = knextrx;
|
|
@@ -835,19 +838,20 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
835
838
|
* Convert the standard optional `TrxToken` parameter into either a direct knex database instance,
|
|
836
839
|
* or a Knex.Transaction as appropriate.
|
|
837
840
|
*/
|
|
841
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
838
842
|
toDb(trx) {
|
|
839
843
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
840
|
-
const db =
|
|
844
|
+
const db = (trx == null) ? this.knex : trx;
|
|
841
845
|
this.whenLastAccess = new Date();
|
|
842
846
|
return db;
|
|
843
847
|
}
|
|
844
848
|
async validateRawTransaction(t, trx) {
|
|
845
849
|
// if there is no txid or there is a rawTransaction return what we have.
|
|
846
|
-
if (t.rawTx ||
|
|
850
|
+
if (t.rawTx != null || t.txid == null || t.txid === '')
|
|
847
851
|
return;
|
|
848
852
|
// rawTransaction is missing, see if we moved it ...
|
|
849
853
|
const rawTx = await this.getRawTxOfKnownValidTransaction(t.txid, undefined, undefined, trx);
|
|
850
|
-
if (
|
|
854
|
+
if (rawTx == null)
|
|
851
855
|
return;
|
|
852
856
|
t.rawTx = rawTx;
|
|
853
857
|
}
|
|
@@ -860,9 +864,8 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
860
864
|
* @param trx
|
|
861
865
|
*/
|
|
862
866
|
async verifyReadyForDatabaseAccess(trx) {
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
}
|
|
867
|
+
var _a;
|
|
868
|
+
(_a = this._settings) !== null && _a !== void 0 ? _a : (this._settings = await this.readSettings());
|
|
866
869
|
// Always run the PRAGMA for SQLite to ensure foreign key constraints are enabled.
|
|
867
870
|
// This is necessary because PRAGMA foreign_keys is a per-connection setting,
|
|
868
871
|
// and connection pools may create new connections that don't have it set.
|
|
@@ -873,43 +876,59 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
873
876
|
this._verifiedReadyForDatabaseAccess = true;
|
|
874
877
|
return this._settings.dbtype;
|
|
875
878
|
}
|
|
879
|
+
/** Convert every number-array value to a Buffer and every undefined to null on an arbitrary object. */
|
|
880
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
881
|
+
serialiseForKnex(v) {
|
|
882
|
+
for (const key of Object.keys(v)) {
|
|
883
|
+
const val = v[key];
|
|
884
|
+
if (Array.isArray(val) && (val.length === 0 || typeof val[0] === 'number')) {
|
|
885
|
+
v[key] = Buffer.from(val);
|
|
886
|
+
}
|
|
887
|
+
else if (val === undefined) {
|
|
888
|
+
v[key] = null;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
/** Apply optional date-field coercion list in-place. */
|
|
893
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
894
|
+
coerceDateFields(v, dateFields) {
|
|
895
|
+
if (dateFields == null)
|
|
896
|
+
return;
|
|
897
|
+
for (const df of dateFields) {
|
|
898
|
+
if (v[df] != null)
|
|
899
|
+
v[df] = this.validateOptionalEntityDate(v[df]);
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
/** Apply optional boolean-field coercion list in-place. */
|
|
903
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
904
|
+
coerceBooleanFields(v, booleanFields) {
|
|
905
|
+
if (booleanFields == null)
|
|
906
|
+
return;
|
|
907
|
+
for (const df of booleanFields) {
|
|
908
|
+
if (v[df] !== undefined)
|
|
909
|
+
v[df] = v[df] != null && v[df] !== false ? 1 : 0;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
876
912
|
/**
|
|
877
913
|
* Helper to force uniform behavior across database engines.
|
|
878
914
|
* Use to process the update template for entities being updated.
|
|
879
915
|
*/
|
|
880
916
|
validatePartialForUpdate(update, dateFields, booleanFields) {
|
|
881
|
-
if (
|
|
917
|
+
if (this.dbtype == null)
|
|
882
918
|
throw new WERR_errors_1.WERR_INTERNAL('must call verifyReadyForDatabaseAccess first');
|
|
919
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
883
920
|
const v = update;
|
|
884
|
-
if (v.created_at)
|
|
921
|
+
if (v.created_at != null)
|
|
885
922
|
v.created_at = this.validateEntityDate(v.created_at);
|
|
886
|
-
if (v.updated_at)
|
|
923
|
+
if (v.updated_at != null)
|
|
887
924
|
v.updated_at = this.validateEntityDate(v.updated_at);
|
|
888
|
-
if (
|
|
925
|
+
if (v.created_at == null)
|
|
889
926
|
delete v.created_at;
|
|
890
|
-
if (
|
|
927
|
+
if (v.updated_at == null)
|
|
891
928
|
v.updated_at = this.validateEntityDate(new Date());
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
v[df] = this.validateOptionalEntityDate(v[df]);
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
if (booleanFields) {
|
|
899
|
-
for (const df of booleanFields) {
|
|
900
|
-
if (update[df] !== undefined)
|
|
901
|
-
update[df] = !!update[df] ? 1 : 0;
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
for (const key of Object.keys(v)) {
|
|
905
|
-
const val = v[key];
|
|
906
|
-
if (Array.isArray(val) && (val.length === 0 || typeof val[0] === 'number')) {
|
|
907
|
-
v[key] = Buffer.from(val);
|
|
908
|
-
}
|
|
909
|
-
else if (val === undefined) {
|
|
910
|
-
v[key] = null;
|
|
911
|
-
}
|
|
912
|
-
}
|
|
929
|
+
this.coerceDateFields(v, dateFields);
|
|
930
|
+
this.coerceBooleanFields(update, booleanFields);
|
|
931
|
+
this.serialiseForKnex(v);
|
|
913
932
|
this.isDirty = true;
|
|
914
933
|
return v;
|
|
915
934
|
}
|
|
@@ -917,36 +936,22 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
917
936
|
* Helper to force uniform behavior across database engines.
|
|
918
937
|
* Use to process new entities being inserted into the database.
|
|
919
938
|
*/
|
|
920
|
-
async validateEntityForInsert(entity, trx, dateFields, booleanFields
|
|
939
|
+
async validateEntityForInsert(entity, trx, dateFields, booleanFields
|
|
940
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
941
|
+
) {
|
|
942
|
+
var _a, _b;
|
|
921
943
|
await this.verifyReadyForDatabaseAccess(trx);
|
|
944
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
922
945
|
const v = { ...entity };
|
|
923
|
-
v.created_at = this.validateOptionalEntityDate(v.created_at, true);
|
|
924
|
-
v.updated_at = this.validateOptionalEntityDate(v.updated_at, true);
|
|
925
|
-
if (
|
|
946
|
+
v.created_at = (_a = this.validateOptionalEntityDate(v.created_at, true)) !== null && _a !== void 0 ? _a : new Date();
|
|
947
|
+
v.updated_at = (_b = this.validateOptionalEntityDate(v.updated_at, true)) !== null && _b !== void 0 ? _b : new Date();
|
|
948
|
+
if (v.created_at == null)
|
|
926
949
|
delete v.created_at;
|
|
927
|
-
if (
|
|
950
|
+
if (v.updated_at == null)
|
|
928
951
|
delete v.updated_at;
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
v[df] = this.validateOptionalEntityDate(v[df]);
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
if (booleanFields) {
|
|
936
|
-
for (const df of booleanFields) {
|
|
937
|
-
if (entity[df] !== undefined)
|
|
938
|
-
entity[df] = !!entity[df] ? 1 : 0;
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
for (const key of Object.keys(v)) {
|
|
942
|
-
const val = v[key];
|
|
943
|
-
if (Array.isArray(val) && (val.length === 0 || typeof val[0] === 'number')) {
|
|
944
|
-
v[key] = Buffer.from(val);
|
|
945
|
-
}
|
|
946
|
-
else if (val === undefined) {
|
|
947
|
-
v[key] = null;
|
|
948
|
-
}
|
|
949
|
-
}
|
|
952
|
+
this.coerceDateFields(v, dateFields);
|
|
953
|
+
this.coerceBooleanFields(entity, booleanFields);
|
|
954
|
+
this.serialiseForKnex(v);
|
|
950
955
|
this.isDirty = true;
|
|
951
956
|
return v;
|
|
952
957
|
}
|
|
@@ -1020,11 +1025,11 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
1020
1025
|
.whereIn('vout', vouts)
|
|
1021
1026
|
.select('*');
|
|
1022
1027
|
// Only return requested outpoints, vouts of one txid may end up matching another txid that was not requested.
|
|
1023
|
-
const filteredRows = rows.filter(r => outpointSet.has(`${r.txid}.${r.vout}`));
|
|
1028
|
+
const filteredRows = rows.filter(r => outpointSet.has(`${String(r.txid)}.${String(r.vout)}`));
|
|
1024
1029
|
const vrows = this.validateEntities(filteredRows, undefined, ['spendable', 'change']);
|
|
1025
1030
|
for (const row of vrows) {
|
|
1026
1031
|
await this.validateOutputScript(row, trx);
|
|
1027
|
-
byOutpoint[`${row.txid}.${row.vout}`] = row;
|
|
1032
|
+
byOutpoint[`${String(row.txid)}.${String(row.vout)}`] = row;
|
|
1028
1033
|
}
|
|
1029
1034
|
return byOutpoint;
|
|
1030
1035
|
}
|
|
@@ -1043,7 +1048,7 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
1043
1048
|
byName[basket.name] = basket;
|
|
1044
1049
|
}
|
|
1045
1050
|
for (const name of uniqueNames) {
|
|
1046
|
-
if (
|
|
1051
|
+
if (byName[name] == null)
|
|
1047
1052
|
byName[name] = await this.findOrInsertOutputBasket(userId, name, trx);
|
|
1048
1053
|
}
|
|
1049
1054
|
return byName;
|
|
@@ -1063,7 +1068,7 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
1063
1068
|
byTag[outputTag.tag] = outputTag;
|
|
1064
1069
|
}
|
|
1065
1070
|
for (const tag of uniqueTags) {
|
|
1066
|
-
if (
|
|
1071
|
+
if (byTag[tag] == null)
|
|
1067
1072
|
byTag[tag] = await this.findOrInsertOutputTag(userId, tag, trx);
|
|
1068
1073
|
}
|
|
1069
1074
|
return byTag;
|
|
@@ -1078,7 +1083,8 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
1078
1083
|
.whereIn('t.status', status)
|
|
1079
1084
|
.sum({ totalSatoshis: 'o.satoshis' })
|
|
1080
1085
|
.first();
|
|
1081
|
-
|
|
1086
|
+
const total = (row != null) ? row.totalSatoshis : undefined;
|
|
1087
|
+
return Number(total !== null && total !== void 0 ? total : 0);
|
|
1082
1088
|
}
|
|
1083
1089
|
/**
|
|
1084
1090
|
* Finds closest matching available change output to use as input for new transaction.
|
|
@@ -1101,21 +1107,17 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
1101
1107
|
if (exactSatoshis !== undefined) {
|
|
1102
1108
|
output = await baseQuery().where('o.satoshis', exactSatoshis).orderBy('o.outputId', 'asc').first();
|
|
1103
1109
|
}
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
.orderBy('o.outputId', 'desc')
|
|
1116
|
-
.first();
|
|
1117
|
-
}
|
|
1118
|
-
if (!output)
|
|
1110
|
+
output !== null && output !== void 0 ? output : (output = await baseQuery()
|
|
1111
|
+
.where('o.satoshis', '>=', targetSatoshis)
|
|
1112
|
+
.orderBy('o.satoshis', 'asc')
|
|
1113
|
+
.orderBy('o.outputId', 'asc')
|
|
1114
|
+
.first());
|
|
1115
|
+
output !== null && output !== void 0 ? output : (output = await baseQuery()
|
|
1116
|
+
.where('o.satoshis', '<', targetSatoshis)
|
|
1117
|
+
.orderBy('o.satoshis', 'desc')
|
|
1118
|
+
.orderBy('o.outputId', 'desc')
|
|
1119
|
+
.first());
|
|
1120
|
+
if (output == null)
|
|
1119
1121
|
return undefined;
|
|
1120
1122
|
await this.updateOutput(output.outputId, {
|
|
1121
1123
|
spendable: false,
|
|
@@ -1130,6 +1132,23 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
1130
1132
|
});
|
|
1131
1133
|
return r;
|
|
1132
1134
|
}
|
|
1135
|
+
/** Convert null→undefined and Buffer→number[] on a retrieved entity in-place. */
|
|
1136
|
+
deserialiseFromKnex(entity) {
|
|
1137
|
+
for (const key of Object.keys(entity)) {
|
|
1138
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1139
|
+
const val = entity[key];
|
|
1140
|
+
if (val === null) {
|
|
1141
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1142
|
+
;
|
|
1143
|
+
entity[key] = undefined;
|
|
1144
|
+
}
|
|
1145
|
+
else if (Buffer.isBuffer(val)) {
|
|
1146
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1147
|
+
;
|
|
1148
|
+
entity[key] = Array.from(val);
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1133
1152
|
/**
|
|
1134
1153
|
* Helper to force uniform behavior across database engines.
|
|
1135
1154
|
* Use to process all individual records with time stamps retreived from database.
|
|
@@ -1137,27 +1156,21 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
1137
1156
|
validateEntity(entity, dateFields, booleanFields) {
|
|
1138
1157
|
entity.created_at = this.validateDate(entity.created_at);
|
|
1139
1158
|
entity.updated_at = this.validateDate(entity.updated_at);
|
|
1140
|
-
if (dateFields) {
|
|
1159
|
+
if (dateFields != null) {
|
|
1141
1160
|
for (const df of dateFields) {
|
|
1142
|
-
|
|
1161
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1162
|
+
if (entity[df] != null)
|
|
1143
1163
|
entity[df] = this.validateDate(entity[df]);
|
|
1144
1164
|
}
|
|
1145
1165
|
}
|
|
1146
|
-
if (booleanFields) {
|
|
1166
|
+
if (booleanFields != null) {
|
|
1147
1167
|
for (const df of booleanFields) {
|
|
1168
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1148
1169
|
if (entity[df] !== undefined)
|
|
1149
|
-
entity[df] =
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
for (const key of Object.keys(entity)) {
|
|
1153
|
-
const val = entity[key];
|
|
1154
|
-
if (val === null) {
|
|
1155
|
-
entity[key] = undefined;
|
|
1156
|
-
}
|
|
1157
|
-
else if (Buffer.isBuffer(val)) {
|
|
1158
|
-
entity[key] = Array.from(val);
|
|
1170
|
+
entity[df] = entity[df] !== 0 && entity[df] != null && entity[df] !== false;
|
|
1159
1171
|
}
|
|
1160
1172
|
}
|
|
1173
|
+
this.deserialiseFromKnex(entity);
|
|
1161
1174
|
return entity;
|
|
1162
1175
|
}
|
|
1163
1176
|
/**
|
|
@@ -1179,81 +1192,81 @@ class StorageKnex extends StorageProvider_1.StorageProvider {
|
|
|
1179
1192
|
orderDescending: true,
|
|
1180
1193
|
paged: { limit: 1 }
|
|
1181
1194
|
}));
|
|
1182
|
-
const monitorStats = monitorEvent ? JSON.parse(monitorEvent.details) : undefined;
|
|
1195
|
+
const monitorStats = (monitorEvent != null) ? JSON.parse(monitorEvent.details) : undefined;
|
|
1183
1196
|
const servicesStats = this.getServices().getServicesCallHistory(true);
|
|
1184
|
-
const
|
|
1185
|
-
const
|
|
1186
|
-
const
|
|
1197
|
+
const oneDayAgo = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
|
|
1198
|
+
const oneWeekAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString();
|
|
1199
|
+
const oneMonthAgo = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString();
|
|
1187
1200
|
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(`
|
|
1188
1201
|
select
|
|
1189
|
-
(select count(*) from users where created_at > '${
|
|
1190
|
-
(select count(*) from users where created_at > '${
|
|
1191
|
-
(select count(*) from users where created_at > '${
|
|
1192
|
-
|
|
1193
|
-
(select count(*) from transactions where created_at > '${
|
|
1194
|
-
(select count(*) from transactions where created_at > '${
|
|
1195
|
-
(select count(*) from transactions where created_at > '${
|
|
1196
|
-
|
|
1197
|
-
(select count(*) from transactions where status = 'completed' and created_at > '${
|
|
1198
|
-
(select count(*) from transactions where status = 'completed' and created_at > '${
|
|
1199
|
-
(select count(*) from transactions where status = 'completed' and created_at > '${
|
|
1200
|
-
|
|
1201
|
-
(select count(*) from transactions where status = 'failed' and not txid is null and created_at > '${
|
|
1202
|
-
(select count(*) from transactions where status = 'failed' and not txid is null and created_at > '${
|
|
1203
|
-
(select count(*) from transactions where status = 'failed' and not txid is null and created_at > '${
|
|
1204
|
-
|
|
1205
|
-
(select count(*) from transactions where status = 'failed' and txid is null and created_at > '${
|
|
1206
|
-
(select count(*) from transactions where status = 'failed' and txid is null and created_at > '${
|
|
1207
|
-
(select count(*) from transactions where status = 'failed' and txid is null and created_at > '${
|
|
1208
|
-
|
|
1209
|
-
(select count(*) from transactions where status = 'unprocessed' and created_at > '${
|
|
1210
|
-
(select count(*) from transactions where status = 'unprocessed' and created_at > '${
|
|
1211
|
-
(select count(*) from transactions where status = 'unprocessed' and created_at > '${
|
|
1212
|
-
|
|
1213
|
-
(select count(*) from transactions where status = 'sending' and created_at > '${
|
|
1214
|
-
(select count(*) from transactions where status = 'sending' and created_at > '${
|
|
1215
|
-
(select count(*) from transactions where status = 'sending' and created_at > '${
|
|
1216
|
-
|
|
1217
|
-
(select count(*) from transactions where status = 'unproven' and created_at > '${
|
|
1218
|
-
(select count(*) from transactions where status = 'unproven' and created_at > '${
|
|
1219
|
-
(select count(*) from transactions where status = 'unproven' and created_at > '${
|
|
1220
|
-
|
|
1221
|
-
(select count(*) from transactions where status = 'unsigned' and created_at > '${
|
|
1222
|
-
(select count(*) from transactions where status = 'unsigned' and created_at > '${
|
|
1223
|
-
(select count(*) from transactions where status = 'unsigned' and created_at > '${
|
|
1224
|
-
|
|
1225
|
-
(select count(*) from transactions where status = 'nosend' and created_at > '${
|
|
1226
|
-
(select count(*) from transactions where status = 'nosend' and created_at > '${
|
|
1227
|
-
(select count(*) from transactions where status = 'nosend' and created_at > '${
|
|
1228
|
-
|
|
1229
|
-
(select count(*) from transactions where status = 'nonfinal' and created_at > '${
|
|
1230
|
-
(select count(*) from transactions where status = 'nonfinal' and created_at > '${
|
|
1231
|
-
(select count(*) from transactions where status = 'nonfinal' and created_at > '${
|
|
1232
|
-
|
|
1233
|
-
(select count(*) from transactions where status = 'unfail' and created_at > '${
|
|
1234
|
-
(select count(*) from transactions where status = 'unfail' and created_at > '${
|
|
1235
|
-
(select count(*) from transactions where status = 'unfail' and created_at > '${
|
|
1236
|
-
|
|
1237
|
-
(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 > '${
|
|
1238
|
-
(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 > '${
|
|
1239
|
-
(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 > '${
|
|
1240
|
-
|
|
1241
|
-
(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 > '${
|
|
1242
|
-
(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 > '${
|
|
1243
|
-
(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 > '${
|
|
1244
|
-
|
|
1245
|
-
(select count(*) from output_baskets where created_at > '${
|
|
1246
|
-
(select count(*) from output_baskets where created_at > '${
|
|
1247
|
-
(select count(*) from output_baskets where created_at > '${
|
|
1248
|
-
|
|
1249
|
-
(select count(*) from tx_labels where created_at > '${
|
|
1250
|
-
(select count(*) from tx_labels where created_at > '${
|
|
1251
|
-
(select count(*) from tx_labels where created_at > '${
|
|
1252
|
-
|
|
1253
|
-
(select count(*) from output_tags where created_at > '${
|
|
1254
|
-
(select count(*) from output_tags where created_at > '${
|
|
1255
|
-
(select count(*) from output_tags where created_at > '${
|
|
1256
|
-
|
|
1202
|
+
(select count(*) from users where created_at > '${oneDayAgo}') as usersDay,
|
|
1203
|
+
(select count(*) from users where created_at > '${oneWeekAgo}') as usersWeek,
|
|
1204
|
+
(select count(*) from users where created_at > '${oneMonthAgo}') as usersMonth,
|
|
1205
|
+
(select count(*) from users) as usersTotal,
|
|
1206
|
+
(select count(*) from transactions where created_at > '${oneDayAgo}') as transactionsDay,
|
|
1207
|
+
(select count(*) from transactions where created_at > '${oneWeekAgo}') as transactionsWeek,
|
|
1208
|
+
(select count(*) from transactions where created_at > '${oneMonthAgo}') as transactionsMonth,
|
|
1209
|
+
(select count(*) from transactions) as transactionsTotal,
|
|
1210
|
+
(select count(*) from transactions where status = 'completed' and created_at > '${oneDayAgo}') as txCompletedDay,
|
|
1211
|
+
(select count(*) from transactions where status = 'completed' and created_at > '${oneWeekAgo}') as txCompletedWeek,
|
|
1212
|
+
(select count(*) from transactions where status = 'completed' and created_at > '${oneMonthAgo}') as txCompletedMonth,
|
|
1213
|
+
(select count(*) from transactions where status = 'completed') as txCompletedTotal,
|
|
1214
|
+
(select count(*) from transactions where status = 'failed' and not txid is null and created_at > '${oneDayAgo}') as txFailedDay,
|
|
1215
|
+
(select count(*) from transactions where status = 'failed' and not txid is null and created_at > '${oneWeekAgo}') as txFailedWeek,
|
|
1216
|
+
(select count(*) from transactions where status = 'failed' and not txid is null and created_at > '${oneMonthAgo}') as txFailedMonth,
|
|
1217
|
+
(select count(*) from transactions where status = 'failed' and not txid is null) as txFailedTotal,
|
|
1218
|
+
(select count(*) from transactions where status = 'failed' and txid is null and created_at > '${oneDayAgo}') as txAbandonedDay,
|
|
1219
|
+
(select count(*) from transactions where status = 'failed' and txid is null and created_at > '${oneWeekAgo}') as txAbandonedWeek,
|
|
1220
|
+
(select count(*) from transactions where status = 'failed' and txid is null and created_at > '${oneMonthAgo}') as txAbandonedMonth,
|
|
1221
|
+
(select count(*) from transactions where status = 'failed' and txid is null) as txAbandonedTotal,
|
|
1222
|
+
(select count(*) from transactions where status = 'unprocessed' and created_at > '${oneDayAgo}') as txUnprocessedDay,
|
|
1223
|
+
(select count(*) from transactions where status = 'unprocessed' and created_at > '${oneWeekAgo}') as txUnprocessedWeek,
|
|
1224
|
+
(select count(*) from transactions where status = 'unprocessed' and created_at > '${oneMonthAgo}') as txUnprocessedMonth,
|
|
1225
|
+
(select count(*) from transactions where status = 'unprocessed') as txUnprocessedTotal,
|
|
1226
|
+
(select count(*) from transactions where status = 'sending' and created_at > '${oneDayAgo}') as txSendingDay,
|
|
1227
|
+
(select count(*) from transactions where status = 'sending' and created_at > '${oneWeekAgo}') as txSendingWeek,
|
|
1228
|
+
(select count(*) from transactions where status = 'sending' and created_at > '${oneMonthAgo}') as txSendingMonth,
|
|
1229
|
+
(select count(*) from transactions where status = 'sending') as txSendingTotal,
|
|
1230
|
+
(select count(*) from transactions where status = 'unproven' and created_at > '${oneDayAgo}') as txUnprovenDay,
|
|
1231
|
+
(select count(*) from transactions where status = 'unproven' and created_at > '${oneWeekAgo}') as txUnprovenWeek,
|
|
1232
|
+
(select count(*) from transactions where status = 'unproven' and created_at > '${oneMonthAgo}') as txUnprovenMonth,
|
|
1233
|
+
(select count(*) from transactions where status = 'unproven') as txUnprovenTotal,
|
|
1234
|
+
(select count(*) from transactions where status = 'unsigned' and created_at > '${oneDayAgo}') as txUnsignedDay,
|
|
1235
|
+
(select count(*) from transactions where status = 'unsigned' and created_at > '${oneWeekAgo}') as txUnsignedWeek,
|
|
1236
|
+
(select count(*) from transactions where status = 'unsigned' and created_at > '${oneMonthAgo}') as txUnsignedMonth,
|
|
1237
|
+
(select count(*) from transactions where status = 'unsigned') as txUnsignedTotal,
|
|
1238
|
+
(select count(*) from transactions where status = 'nosend' and created_at > '${oneDayAgo}') as txNosendDay,
|
|
1239
|
+
(select count(*) from transactions where status = 'nosend' and created_at > '${oneWeekAgo}') as txNosendWeek,
|
|
1240
|
+
(select count(*) from transactions where status = 'nosend' and created_at > '${oneMonthAgo}') as txNosendMonth,
|
|
1241
|
+
(select count(*) from transactions where status = 'nosend') as txNosendTotal,
|
|
1242
|
+
(select count(*) from transactions where status = 'nonfinal' and created_at > '${oneDayAgo}') as txNonfinalDay,
|
|
1243
|
+
(select count(*) from transactions where status = 'nonfinal' and created_at > '${oneWeekAgo}') as txNonfinalWeek,
|
|
1244
|
+
(select count(*) from transactions where status = 'nonfinal' and created_at > '${oneMonthAgo}') as txNonfinalMonth,
|
|
1245
|
+
(select count(*) from transactions where status = 'nonfinal') as txNonfinalTotal,
|
|
1246
|
+
(select count(*) from transactions where status = 'unfail' and created_at > '${oneDayAgo}') as txUnfailDay,
|
|
1247
|
+
(select count(*) from transactions where status = 'unfail' and created_at > '${oneWeekAgo}') as txUnfailWeek,
|
|
1248
|
+
(select count(*) from transactions where status = 'unfail' and created_at > '${oneMonthAgo}') as txUnfailMonth,
|
|
1249
|
+
(select count(*) from transactions where status = 'unfail') as txUnfailTotal,
|
|
1250
|
+
(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,
|
|
1251
|
+
(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,
|
|
1252
|
+
(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,
|
|
1253
|
+
(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,
|
|
1254
|
+
(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,
|
|
1255
|
+
(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,
|
|
1256
|
+
(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,
|
|
1257
|
+
(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,
|
|
1258
|
+
(select count(*) from output_baskets where created_at > '${oneDayAgo}') as basketsDay,
|
|
1259
|
+
(select count(*) from output_baskets where created_at > '${oneWeekAgo}') as basketsWeek,
|
|
1260
|
+
(select count(*) from output_baskets where created_at > '${oneMonthAgo}') as basketsMonth,
|
|
1261
|
+
(select count(*) from output_baskets) as basketsTotal,
|
|
1262
|
+
(select count(*) from tx_labels where created_at > '${oneDayAgo}') as labelsDay,
|
|
1263
|
+
(select count(*) from tx_labels where created_at > '${oneWeekAgo}') as labelsWeek,
|
|
1264
|
+
(select count(*) from tx_labels where created_at > '${oneMonthAgo}') as labelsMonth,
|
|
1265
|
+
(select count(*) from tx_labels) as labelsTotal,
|
|
1266
|
+
(select count(*) from output_tags where created_at > '${oneDayAgo}') as tagsDay,
|
|
1267
|
+
(select count(*) from output_tags where created_at > '${oneWeekAgo}') as tagsWeek,
|
|
1268
|
+
(select count(*) from output_tags where created_at > '${oneMonthAgo}') as tagsMonth,
|
|
1269
|
+
(select count(*) from output_tags) as tagsTotal
|
|
1257
1270
|
`);
|
|
1258
1271
|
const r = {
|
|
1259
1272
|
monitorStats,
|