@bsv/wallet-toolbox 2.1.25 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/CREATEACTION_BLOCKERS.md +391 -0
- package/docs/CUTOVER_RUNBOOK.md +95 -0
- package/docs/REQUIREMENTS_COMPLIANCE.md +157 -0
- package/docs/ROLLOUT_PLAN.md +273 -0
- package/docs/SESSION_HANDOFF.md +298 -0
- package/docs/STORAGE_METHOD_WIRING.md +176 -0
- package/docs/client.md +3765 -1325
- package/docs/monitor.md +255 -33
- package/docs/services.md +304 -280
- package/docs/setup.md +24 -24
- package/docs/storage.md +2783 -251
- package/docs/v3-upgrade/index.html +911 -0
- package/docs/wallet.md +4956 -9455
- package/out/src/Wallet.d.ts.map +1 -1
- package/out/src/Wallet.js.map +1 -1
- package/out/src/WalletLogger.d.ts.map +1 -1
- package/out/src/WalletLogger.js.map +1 -1
- package/out/src/__tests/CWIStyleWalletManager.test.js.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.d.ts.map +1 -1
- package/out/src/__tests/WalletPermissionsManager.fixtures.js.map +1 -1
- package/out/src/entropy/EntropyCollector.d.ts.map +1 -1
- package/out/src/entropy/EntropyCollector.js.map +1 -1
- package/out/src/monitor/LeasedMonitorTask.d.ts +43 -0
- package/out/src/monitor/LeasedMonitorTask.d.ts.map +1 -0
- package/out/src/monitor/LeasedMonitorTask.js +89 -0
- package/out/src/monitor/LeasedMonitorTask.js.map +1 -0
- package/out/src/monitor/Monitor.d.ts +7 -0
- package/out/src/monitor/Monitor.d.ts.map +1 -1
- package/out/src/monitor/Monitor.js +7 -0
- 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.map +1 -1
- package/out/src/monitor/V7LeasedTask.d.ts +43 -0
- package/out/src/monitor/V7LeasedTask.d.ts.map +1 -0
- package/out/src/monitor/V7LeasedTask.js +89 -0
- package/out/src/monitor/V7LeasedTask.js.map +1 -0
- package/out/src/monitor/index.all.d.ts +1 -0
- package/out/src/monitor/index.all.d.ts.map +1 -1
- package/out/src/monitor/index.all.js +1 -0
- package/out/src/monitor/index.all.js.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts +2 -0
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.js +55 -0
- package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -1
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts +59 -59
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/sdk/types.d.ts +32 -0
- package/out/src/sdk/types.d.ts.map +1 -1
- package/out/src/sdk/types.js +50 -1
- package/out/src/sdk/types.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.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.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createIdbChaintracks.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createIdbChaintracks.js.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/createNoDbChaintracks.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.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/ChaintracksFs.js.map +1 -1
- 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/SingleWriterMultiReaderLock.test.js.map +1 -1
- package/out/src/storage/StorageIdb.d.ts.map +1 -1
- package/out/src/storage/StorageIdb.js +10 -5
- package/out/src/storage/StorageIdb.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts +133 -3
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +691 -94
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts +114 -1
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +164 -4
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/idbHelpers.d.ts +5 -0
- package/out/src/storage/idbHelpers.d.ts.map +1 -1
- package/out/src/storage/idbHelpers.js +42 -0
- package/out/src/storage/idbHelpers.js.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js +116 -4
- 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 +22 -5
- package/out/src/storage/methods/createAction.js.map +1 -1
- package/out/src/storage/methods/internalizeAction.d.ts.map +1 -1
- package/out/src/storage/methods/internalizeAction.js +172 -5
- package/out/src/storage/methods/internalizeAction.js.map +1 -1
- package/out/src/storage/methods/listActionsKnex.d.ts +49 -0
- package/out/src/storage/methods/listActionsKnex.d.ts.map +1 -1
- package/out/src/storage/methods/listActionsKnex.js +179 -69
- package/out/src/storage/methods/listActionsKnex.js.map +1 -1
- package/out/src/storage/methods/listOutputsKnex.d.ts.map +1 -1
- package/out/src/storage/methods/listOutputsKnex.js +51 -4
- package/out/src/storage/methods/listOutputsKnex.js.map +1 -1
- package/out/src/storage/methods/processAction.d.ts.map +1 -1
- package/out/src/storage/methods/processAction.js +82 -14
- package/out/src/storage/methods/processAction.js.map +1 -1
- package/out/src/storage/methods/purgeData.d.ts.map +1 -1
- package/out/src/storage/methods/purgeData.js +22 -14
- package/out/src/storage/methods/purgeData.js.map +1 -1
- package/out/src/storage/methods/reviewStatus.d.ts.map +1 -1
- package/out/src/storage/methods/reviewStatus.js +18 -9
- package/out/src/storage/methods/reviewStatus.js.map +1 -1
- package/out/src/storage/schema/KnexMigrations.d.ts.map +1 -1
- package/out/src/storage/schema/KnexMigrations.js +134 -0
- package/out/src/storage/schema/KnexMigrations.js.map +1 -1
- package/out/src/storage/schema/StorageIdbSchema.d.ts +43 -2
- package/out/src/storage/schema/StorageIdbSchema.d.ts.map +1 -1
- package/out/src/storage/schema/__tests/backfill.runner.test.d.ts +2 -0
- package/out/src/storage/schema/__tests/backfill.runner.test.d.ts.map +1 -0
- package/out/src/storage/schema/__tests/backfill.runner.test.js +148 -0
- package/out/src/storage/schema/__tests/backfill.runner.test.js.map +1 -0
- package/out/src/storage/schema/__tests/backfill.test.d.ts +2 -0
- package/out/src/storage/schema/__tests/backfill.test.d.ts.map +1 -0
- package/out/src/storage/schema/__tests/backfill.test.js +96 -0
- package/out/src/storage/schema/__tests/backfill.test.js.map +1 -0
- package/out/src/storage/schema/__tests/processingFsm.test.d.ts +2 -0
- package/out/src/storage/schema/__tests/processingFsm.test.d.ts.map +1 -0
- package/out/src/storage/schema/__tests/processingFsm.test.js +42 -0
- package/out/src/storage/schema/__tests/processingFsm.test.js.map +1 -0
- package/out/src/storage/schema/__tests/processingFsmLegacyMapping.test.d.ts +2 -0
- package/out/src/storage/schema/__tests/processingFsmLegacyMapping.test.d.ts.map +1 -0
- package/out/src/storage/schema/__tests/processingFsmLegacyMapping.test.js +82 -0
- package/out/src/storage/schema/__tests/processingFsmLegacyMapping.test.js.map +1 -0
- package/out/src/storage/schema/__tests/spendabilityRule.test.d.ts +2 -0
- package/out/src/storage/schema/__tests/spendabilityRule.test.d.ts.map +1 -0
- package/out/src/storage/schema/__tests/spendabilityRule.test.js +29 -0
- package/out/src/storage/schema/__tests/spendabilityRule.test.js.map +1 -0
- package/out/src/storage/schema/__tests/v7FsmLegacyMapping.test.d.ts +2 -0
- package/out/src/storage/schema/__tests/v7FsmLegacyMapping.test.d.ts.map +1 -0
- package/out/src/storage/schema/__tests/v7FsmLegacyMapping.test.js +77 -0
- package/out/src/storage/schema/__tests/v7FsmLegacyMapping.test.js.map +1 -0
- package/out/src/storage/schema/backfill.d.ts +35 -0
- package/out/src/storage/schema/backfill.d.ts.map +1 -0
- package/out/src/storage/schema/backfill.idb.d.ts +32 -0
- package/out/src/storage/schema/backfill.idb.d.ts.map +1 -0
- package/out/src/storage/schema/backfill.idb.js +95 -0
- package/out/src/storage/schema/backfill.idb.js.map +1 -0
- package/out/src/storage/schema/backfill.js +150 -0
- package/out/src/storage/schema/backfill.js.map +1 -0
- package/out/src/storage/schema/backfill.knex.d.ts +32 -0
- package/out/src/storage/schema/backfill.knex.d.ts.map +1 -0
- package/out/src/storage/schema/backfill.knex.js +240 -0
- package/out/src/storage/schema/backfill.knex.js.map +1 -0
- package/out/src/storage/schema/backfill.runner.d.ts +63 -0
- package/out/src/storage/schema/backfill.runner.d.ts.map +1 -0
- package/out/src/storage/schema/backfill.runner.js +64 -0
- package/out/src/storage/schema/backfill.runner.js.map +1 -0
- package/out/src/storage/schema/coinbaseMaturityBackfill.d.ts +25 -0
- package/out/src/storage/schema/coinbaseMaturityBackfill.d.ts.map +1 -0
- package/out/src/storage/schema/coinbaseMaturityBackfill.js +75 -0
- package/out/src/storage/schema/coinbaseMaturityBackfill.js.map +1 -0
- package/out/src/storage/schema/monitorLease.d.ts +57 -0
- package/out/src/storage/schema/monitorLease.d.ts.map +1 -0
- package/out/src/storage/schema/monitorLease.js +101 -0
- package/out/src/storage/schema/monitorLease.js.map +1 -0
- package/out/src/storage/schema/processingFsm.d.ts +27 -0
- package/out/src/storage/schema/processingFsm.d.ts.map +1 -0
- package/out/src/storage/schema/processingFsm.js +132 -0
- package/out/src/storage/schema/processingFsm.js.map +1 -0
- package/out/src/storage/schema/schemaCutover.d.ts +34 -0
- package/out/src/storage/schema/schemaCutover.d.ts.map +1 -0
- package/out/src/storage/schema/schemaCutover.js +230 -0
- package/out/src/storage/schema/schemaCutover.js.map +1 -0
- package/out/src/storage/schema/schemaCutoverIdb.d.ts +26 -0
- package/out/src/storage/schema/schemaCutoverIdb.d.ts.map +1 -0
- package/out/src/storage/schema/schemaCutoverIdb.js +90 -0
- package/out/src/storage/schema/schemaCutoverIdb.js.map +1 -0
- package/out/src/storage/schema/spendabilityRefresh.d.ts +49 -0
- package/out/src/storage/schema/spendabilityRefresh.d.ts.map +1 -0
- package/out/src/storage/schema/spendabilityRefresh.js +120 -0
- package/out/src/storage/schema/spendabilityRefresh.js.map +1 -0
- package/out/src/storage/schema/spendabilityRule.d.ts +45 -0
- package/out/src/storage/schema/spendabilityRule.d.ts.map +1 -0
- package/out/src/storage/schema/spendabilityRule.js +52 -0
- package/out/src/storage/schema/spendabilityRule.js.map +1 -0
- package/out/src/storage/schema/tables/TableAction.d.ts +3 -3
- package/out/src/storage/schema/tables/TableAction.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableChainTip.d.ts +1 -1
- package/out/src/storage/schema/tables/TableMonitorLease.d.ts +1 -1
- package/out/src/storage/schema/tables/TableOutput.d.ts +7 -0
- package/out/src/storage/schema/tables/TableOutput.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TableOutput.js.map +1 -1
- package/out/src/storage/schema/tables/TableTransactionNew.d.ts +50 -0
- package/out/src/storage/schema/tables/TableTransactionNew.d.ts.map +1 -0
- package/out/src/storage/schema/tables/TableTransactionNew.js +3 -0
- package/out/src/storage/schema/tables/TableTransactionNew.js.map +1 -0
- package/out/src/storage/schema/tables/TableTxAudit.d.ts +1 -1
- package/out/src/storage/schema/tables/index.d.ts +5 -0
- package/out/src/storage/schema/tables/index.d.ts.map +1 -1
- package/out/src/storage/schema/tables/index.js +5 -0
- package/out/src/storage/schema/tables/index.js.map +1 -1
- package/out/src/storage/schema/transactionCrud.d.ts +41 -0
- package/out/src/storage/schema/transactionCrud.d.ts.map +1 -0
- package/out/src/storage/schema/transactionCrud.js +205 -0
- package/out/src/storage/schema/transactionCrud.js.map +1 -0
- package/out/src/storage/schema/transactionService.d.ts +315 -0
- package/out/src/storage/schema/transactionService.d.ts.map +1 -0
- package/out/src/storage/schema/transactionService.js +783 -0
- package/out/src/storage/schema/transactionService.js.map +1 -0
- package/out/src/storage/schema/txAudit.d.ts +33 -0
- package/out/src/storage/schema/txAudit.d.ts.map +1 -0
- package/out/src/storage/schema/txAudit.js +64 -0
- package/out/src/storage/schema/txAudit.js.map +1 -0
- package/out/src/storage/schema/v7Backfill.d.ts.map +1 -1
- package/out/src/storage/schema/v7Backfill.js +4 -1
- package/out/src/storage/schema/v7Backfill.js.map +1 -1
- package/out/src/storage/schema/v7Backfill.runner.d.ts.map +1 -1
- package/out/src/storage/schema/v7Backfill.runner.js +3 -1
- package/out/src/storage/schema/v7Backfill.runner.js.map +1 -1
- package/out/src/storage/schema/v7CoinbaseMaturityBackfill.d.ts +25 -0
- package/out/src/storage/schema/v7CoinbaseMaturityBackfill.d.ts.map +1 -0
- package/out/src/storage/schema/v7CoinbaseMaturityBackfill.js +75 -0
- package/out/src/storage/schema/v7CoinbaseMaturityBackfill.js.map +1 -0
- package/out/src/storage/schema/v7Crud.d.ts +5 -3
- package/out/src/storage/schema/v7Crud.d.ts.map +1 -1
- package/out/src/storage/schema/v7Crud.js +11 -9
- package/out/src/storage/schema/v7Crud.js.map +1 -1
- package/out/src/storage/schema/v7Cutover.d.ts +34 -0
- package/out/src/storage/schema/v7Cutover.d.ts.map +1 -0
- package/out/src/storage/schema/v7Cutover.js +223 -0
- package/out/src/storage/schema/v7Cutover.js.map +1 -0
- package/out/src/storage/schema/v7CutoverIdb.d.ts +26 -0
- package/out/src/storage/schema/v7CutoverIdb.d.ts.map +1 -0
- package/out/src/storage/schema/v7CutoverIdb.js +90 -0
- package/out/src/storage/schema/v7CutoverIdb.js.map +1 -0
- package/out/src/storage/schema/v7Fsm.d.ts.map +1 -1
- package/out/src/storage/schema/v7Fsm.js +22 -6
- package/out/src/storage/schema/v7Fsm.js.map +1 -1
- package/out/src/storage/schema/v7Service.d.ts +305 -0
- package/out/src/storage/schema/v7Service.d.ts.map +1 -0
- package/out/src/storage/schema/v7Service.js +757 -0
- package/out/src/storage/schema/v7Service.js.map +1 -0
- package/out/src/storage/schema/v7SpendabilityRefresh.d.ts +49 -0
- package/out/src/storage/schema/v7SpendabilityRefresh.d.ts.map +1 -0
- package/out/src/storage/schema/v7SpendabilityRefresh.js +111 -0
- package/out/src/storage/schema/v7SpendabilityRefresh.js.map +1 -0
- package/out/src/storage/storageProviderHelpers.js +1 -1
- package/out/src/storage/storageProviderHelpers.js.map +1 -1
- package/out/src/utility/Format.js.map +1 -1
- package/package.json +7 -4
package/docs/services.md
CHANGED
|
@@ -23,25 +23,26 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
23
23
|
|
|
24
24
|
| | | |
|
|
25
25
|
| --- | --- | --- |
|
|
26
|
-
| [ArcConfig](#interface-arcconfig) | [
|
|
27
|
-
| [ArcMinerGetTxData](#interface-arcminergettxdata) | [
|
|
28
|
-
| [ArcSSEClientOptions](#interface-arcsseclientoptions) | [
|
|
29
|
-
| [ArcSSEEvent](#interface-arcsseevent) | [
|
|
30
|
-
| [BitailsConfig](#interface-bitailsconfig) | [
|
|
31
|
-
| [BitailsMerkleProof](#interface-bitailsmerkleproof) | [
|
|
32
|
-
| [BulkFileDataManagerMergeResult](#interface-bulkfiledatamanagermergeresult) | [
|
|
33
|
-
| [BulkFileDataManagerOptions](#interface-bulkfiledatamanageroptions) | [
|
|
34
|
-
| [BulkHeaderFileInfo](#interface-bulkheaderfileinfo) | [
|
|
35
|
-
| [BulkHeaderFilesInfo](#interface-bulkheaderfilesinfo) | [
|
|
36
|
-
| [BulkIngestorApi](#interface-bulkingestorapi) | [
|
|
37
|
-
| [BulkIngestorBaseOptions](#interface-bulkingestorbaseoptions) | [
|
|
38
|
-
| [BulkIngestorCDNOptions](#interface-bulkingestorcdnoptions) | [
|
|
39
|
-
| [BulkIngestorWhatsOnChainOptions](#interface-bulkingestorwhatsonchainoptions) | [
|
|
40
|
-
| [BulkStorageApi](#interface-bulkstorageapi) | [
|
|
41
|
-
| [BulkStorageBaseOptions](#interface-bulkstoragebaseoptions) | [
|
|
42
|
-
| [BulkSyncResult](#interface-bulksyncresult) | [
|
|
43
|
-
| [ChaintracksApi](#interface-chaintracksapi) | [
|
|
44
|
-
| [ChaintracksAppendableFileApi](#interface-chaintracksappendablefileapi) | [
|
|
26
|
+
| [ArcConfig](#interface-arcconfig) | [ChaintracksClientApi](#interface-chaintracksclientapi) | [ChaintracksStorageQueryApi](#interface-chaintracksstoragequeryapi) |
|
|
27
|
+
| [ArcMinerGetTxData](#interface-arcminergettxdata) | [ChaintracksFetchApi](#interface-chaintracksfetchapi) | [ChaintracksWritableFileApi](#interface-chaintrackswritablefileapi) |
|
|
28
|
+
| [ArcSSEClientOptions](#interface-arcsseclientoptions) | [ChaintracksFsApi](#interface-chaintracksfsapi) | [ExchangeRatesIoApi](#interface-exchangeratesioapi) |
|
|
29
|
+
| [ArcSSEEvent](#interface-arcsseevent) | [ChaintracksInfoApi](#interface-chaintracksinfoapi) | [GetHeaderByteFileLinksResult](#interface-getheaderbytefilelinksresult) |
|
|
30
|
+
| [BitailsConfig](#interface-bitailsconfig) | [ChaintracksIngestorParams](#interface-chaintracksingestorparams) | [HeightRangeApi](#interface-heightrangeapi) |
|
|
31
|
+
| [BitailsMerkleProof](#interface-bitailsmerkleproof) | [ChaintracksManagementApi](#interface-chaintracksmanagementapi) | [HeightRanges](#interface-heightranges) |
|
|
32
|
+
| [BulkFileDataManagerMergeResult](#interface-bulkfiledatamanagermergeresult) | [ChaintracksOptions](#interface-chaintracksoptions) | [LiveBlockHeader](#interface-liveblockheader) |
|
|
33
|
+
| [BulkFileDataManagerOptions](#interface-bulkfiledatamanageroptions) | [ChaintracksPackageInfoApi](#interface-chaintrackspackageinfoapi) | [LiveIngestorApi](#interface-liveingestorapi) |
|
|
34
|
+
| [BulkHeaderFileInfo](#interface-bulkheaderfileinfo) | [ChaintracksReadableFileApi](#interface-chaintracksreadablefileapi) | [LiveIngestorBaseOptions](#interface-liveingestorbaseoptions) |
|
|
35
|
+
| [BulkHeaderFilesInfo](#interface-bulkheaderfilesinfo) | [ChaintracksServiceClientOptions](#interface-chaintracksserviceclientoptions) | [LiveIngestorWhatsOnChainOptions](#interface-liveingestorwhatsonchainoptions) |
|
|
36
|
+
| [BulkIngestorApi](#interface-bulkingestorapi) | [ChaintracksServiceOptions](#interface-chaintracksserviceoptions) | [MerklePathNote](#interface-merklepathnote) |
|
|
37
|
+
| [BulkIngestorBaseOptions](#interface-bulkingestorbaseoptions) | [ChaintracksStorageApi](#interface-chaintracksstorageapi) | [ScriptHashHistoryResponse](#interface-scripthashhistoryresponse) |
|
|
38
|
+
| [BulkIngestorCDNOptions](#interface-bulkingestorcdnoptions) | [ChaintracksStorageBaseOptions](#interface-chaintracksstoragebaseoptions) | [ServiceCall](#interface-servicecall) |
|
|
39
|
+
| [BulkIngestorWhatsOnChainOptions](#interface-bulkingestorwhatsonchainoptions) | [ChaintracksStorageBulkFileApi](#interface-chaintracksstoragebulkfileapi) | [ServiceToCall](#interface-servicetocall) |
|
|
40
|
+
| [BulkStorageApi](#interface-bulkstorageapi) | [ChaintracksStorageIdbOptions](#interface-chaintracksstorageidboptions) | [StopListenerToken](#interface-stoplistenertoken) |
|
|
41
|
+
| [BulkStorageBaseOptions](#interface-bulkstoragebaseoptions) | [ChaintracksStorageIdbSchema](#interface-chaintracksstorageidbschema) | [WhatsOnChainServicesOptions](#interface-whatsonchainservicesoptions) |
|
|
42
|
+
| [BulkSyncResult](#interface-bulksyncresult) | [ChaintracksStorageIngestApi](#interface-chaintracksstorageingestapi) | [WocChainInfo](#interface-wocchaininfo) |
|
|
43
|
+
| [ChaintracksApi](#interface-chaintracksapi) | [ChaintracksStorageKnexOptions](#interface-chaintracksstorageknexoptions) | [WocGetHeaderByteFileLinks](#interface-wocgetheaderbytefilelinks) |
|
|
44
|
+
| [ChaintracksAppendableFileApi](#interface-chaintracksappendablefileapi) | [ChaintracksStorageMemoryOptions](#interface-chaintracksstoragememoryoptions) | [WocGetHeadersHeader](#interface-wocgetheadersheader) |
|
|
45
|
+
| [ChaintracksChainTrackerOptions](#interface-chaintrackschaintrackeroptions) | [ChaintracksStorageNoDbOptions](#interface-chaintracksstoragenodboptions) | [WocHeader](#interface-wocheader) |
|
|
45
46
|
|
|
46
47
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
47
48
|
|
|
@@ -2504,6 +2505,46 @@ userAgent: string
|
|
|
2504
2505
|
|
|
2505
2506
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2506
2507
|
|
|
2508
|
+
---
|
|
2509
|
+
##### Interface: MerklePathNote
|
|
2510
|
+
|
|
2511
|
+
```ts
|
|
2512
|
+
export interface MerklePathNote {
|
|
2513
|
+
what: MerklePathNoteWhat;
|
|
2514
|
+
name: string;
|
|
2515
|
+
status?: number;
|
|
2516
|
+
statusText?: string;
|
|
2517
|
+
target?: string;
|
|
2518
|
+
code?: string;
|
|
2519
|
+
description?: string;
|
|
2520
|
+
[key: string]: boolean | string | number | undefined;
|
|
2521
|
+
}
|
|
2522
|
+
```
|
|
2523
|
+
|
|
2524
|
+
See also: [MerklePathNoteWhat](./services.md#type-merklepathnotewhat)
|
|
2525
|
+
|
|
2526
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2527
|
+
|
|
2528
|
+
---
|
|
2529
|
+
##### Interface: ScriptHashHistoryResponse
|
|
2530
|
+
|
|
2531
|
+
```ts
|
|
2532
|
+
export interface ScriptHashHistoryResponse {
|
|
2533
|
+
ok: boolean;
|
|
2534
|
+
status: number;
|
|
2535
|
+
statusText: string;
|
|
2536
|
+
data?: {
|
|
2537
|
+
result: Array<{
|
|
2538
|
+
tx_hash: string;
|
|
2539
|
+
height?: number;
|
|
2540
|
+
}>;
|
|
2541
|
+
error?: string;
|
|
2542
|
+
};
|
|
2543
|
+
}
|
|
2544
|
+
```
|
|
2545
|
+
|
|
2546
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2547
|
+
|
|
2507
2548
|
---
|
|
2508
2549
|
##### Interface: ServiceCall
|
|
2509
2550
|
|
|
@@ -2574,6 +2615,17 @@ See also: [ServiceCall](./services.md#interface-servicecall)
|
|
|
2574
2615
|
|
|
2575
2616
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2576
2617
|
|
|
2618
|
+
---
|
|
2619
|
+
##### Interface: StopListenerToken
|
|
2620
|
+
|
|
2621
|
+
```ts
|
|
2622
|
+
export interface StopListenerToken {
|
|
2623
|
+
stop: (() => void) | undefined;
|
|
2624
|
+
}
|
|
2625
|
+
```
|
|
2626
|
+
|
|
2627
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2628
|
+
|
|
2577
2629
|
---
|
|
2578
2630
|
##### Interface: WhatsOnChainServicesOptions
|
|
2579
2631
|
|
|
@@ -3164,7 +3216,7 @@ export class BulkFilesReaderFs extends BulkFilesReader {
|
|
|
3164
3216
|
constructor(public fs: ChaintracksFsApi, files: BulkHeaderFileFs[], range?: HeightRange, maxBufferSize?: number)
|
|
3165
3217
|
static async fromFs(fs: ChaintracksFsApi, rootFolder: string, jsonFilename: string, range?: HeightRange, maxBufferSize?: number): Promise<BulkFilesReaderFs>
|
|
3166
3218
|
static async writeEmptyJsonFile(fs: ChaintracksFsApi, rootFolder: string, jsonFilename: string): Promise<string>
|
|
3167
|
-
static async readJsonFile(fs: ChaintracksFsApi, rootFolder: string, jsonFilename: string, failToEmptyRange
|
|
3219
|
+
static async readJsonFile(fs: ChaintracksFsApi, rootFolder: string, jsonFilename: string, failToEmptyRange = true): Promise<BulkHeaderFilesInfo>
|
|
3168
3220
|
}
|
|
3169
3221
|
```
|
|
3170
3222
|
|
|
@@ -3200,19 +3252,19 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
3200
3252
|
|
|
3201
3253
|
```ts
|
|
3202
3254
|
export abstract class BulkHeaderFile implements BulkHeaderFileInfo {
|
|
3203
|
-
chain?: Chain
|
|
3255
|
+
chain?: Chain;
|
|
3204
3256
|
count: number;
|
|
3205
|
-
data?: Uint8Array<ArrayBufferLike
|
|
3257
|
+
data?: Uint8Array<ArrayBufferLike>;
|
|
3206
3258
|
fileHash: string | null;
|
|
3207
|
-
fileId?: number
|
|
3259
|
+
fileId?: number;
|
|
3208
3260
|
fileName: string;
|
|
3209
3261
|
firstHeight: number;
|
|
3210
3262
|
lastChainWork: string;
|
|
3211
3263
|
lastHash: string | null;
|
|
3212
3264
|
prevChainWork: string;
|
|
3213
3265
|
prevHash: string;
|
|
3214
|
-
sourceUrl?: string
|
|
3215
|
-
validated?: boolean
|
|
3266
|
+
sourceUrl?: string;
|
|
3267
|
+
validated?: boolean;
|
|
3216
3268
|
constructor(info: BulkHeaderFileInfo)
|
|
3217
3269
|
abstract readDataFromFile(length: number, offset: number): Promise<Uint8Array | undefined>;
|
|
3218
3270
|
get heightRange(): HeightRange
|
|
@@ -3509,7 +3561,7 @@ export class BulkIngestorWhatsOnChainCdn extends BulkIngestorBase {
|
|
|
3509
3561
|
}
|
|
3510
3562
|
```
|
|
3511
3563
|
|
|
3512
|
-
See also: [BlockHeader](./client.md#interface-blockheader), [BulkIngestorBase](./services.md#class-bulkingestorbase), [BulkIngestorWhatsOnChainOptions](./services.md#interface-bulkingestorwhatsonchainoptions), [Chain](./client.md#type-chain), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi), [HeightRange](./services.md#class-heightrange), [HeightRanges](./services.md#interface-heightranges), [StopListenerToken](./services.md#
|
|
3564
|
+
See also: [BlockHeader](./client.md#interface-blockheader), [BulkIngestorBase](./services.md#class-bulkingestorbase), [BulkIngestorWhatsOnChainOptions](./services.md#interface-bulkingestorwhatsonchainoptions), [Chain](./client.md#type-chain), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi), [HeightRange](./services.md#class-heightrange), [HeightRanges](./services.md#interface-heightranges), [StopListenerToken](./services.md#interface-stoplistenertoken), [WhatsOnChainServices](./services.md#class-whatsonchainservices)
|
|
3513
3565
|
|
|
3514
3566
|
###### Method createBulkIngestorWhatsOnChainOptions
|
|
3515
3567
|
|
|
@@ -3540,7 +3592,7 @@ export class BulkIngestorWhatsOnChainWs extends BulkIngestorBase {
|
|
|
3540
3592
|
}
|
|
3541
3593
|
```
|
|
3542
3594
|
|
|
3543
|
-
See also: [BlockHeader](./client.md#interface-blockheader), [BulkIngestorBase](./services.md#class-bulkingestorbase), [BulkIngestorWhatsOnChainOptions](./services.md#interface-bulkingestorwhatsonchainoptions), [Chain](./client.md#type-chain), [HeightRange](./services.md#class-heightrange), [HeightRanges](./services.md#interface-heightranges), [StopListenerToken](./services.md#
|
|
3595
|
+
See also: [BlockHeader](./client.md#interface-blockheader), [BulkIngestorBase](./services.md#class-bulkingestorbase), [BulkIngestorWhatsOnChainOptions](./services.md#interface-bulkingestorwhatsonchainoptions), [Chain](./client.md#type-chain), [HeightRange](./services.md#class-heightrange), [HeightRanges](./services.md#interface-heightranges), [StopListenerToken](./services.md#interface-stoplistenertoken), [WhatsOnChainServices](./services.md#class-whatsonchainservices)
|
|
3544
3596
|
|
|
3545
3597
|
###### Method createBulkIngestorWhatsOnChainOptions
|
|
3546
3598
|
|
|
@@ -3623,45 +3675,17 @@ export class Chaintracks implements ChaintracksManagementApi {
|
|
|
3623
3675
|
let after = before;
|
|
3624
3676
|
let added = HeightRange.empty;
|
|
3625
3677
|
const maxSyncRounds = Math.max(1, this.bulkIngestors.length * 2);
|
|
3626
|
-
let
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
const beforeBulkMax = before.bulk.maxHeight;
|
|
3634
|
-
const beforeLiveRange = HeightRange.from(newLiveHeaders);
|
|
3635
|
-
const r = await bulk.synchronize(presentHeight, before, newLiveHeaders);
|
|
3636
|
-
roundHadSuccess = true;
|
|
3637
|
-
newLiveHeaders = r.liveHeaders;
|
|
3638
|
-
after = await this.storage.getAvailableHeightRanges();
|
|
3639
|
-
added = after.bulk.above(before.bulk);
|
|
3640
|
-
const afterLiveRange = HeightRange.from(newLiveHeaders);
|
|
3641
|
-
if (after.bulk.maxHeight > beforeBulkMax || afterLiveRange.maxHeight > beforeLiveRange.maxHeight) {
|
|
3642
|
-
roundMadeProgress = true;
|
|
3643
|
-
}
|
|
3644
|
-
before = after;
|
|
3645
|
-
this.log(`Bulk Ingestor: ${added.length} added with ${newLiveHeaders.length} live headers from ${bulk.constructor.name}`);
|
|
3646
|
-
if (r.done) {
|
|
3647
|
-
done = true;
|
|
3648
|
-
break;
|
|
3649
|
-
}
|
|
3650
|
-
}
|
|
3651
|
-
catch (eu: unknown) {
|
|
3652
|
-
const e = (bulkSyncError = WalletError.fromUnknown(eu));
|
|
3653
|
-
this.log(`bulk sync error: ${e.message}`);
|
|
3654
|
-
if (!this.available)
|
|
3655
|
-
break;
|
|
3656
|
-
}
|
|
3657
|
-
}
|
|
3658
|
-
if (!this.available && bulkSyncError && !roundHadSuccess) {
|
|
3659
|
-
this.startupError = bulkSyncError;
|
|
3678
|
+
for (let round = 1; round <= maxSyncRounds; round++) {
|
|
3679
|
+
const result = await this.runBulkSyncRound(before, presentHeight, newLiveHeaders);
|
|
3680
|
+
after = result.after;
|
|
3681
|
+
newLiveHeaders = result.newLiveHeaders;
|
|
3682
|
+
added = after.bulk.above(before.bulk);
|
|
3683
|
+
before = after;
|
|
3684
|
+
if (this.startupError != null)
|
|
3660
3685
|
break;
|
|
3661
|
-
|
|
3662
|
-
if (done)
|
|
3686
|
+
if (result.done)
|
|
3663
3687
|
break;
|
|
3664
|
-
if (!
|
|
3688
|
+
if (!result.madeProgress) {
|
|
3665
3689
|
this.log(`Bulk sync stalled after round ${round}. Deferring further bulk sync attempts to continue live header processing.`);
|
|
3666
3690
|
break;
|
|
3667
3691
|
}
|
|
@@ -3669,7 +3693,7 @@ export class Chaintracks implements ChaintracksManagementApi {
|
|
|
3669
3693
|
this.log(`Bulk sync paused after ${maxSyncRounds} rounds to avoid runaway retries. Will retry in a later sync cycle.`);
|
|
3670
3694
|
}
|
|
3671
3695
|
}
|
|
3672
|
-
if (
|
|
3696
|
+
if (this.startupError == null) {
|
|
3673
3697
|
this.liveHeaders.unshift(...newLiveHeaders);
|
|
3674
3698
|
added = after.bulk.above(initialRanges.bulk);
|
|
3675
3699
|
this.log(`syncBulkStorage done
|
|
@@ -3680,151 +3704,32 @@ export class Chaintracks implements ChaintracksManagementApi {
|
|
|
3680
3704
|
`);
|
|
3681
3705
|
}
|
|
3682
3706
|
}
|
|
3683
|
-
private async
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
let
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
try {
|
|
3691
|
-
const now = Date.now();
|
|
3692
|
-
lastSyncCheck = now;
|
|
3693
|
-
const presentHeight = await this.getPresentHeight();
|
|
3694
|
-
const before = await this.storage.getAvailableHeightRanges();
|
|
3695
|
-
let skipBulkSync = !before.live.isEmpty && before.live.maxHeight >= presentHeight - this.addLiveRecursionLimit / 2;
|
|
3696
|
-
if (skipBulkSync && now - lastBulkSync > cdnSyncRepeatMsecs) {
|
|
3697
|
-
skipBulkSync = false;
|
|
3698
|
-
}
|
|
3699
|
-
this.log(`Chaintracks Update Services: Bulk Header Sync Review
|
|
3707
|
+
private async runBulkSyncIfNeeded(now: number, lastBulkSync: number, cdnSyncRepeatMsecs: number): Promise<number> {
|
|
3708
|
+
const presentHeight = await this.getPresentHeight();
|
|
3709
|
+
const before = await this.storage.getAvailableHeightRanges();
|
|
3710
|
+
let skipBulkSync = !before.live.isEmpty && before.live.maxHeight >= presentHeight - this.addLiveRecursionLimit / 2;
|
|
3711
|
+
if (skipBulkSync && now - lastBulkSync > cdnSyncRepeatMsecs)
|
|
3712
|
+
skipBulkSync = false;
|
|
3713
|
+
this.log(`Chaintracks Update Services: Bulk Header Sync Review
|
|
3700
3714
|
presentHeight=${presentHeight} addLiveRecursionLimit=${this.addLiveRecursionLimit}
|
|
3701
3715
|
Before synchronize: bulk ${before.bulk}, live ${before.live}
|
|
3702
3716
|
${skipBulkSync ? "Skipping" : "Starting"} syncBulkStorage.
|
|
3703
3717
|
`);
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
}
|
|
3713
|
-
let count = 0;
|
|
3714
|
-
let liveHeaderDupes = 0;
|
|
3715
|
-
let needSyncCheck = false;
|
|
3716
|
-
for (; !needSyncCheck && !this.stopMainThread;) {
|
|
3717
|
-
let header = this.liveHeaders.shift();
|
|
3718
|
-
if (header) {
|
|
3719
|
-
let recursions = this.addLiveRecursionLimit;
|
|
3720
|
-
for (; !needSyncCheck && !this.stopMainThread;) {
|
|
3721
|
-
const ihr = await this.addLiveHeader(header);
|
|
3722
|
-
if (this.invalidInsertHeaderResult(ihr)) {
|
|
3723
|
-
this.log(`Ignoring liveHeader ${header.height} ${header.hash} due to invalid insert result.`);
|
|
3724
|
-
needSyncCheck = true;
|
|
3725
|
-
}
|
|
3726
|
-
else if (ihr.noPrev) {
|
|
3727
|
-
if (recursions-- <= 0) {
|
|
3728
|
-
this.log(`Ignoring liveHeader ${header.height} ${header.hash} addLiveRecursionLimit=${this.addLiveRecursionLimit} exceeded.`);
|
|
3729
|
-
needSyncCheck = true;
|
|
3730
|
-
}
|
|
3731
|
-
else {
|
|
3732
|
-
const hash = header.previousHash;
|
|
3733
|
-
const prevHeader = await this.getMissingBlockHeader(hash);
|
|
3734
|
-
if (!prevHeader) {
|
|
3735
|
-
this.log(`Ignoring liveHeader ${header.height} ${header.hash} failed to find previous header by hash ${asString(hash)}`);
|
|
3736
|
-
needSyncCheck = true;
|
|
3737
|
-
}
|
|
3738
|
-
else {
|
|
3739
|
-
this.liveHeaders.unshift(header);
|
|
3740
|
-
header = prevHeader;
|
|
3741
|
-
}
|
|
3742
|
-
}
|
|
3743
|
-
}
|
|
3744
|
-
else {
|
|
3745
|
-
if (this.subscriberCallbacksEnabled)
|
|
3746
|
-
this.log(`addLiveHeader ${header.height}${ihr.added ? " added" : ""}${ihr.dupe ? " dupe" : ""}${ihr.isActiveTip ? " isActiveTip" : ""}${ihr.reorgDepth ? " reorg depth " + ihr.reorgDepth : ""}${ihr.noPrev ? " noPrev" : ""}${ihr.noActiveAncestor || ihr.noTip || ihr.badPrev ? " error" : ""}`);
|
|
3747
|
-
if (ihr.dupe) {
|
|
3748
|
-
liveHeaderDupes++;
|
|
3749
|
-
}
|
|
3750
|
-
if (ihr.added) {
|
|
3751
|
-
count++;
|
|
3752
|
-
}
|
|
3753
|
-
break;
|
|
3754
|
-
}
|
|
3755
|
-
}
|
|
3756
|
-
}
|
|
3757
|
-
else {
|
|
3758
|
-
const bheader = this.baseHeaders.shift();
|
|
3759
|
-
if (bheader) {
|
|
3760
|
-
const prev = await this.storage.findLiveHeaderForBlockHash(bheader.previousHash);
|
|
3761
|
-
if (!prev) {
|
|
3762
|
-
this.log(`Ignoring header with unknown previousHash ${bheader.previousHash} in live storage.`);
|
|
3763
|
-
}
|
|
3764
|
-
else {
|
|
3765
|
-
const header: BlockHeader = {
|
|
3766
|
-
...bheader,
|
|
3767
|
-
height: prev.height + 1,
|
|
3768
|
-
hash: blockHash(bheader)
|
|
3769
|
-
};
|
|
3770
|
-
const ihr = await this.addLiveHeader(header);
|
|
3771
|
-
if (this.invalidInsertHeaderResult(ihr)) {
|
|
3772
|
-
this.log(`Ignoring invalid baseHeader ${header.height} ${header.hash}.`);
|
|
3773
|
-
}
|
|
3774
|
-
else {
|
|
3775
|
-
if (this.subscriberCallbacksEnabled)
|
|
3776
|
-
this.log(`addBaseHeader ${header.height}${ihr.added ? " added" : ""}${ihr.dupe ? " dupe" : ""}${ihr.isActiveTip ? " isActiveTip" : ""}${ihr.reorgDepth ? " reorg depth " + ihr.reorgDepth : ""}${ihr.noPrev ? " noPrev" : ""}${ihr.noActiveAncestor || ihr.noTip || ihr.badPrev ? " error" : ""}`);
|
|
3777
|
-
if (ihr.added) {
|
|
3778
|
-
count++;
|
|
3779
|
-
}
|
|
3780
|
-
}
|
|
3781
|
-
}
|
|
3782
|
-
}
|
|
3783
|
-
else {
|
|
3784
|
-
if (count > 0) {
|
|
3785
|
-
if (liveHeaderDupes > 0) {
|
|
3786
|
-
this.log(`${liveHeaderDupes} duplicate headers ignored.`);
|
|
3787
|
-
liveHeaderDupes = 0;
|
|
3788
|
-
}
|
|
3789
|
-
const updated = await this.storage.getAvailableHeightRanges();
|
|
3790
|
-
this.log(`After adding ${count} live headers
|
|
3791
|
-
After live: bulk ${updated.bulk}, live ${updated.live}
|
|
3792
|
-
`);
|
|
3793
|
-
count = 0;
|
|
3794
|
-
}
|
|
3795
|
-
if (!this.subscriberCallbacksEnabled) {
|
|
3796
|
-
const live = await this.storage.findLiveHeightRange();
|
|
3797
|
-
if (!live.isEmpty) {
|
|
3798
|
-
this.subscriberCallbacksEnabled = true;
|
|
3799
|
-
this.log(`listening at height of ${live.maxHeight}`);
|
|
3800
|
-
}
|
|
3801
|
-
}
|
|
3802
|
-
if (!this.available) {
|
|
3803
|
-
this.available = true;
|
|
3804
|
-
}
|
|
3805
|
-
needSyncCheck = Date.now() - lastSyncCheck > syncCheckRepeatMsecs;
|
|
3806
|
-
if (!needSyncCheck)
|
|
3807
|
-
await wait(1000);
|
|
3808
|
-
}
|
|
3809
|
-
}
|
|
3810
|
-
}
|
|
3811
|
-
}
|
|
3812
|
-
catch (eu: unknown) {
|
|
3813
|
-
const e = WalletError.fromUnknown(eu);
|
|
3814
|
-
if (!this.available) {
|
|
3815
|
-
this.startupError = e;
|
|
3816
|
-
this.stopMainThread = true;
|
|
3817
|
-
}
|
|
3818
|
-
else {
|
|
3819
|
-
this.log(`Error occurred during chaintracks main thread processing: ${e.stack || e.message}`);
|
|
3820
|
-
}
|
|
3821
|
-
}
|
|
3718
|
+
if (!skipBulkSync) {
|
|
3719
|
+
if (this.available)
|
|
3720
|
+
await this.syncBulkStorage(presentHeight, before);
|
|
3721
|
+
else
|
|
3722
|
+
await this.syncBulkStorageNoLock(presentHeight, before);
|
|
3723
|
+
if (this.startupError != null)
|
|
3724
|
+
throw this.startupError;
|
|
3725
|
+
return now;
|
|
3822
3726
|
}
|
|
3727
|
+
return lastBulkSync;
|
|
3823
3728
|
}
|
|
3824
3729
|
}
|
|
3825
3730
|
```
|
|
3826
3731
|
|
|
3827
|
-
See also: [BaseBlockHeader](./client.md#interface-baseblockheader), [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [ChaintracksFsApi](./services.md#interface-chaintracksfsapi), [ChaintracksInfoApi](./services.md#interface-chaintracksinfoapi), [ChaintracksManagementApi](./services.md#interface-chaintracksmanagementapi), [ChaintracksOptions](./services.md#interface-chaintracksoptions), [HeaderListener](./services.md#type-headerlistener), [HeightRange](./services.md#class-heightrange), [HeightRanges](./services.md#interface-heightranges), [LiveBlockHeader](./services.md#interface-liveblockheader), [ReorgListener](./services.md#type-reorglistener), [Services](./services.md#class-services)
|
|
3732
|
+
See also: [BaseBlockHeader](./client.md#interface-baseblockheader), [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [ChaintracksFsApi](./services.md#interface-chaintracksfsapi), [ChaintracksInfoApi](./services.md#interface-chaintracksinfoapi), [ChaintracksManagementApi](./services.md#interface-chaintracksmanagementapi), [ChaintracksOptions](./services.md#interface-chaintracksoptions), [HeaderListener](./services.md#type-headerlistener), [HeightRange](./services.md#class-heightrange), [HeightRanges](./services.md#interface-heightranges), [LiveBlockHeader](./services.md#interface-liveblockheader), [ReorgListener](./services.md#type-reorglistener), [Services](./services.md#class-services)
|
|
3828
3733
|
|
|
3829
3734
|
###### Method addHeader
|
|
3830
3735
|
|
|
@@ -3884,7 +3789,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
3884
3789
|
|
|
3885
3790
|
```ts
|
|
3886
3791
|
export class ChaintracksAppendableFile extends ChaintracksReadableFile implements ChaintracksAppendableFileApi {
|
|
3887
|
-
foldersEnsured
|
|
3792
|
+
foldersEnsured = false;
|
|
3888
3793
|
static async openAsAppendable(path: string): Promise<ChaintracksAppendableFile>
|
|
3889
3794
|
async ensureFoldersExist(): Promise<void>
|
|
3890
3795
|
async append(data: Uint8Array): Promise<void>
|
|
@@ -3922,7 +3827,6 @@ using the
|
|
|
3922
3827
|
```ts
|
|
3923
3828
|
export class ChaintracksFetch implements ChaintracksFetchApi {
|
|
3924
3829
|
httpClient: HttpClient = defaultHttpClient();
|
|
3925
|
-
constructor()
|
|
3926
3830
|
async download(url: string): Promise<Uint8Array>
|
|
3927
3831
|
async fetchJson<R>(url: string): Promise<R>
|
|
3928
3832
|
pathJoin(baseUrl: string, subpath: string): string
|
|
@@ -4025,9 +3929,9 @@ export class ChaintracksServiceClient implements ChaintracksClientApi {
|
|
|
4025
3929
|
static createChaintracksServiceClientOptions(): ChaintracksServiceClientOptions
|
|
4026
3930
|
options: ChaintracksServiceClientOptions;
|
|
4027
3931
|
constructor(public chain: Chain, public serviceUrl: string, options?: ChaintracksServiceClientOptions)
|
|
4028
|
-
subscribeHeaders(listener: HeaderListener): Promise<string>
|
|
4029
|
-
subscribeReorgs(listener: ReorgListener): Promise<string>
|
|
4030
|
-
unsubscribe(subscriptionId: string): Promise<boolean>
|
|
3932
|
+
async subscribeHeaders(listener: HeaderListener): Promise<string>
|
|
3933
|
+
async subscribeReorgs(listener: ReorgListener): Promise<string>
|
|
3934
|
+
async unsubscribe(subscriptionId: string): Promise<boolean>
|
|
4031
3935
|
async currentHeight(): Promise<number>
|
|
4032
3936
|
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
4033
3937
|
async getJsonOrUndefined<T>(path: string): Promise<T | undefined>
|
|
@@ -4067,8 +3971,8 @@ export abstract class ChaintracksStorageBase implements ChaintracksStorageQueryA
|
|
|
4067
3971
|
reorgHeightThreshold: number;
|
|
4068
3972
|
bulkMigrationChunkSize: number;
|
|
4069
3973
|
batchInsertLimit: number;
|
|
4070
|
-
isAvailable
|
|
4071
|
-
hasMigrated
|
|
3974
|
+
isAvailable = false;
|
|
3975
|
+
hasMigrated = false;
|
|
4072
3976
|
bulkManager: BulkFileDataManager;
|
|
4073
3977
|
constructor(options: ChaintracksStorageBaseOptions)
|
|
4074
3978
|
async shutdown(): Promise<void>
|
|
@@ -4235,8 +4139,8 @@ export class ChaintracksStorageKnex extends ChaintracksStorageBase implements Ch
|
|
|
4235
4139
|
static createStorageKnexOptions(chain: Chain, knex?: Knex): ChaintracksStorageKnexOptions
|
|
4236
4140
|
knex: Knex;
|
|
4237
4141
|
_dbtype?: DBType;
|
|
4238
|
-
bulkFilesTableName
|
|
4239
|
-
headerTableName
|
|
4142
|
+
bulkFilesTableName = "bulk_files";
|
|
4143
|
+
headerTableName = "live_headers";
|
|
4240
4144
|
constructor(options: ChaintracksStorageKnexOptions)
|
|
4241
4145
|
get dbtype(): DBType
|
|
4242
4146
|
override async shutdown(): Promise<void>
|
|
@@ -4293,14 +4197,14 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4293
4197
|
|
|
4294
4198
|
```ts
|
|
4295
4199
|
export class ChaintracksStorageNoDb extends ChaintracksStorageBase {
|
|
4296
|
-
static mainData: ChaintracksNoDbData = {
|
|
4200
|
+
static readonly mainData: ChaintracksNoDbData = {
|
|
4297
4201
|
chain: "main",
|
|
4298
4202
|
liveHeaders: new Map<number, LiveBlockHeader>(),
|
|
4299
4203
|
maxHeaderId: 0,
|
|
4300
4204
|
tipHeaderId: 0,
|
|
4301
4205
|
hashToHeaderId: new Map<string, number>()
|
|
4302
4206
|
};
|
|
4303
|
-
static testData: ChaintracksNoDbData = {
|
|
4207
|
+
static readonly testData: ChaintracksNoDbData = {
|
|
4304
4208
|
chain: "test",
|
|
4305
4209
|
liveHeaders: new Map<number, LiveBlockHeader>(),
|
|
4306
4210
|
maxHeaderId: 0,
|
|
@@ -4338,7 +4242,7 @@ export class ChaintracksWritableFile implements ChaintracksWritableFileApi {
|
|
|
4338
4242
|
path: string;
|
|
4339
4243
|
parsedPath: Path.ParsedPath;
|
|
4340
4244
|
f: fs.FileHandle;
|
|
4341
|
-
foldersEnsured
|
|
4245
|
+
foldersEnsured = false;
|
|
4342
4246
|
static async openAsWritable(path: string): Promise<ChaintracksWritableFile>
|
|
4343
4247
|
async close(): Promise<void>
|
|
4344
4248
|
async ensureFoldersExist(): Promise<void>
|
|
@@ -4599,7 +4503,7 @@ export class LiveIngestorWhatsOnChainPoll extends LiveIngestorBase {
|
|
|
4599
4503
|
static createLiveIngestorWhatsOnChainOptions(chain: Chain): LiveIngestorWhatsOnChainOptions
|
|
4600
4504
|
idleWait: number;
|
|
4601
4505
|
woc: WhatsOnChainServices;
|
|
4602
|
-
done
|
|
4506
|
+
done = false;
|
|
4603
4507
|
constructor(options: LiveIngestorWhatsOnChainOptions)
|
|
4604
4508
|
async getHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
4605
4509
|
async startListening(liveHeaders: BlockHeader[]): Promise<void>
|
|
@@ -4628,7 +4532,7 @@ export class LiveIngestorWhatsOnChainWs extends LiveIngestorBase {
|
|
|
4628
4532
|
}
|
|
4629
4533
|
```
|
|
4630
4534
|
|
|
4631
|
-
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [LiveIngestorBase](./services.md#class-liveingestorbase), [LiveIngestorWhatsOnChainOptions](./services.md#interface-liveingestorwhatsonchainoptions), [StopListenerToken](./services.md#
|
|
4535
|
+
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [LiveIngestorBase](./services.md#class-liveingestorbase), [LiveIngestorWhatsOnChainOptions](./services.md#interface-liveingestorwhatsonchainoptions), [StopListenerToken](./services.md#interface-stoplistenertoken), [WhatsOnChainServices](./services.md#class-whatsonchainservices)
|
|
4632
4536
|
|
|
4633
4537
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4634
4538
|
|
|
@@ -4672,27 +4576,27 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4672
4576
|
|
|
4673
4577
|
```ts
|
|
4674
4578
|
export class ServiceCollection<T> {
|
|
4675
|
-
services: {
|
|
4579
|
+
services: Array<{
|
|
4676
4580
|
name: string;
|
|
4677
4581
|
service: T;
|
|
4678
|
-
}
|
|
4582
|
+
}>;
|
|
4679
4583
|
_index: number;
|
|
4680
4584
|
readonly since: Date;
|
|
4681
4585
|
_historyByProvider: Record<string, ProviderCallHistory> = {};
|
|
4682
|
-
constructor(public serviceName: string, services?: {
|
|
4586
|
+
constructor(public serviceName: string, services?: Array<{
|
|
4683
4587
|
name: string;
|
|
4684
4588
|
service: T;
|
|
4685
|
-
}
|
|
4589
|
+
}>)
|
|
4686
4590
|
add(s: {
|
|
4687
4591
|
name: string;
|
|
4688
4592
|
service: T;
|
|
4689
|
-
}):
|
|
4593
|
+
}): this
|
|
4690
4594
|
remove(name: string): void
|
|
4691
4595
|
get name()
|
|
4692
4596
|
get service()
|
|
4693
4597
|
getServiceToCall(i: number): ServiceToCall<T>
|
|
4694
4598
|
get serviceToCall(): ServiceToCall<T>
|
|
4695
|
-
get allServicesToCall(): ServiceToCall<T
|
|
4599
|
+
get allServicesToCall(): Array<ServiceToCall<T>>
|
|
4696
4600
|
moveServiceToLast(stc: ServiceToCall<T>)
|
|
4697
4601
|
get allServices()
|
|
4698
4602
|
get count()
|
|
@@ -4793,7 +4697,7 @@ export class Services implements WalletServices {
|
|
|
4793
4697
|
}
|
|
4794
4698
|
```
|
|
4795
4699
|
|
|
4796
|
-
See also: [ARC](./services.md#class-arc), [Bitails](./services.md#class-bitails), [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [FiatCurrencyCode](./client.md#type-fiatcurrencycode), [FiatExchangeRates](./client.md#interface-fiatexchangerates), [GetMerklePathResult](./client.md#interface-getmerklepathresult), [GetMerklePathService](./client.md#type-getmerklepathservice), [GetRawTxResult](./client.md#interface-getrawtxresult), [GetRawTxService](./client.md#type-getrawtxservice), [GetScriptHashHistoryResult](./client.md#interface-getscripthashhistoryresult), [GetScriptHashHistoryService](./client.md#type-getscripthashhistoryservice), [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresult), [GetStatusForTxidsService](./client.md#type-getstatusfortxidsservice), [GetUtxoStatusOutputFormat](./client.md#type-getutxostatusoutputformat), [GetUtxoStatusResult](./client.md#interface-getutxostatusresult), [GetUtxoStatusService](./client.md#type-getutxostatusservice), [PostBeefResult](./client.md#interface-postbeefresult), [PostBeefService](./client.md#type-postbeefservice), [ServiceCollection](./services.md#class-servicecollection), [ServicesCallHistory](./client.md#
|
|
4700
|
+
See also: [ARC](./services.md#class-arc), [Bitails](./services.md#class-bitails), [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [FiatCurrencyCode](./client.md#type-fiatcurrencycode), [FiatExchangeRates](./client.md#interface-fiatexchangerates), [GetMerklePathResult](./client.md#interface-getmerklepathresult), [GetMerklePathService](./client.md#type-getmerklepathservice), [GetRawTxResult](./client.md#interface-getrawtxresult), [GetRawTxService](./client.md#type-getrawtxservice), [GetScriptHashHistoryResult](./client.md#interface-getscripthashhistoryresult), [GetScriptHashHistoryService](./client.md#type-getscripthashhistoryservice), [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresult), [GetStatusForTxidsService](./client.md#type-getstatusfortxidsservice), [GetUtxoStatusOutputFormat](./client.md#type-getutxostatusoutputformat), [GetUtxoStatusResult](./client.md#interface-getutxostatusresult), [GetUtxoStatusService](./client.md#type-getutxostatusservice), [PostBeefResult](./client.md#interface-postbeefresult), [PostBeefService](./client.md#type-postbeefservice), [ServiceCollection](./services.md#class-servicecollection), [ServicesCallHistory](./client.md#interface-servicescallhistory), [TableOutput](./storage.md#interface-tableoutput), [UpdateFiatExchangeRateService](./client.md#type-updatefiatexchangerateservice), [WalletServices](./client.md#interface-walletservices), [WalletServicesOptions](./client.md#interface-walletservicesoptions), [WhatsOnChain](./services.md#class-whatsonchain), [getBeefForTxid](./services.md#function-getbeeffortxid), [logger](./client.md#variable-logger)
|
|
4797
4701
|
|
|
4798
4702
|
###### Property postBeefUntilSuccessSoftTimeoutMaxMs
|
|
4799
4703
|
|
|
@@ -5001,9 +4905,9 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5001
4905
|
```ts
|
|
5002
4906
|
export class WhatsOnChainServices {
|
|
5003
4907
|
static createWhatsOnChainServicesOptions(chain: Chain): WhatsOnChainServicesOptions
|
|
5004
|
-
static chainInfo:
|
|
5005
|
-
static chainInfoTime:
|
|
5006
|
-
static chainInfoMsecs: number[] = [];
|
|
4908
|
+
static readonly chainInfo: Array<WocChainInfo | undefined> = [];
|
|
4909
|
+
static readonly chainInfoTime: Array<Date | undefined> = [];
|
|
4910
|
+
static readonly chainInfoMsecs: number[] = [];
|
|
5007
4911
|
chain: Chain;
|
|
5008
4912
|
woc: WhatsOnChain;
|
|
5009
4913
|
constructor(public options: WhatsOnChainServicesOptions)
|
|
@@ -5036,26 +4940,28 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5036
4940
|
|
|
5037
4941
|
| | | |
|
|
5038
4942
|
| --- | --- | --- |
|
|
5039
|
-
| [WocHeadersBulkListener](#function-wocheadersbulklistener) | [
|
|
5040
|
-
| [WocHeadersBulkListener_test](#function-wocheadersbulklistener_test) | [
|
|
5041
|
-
| [WocHeadersLiveListener](#function-wocheaderslivelistener) | [
|
|
5042
|
-
| [WocHeadersLiveListener_test](#function-wocheaderslivelistener_test) | [
|
|
5043
|
-
| [addWork](#function-addwork) | [
|
|
5044
|
-
| [arcDefaultUrl](#function-arcdefaulturl) | [
|
|
5045
|
-
| [arcGorillaPoolUrl](#function-arcgorillapoolurl) | [
|
|
5046
|
-
| [blockHash](#function-blockhash) | [
|
|
5047
|
-
| [buildChaintracksOptionsWithIngestors](#function-buildchaintracksoptionswithingestors) | [
|
|
5048
|
-
| [
|
|
5049
|
-
| [
|
|
5050
|
-
| [
|
|
5051
|
-
| [
|
|
5052
|
-
| [
|
|
5053
|
-
| [
|
|
5054
|
-
| [
|
|
5055
|
-
| [
|
|
5056
|
-
| [
|
|
5057
|
-
| [
|
|
5058
|
-
| [
|
|
4943
|
+
| [WocHeadersBulkListener](#function-wocheadersbulklistener) | [deserializeBaseBlockHeader](#function-deserializebaseblockheader) | [readUInt32LE](#function-readuint32le) |
|
|
4944
|
+
| [WocHeadersBulkListener_test](#function-wocheadersbulklistener_test) | [deserializeBaseBlockHeaders](#function-deserializebaseblockheaders) | [selectBulkHeaderFiles](#function-selectbulkheaderfiles) |
|
|
4945
|
+
| [WocHeadersLiveListener](#function-wocheaderslivelistener) | [deserializeBlockHeader](#function-deserializeblockheader) | [serializeBaseBlockHeader](#function-serializebaseblockheader) |
|
|
4946
|
+
| [WocHeadersLiveListener_test](#function-wocheaderslivelistener_test) | [deserializeBlockHeaders](#function-deserializeblockheaders) | [serializeBaseBlockHeaders](#function-serializebaseblockheaders) |
|
|
4947
|
+
| [addWork](#function-addwork) | [genesisBuffer](#function-genesisbuffer) | [sha256HashOfBinaryFile](#function-sha256hashofbinaryfile) |
|
|
4948
|
+
| [arcDefaultUrl](#function-arcdefaulturl) | [genesisHeader](#function-genesisheader) | [subWork](#function-subwork) |
|
|
4949
|
+
| [arcGorillaPoolUrl](#function-arcgorillapoolurl) | [getBeefForTxid](#function-getbeeffortxid) | [swapByteOrder](#function-swapbyteorder) |
|
|
4950
|
+
| [blockHash](#function-blockhash) | [getExchangeRatesIo](#function-getexchangeratesio) | [toBinaryBaseBlockHeader](#function-tobinarybaseblockheader) |
|
|
4951
|
+
| [buildChaintracksOptionsWithIngestors](#function-buildchaintracksoptionswithingestors) | [getWhatsOnChainBlockHeaderByHash](#function-getwhatsonchainblockheaderbyhash) | [updateChaintracksFiatExchangeRates](#function-updatechaintracksfiatexchangerates) |
|
|
4952
|
+
| [classifyMerklePathResponse](#function-classifymerklepathresponse) | [handlePostRawTxErrorResponse](#function-handlepostrawtxerrorresponse) | [updateExchangeratesapi](#function-updateexchangeratesapi) |
|
|
4953
|
+
| [convertBitsToTarget](#function-convertbitstotarget) | [handleScriptHashHistoryCatch](#function-handlescripthashhistorycatch) | [validBulkHeaderFilesByFileHash](#function-validbulkheaderfilesbyfilehash) |
|
|
4954
|
+
| [convertBitsToWork](#function-convertbitstowork) | [handleScriptHashHistoryResponse](#function-handlescripthashhistoryresponse) | [validateAgainstDirtyHashes](#function-validateagainstdirtyhashes) |
|
|
4955
|
+
| [convertBufferToUint32](#function-convertbuffertouint32) | [handleUtxoConnReset](#function-handleutxoconnreset) | [validateBufferOfHeaders](#function-validatebufferofheaders) |
|
|
4956
|
+
| [convertUint32ToBuffer](#function-convertuint32tobuffer) | [isBaseBlockHeader](#function-isbaseblockheader) | [validateBulkFileData](#function-validatebulkfiledata) |
|
|
4957
|
+
| [convertWocToBlockHeaderHex](#function-convertwoctoblockheaderhex) | [isBlockHeader](#function-isblockheader) | [validateGenesisHeader](#function-validategenesisheader) |
|
|
4958
|
+
| [createDefaultIdbChaintracksOptions](#function-createdefaultidbchaintracksoptions) | [isKnownValidBulkHeaderFile](#function-isknownvalidbulkheaderfile) | [validateHeaderDifficulty](#function-validateheaderdifficulty) |
|
|
4959
|
+
| [createDefaultKnexChaintracksOptions](#function-createdefaultknexchaintracksoptions) | [isLive](#function-islive) | [validateHeaderFormat](#function-validateheaderformat) |
|
|
4960
|
+
| [createDefaultNoDbChaintracksOptions](#function-createdefaultnodbchaintracksoptions) | [isLiveBlockHeader](#function-isliveblockheader) | [validateScriptHash](#function-validatescripthash) |
|
|
4961
|
+
| [createDefaultWalletServicesOptions](#function-createdefaultwalletservicesoptions) | [isMoreWork](#function-ismorework) | [wocGetHeadersHeaderToBlockHeader](#function-wocgetheadersheadertoblockheader) |
|
|
4962
|
+
| [createIdbChaintracks](#function-createidbchaintracks) | [makeMerklePathNote](#function-makemerklepathnote) | [workBNtoBuffer](#function-workbntobuffer) |
|
|
4963
|
+
| [createKnexChaintracks](#function-createknexchaintracks) | [populateUtxoDetails](#function-populateutxodetails) | [writeUInt32BE](#function-writeuint32be) |
|
|
4964
|
+
| [createNoDbChaintracks](#function-createnodbchaintracks) | [readUInt32BE](#function-readuint32be) | [writeUInt32LE](#function-writeuint32le) |
|
|
5059
4965
|
|
|
5060
4966
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5061
4967
|
|
|
@@ -5069,7 +4975,7 @@ High speed WebSocket based based old block header listener
|
|
|
5069
4975
|
export async function WocHeadersBulkListener(fromHeight: number, toHeight: number, enqueue: (header: BlockHeader) => void, error: (code: number, message: string) => boolean, stop: StopListenerToken, chain: Chain, logger: (...args: any[]) => void = () => { }, idleWait = 5000): Promise<boolean>
|
|
5070
4976
|
```
|
|
5071
4977
|
|
|
5072
|
-
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [StopListenerToken](./services.md#
|
|
4978
|
+
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [StopListenerToken](./services.md#interface-stoplistenertoken), [logger](./client.md#variable-logger)
|
|
5073
4979
|
|
|
5074
4980
|
Returns
|
|
5075
4981
|
|
|
@@ -5124,7 +5030,7 @@ High speed WebSocket based based new block header listener
|
|
|
5124
5030
|
export async function WocHeadersLiveListener(enqueue: (header: BlockHeader) => void, error: (code: number, message: string) => boolean, stop: StopListenerToken, chain: Chain, logger: (...args: any[]) => void, idleWait = 100000): Promise<boolean>
|
|
5125
5031
|
```
|
|
5126
5032
|
|
|
5127
|
-
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [StopListenerToken](./services.md#
|
|
5033
|
+
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [StopListenerToken](./services.md#interface-stoplistenertoken), [logger](./client.md#variable-logger)
|
|
5128
5034
|
|
|
5129
5035
|
Returns
|
|
5130
5036
|
|
|
@@ -5233,6 +5139,20 @@ See also: [ChaintracksIngestorParams](./services.md#interface-chaintracksingesto
|
|
|
5233
5139
|
|
|
5234
5140
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5235
5141
|
|
|
5142
|
+
---
|
|
5143
|
+
##### Function: classifyMerklePathResponse
|
|
5144
|
+
|
|
5145
|
+
Classify a non-OK status response for getMerklePath.
|
|
5146
|
+
|
|
5147
|
+
Returns `'retry'` when the request was rate-limited and the caller should retry,
|
|
5148
|
+
`'notFound'` for 404, `'badStatus'` for other non-200 codes.
|
|
5149
|
+
|
|
5150
|
+
```ts
|
|
5151
|
+
export function classifyMerklePathResponse(status: number, statusText: string, retry: number): "retry" | "notFound" | "badStatus" | "ok"
|
|
5152
|
+
```
|
|
5153
|
+
|
|
5154
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5155
|
+
|
|
5236
5156
|
---
|
|
5237
5157
|
##### Function: convertBitsToTarget
|
|
5238
5158
|
|
|
@@ -5340,7 +5260,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5340
5260
|
##### Function: createDefaultIdbChaintracksOptions
|
|
5341
5261
|
|
|
5342
5262
|
```ts
|
|
5343
|
-
export function createDefaultIdbChaintracksOptions(chain: Chain, whatsonchainApiKey
|
|
5263
|
+
export function createDefaultIdbChaintracksOptions(chain: Chain, whatsonchainApiKey = "", maxPerFile = 100000, maxRetained = 2, fetch?: ChaintracksFetchApi, cdnUrl = "https://cdn.projectbabbage.com/blockheaders/", liveHeightThreshold = 2000, reorgHeightThreshold = 400, bulkMigrationChunkSize = 500, batchInsertLimit = 400, addLiveRecursionLimit = 36): ChaintracksOptions
|
|
5344
5264
|
```
|
|
5345
5265
|
|
|
5346
5266
|
See also: [Chain](./client.md#type-chain), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi), [ChaintracksOptions](./services.md#interface-chaintracksoptions)
|
|
@@ -5351,7 +5271,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5351
5271
|
##### Function: createDefaultKnexChaintracksOptions
|
|
5352
5272
|
|
|
5353
5273
|
```ts
|
|
5354
|
-
export function createDefaultKnexChaintracksOptions(chain: Chain, rootFolder
|
|
5274
|
+
export function createDefaultKnexChaintracksOptions(chain: Chain, rootFolder = "./data/", knexConfig?: Knex.Config, whatsonchainApiKey = "", maxPerFile = 100000, maxRetained = 2, fetch?: ChaintracksFetchApi, cdnUrl = "https://cdn.projectbabbage.com/blockheaders/", liveHeightThreshold = 2000, reorgHeightThreshold = 400, bulkMigrationChunkSize = 500, batchInsertLimit = 400, addLiveRecursionLimit = 36): ChaintracksOptions
|
|
5355
5275
|
```
|
|
5356
5276
|
|
|
5357
5277
|
See also: [Chain](./client.md#type-chain), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi), [ChaintracksOptions](./services.md#interface-chaintracksoptions)
|
|
@@ -5367,7 +5287,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5367
5287
|
##### Function: createDefaultNoDbChaintracksOptions
|
|
5368
5288
|
|
|
5369
5289
|
```ts
|
|
5370
|
-
export function createDefaultNoDbChaintracksOptions(chain: Chain, whatsonchainApiKey
|
|
5290
|
+
export function createDefaultNoDbChaintracksOptions(chain: Chain, whatsonchainApiKey = "", maxPerFile = 100000, maxRetained = 2, fetch?: ChaintracksFetchApi, cdnUrl = "https://cdn.projectbabbage.com/blockheaders/", liveHeightThreshold = 2000, reorgHeightThreshold = 400, bulkMigrationChunkSize = 500, batchInsertLimit = 400, addLiveRecursionLimit = 36): ChaintracksOptions
|
|
5371
5291
|
```
|
|
5372
5292
|
|
|
5373
5293
|
See also: [Chain](./client.md#type-chain), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi), [ChaintracksOptions](./services.md#interface-chaintracksoptions)
|
|
@@ -5389,7 +5309,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5389
5309
|
##### Function: createIdbChaintracks
|
|
5390
5310
|
|
|
5391
5311
|
```ts
|
|
5392
|
-
export async function createIdbChaintracks(chain: Chain, whatsonchainApiKey
|
|
5312
|
+
export async function createIdbChaintracks(chain: Chain, whatsonchainApiKey = "", maxPerFile = 100000, maxRetained = 2, fetch?: ChaintracksFetchApi, cdnUrl = "https://cdn.projectbabbage.com/blockheaders/", liveHeightThreshold = 2000, reorgHeightThreshold = 400, bulkMigrationChunkSize = 500, batchInsertLimit = 400, addLiveRecursionLimit = 36): Promise<{
|
|
5393
5313
|
chain: Chain;
|
|
5394
5314
|
maxPerFile: number;
|
|
5395
5315
|
fetch: ChaintracksFetchApi;
|
|
@@ -5407,7 +5327,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5407
5327
|
##### Function: createKnexChaintracks
|
|
5408
5328
|
|
|
5409
5329
|
```ts
|
|
5410
|
-
export async function createKnexChaintracks(chain: Chain, rootFolder
|
|
5330
|
+
export async function createKnexChaintracks(chain: Chain, rootFolder = "./data/", knexConfig?: Knex.Config, whatsonchainApiKey = "", maxPerFile = 100000, maxRetained = 2, fetch?: ChaintracksFetchApi, cdnUrl = "https://cdn.projectbabbage.com/blockheaders/", liveHeightThreshold = 2000, reorgHeightThreshold = 400, bulkMigrationChunkSize = 500, batchInsertLimit = 400, addLiveRecursionLimit = 36): Promise<{
|
|
5411
5331
|
chain: Chain;
|
|
5412
5332
|
maxPerFile: number;
|
|
5413
5333
|
fetch: ChaintracksFetchApi;
|
|
@@ -5425,7 +5345,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5425
5345
|
##### Function: createNoDbChaintracks
|
|
5426
5346
|
|
|
5427
5347
|
```ts
|
|
5428
|
-
export async function createNoDbChaintracks(chain: Chain, whatsonchainApiKey
|
|
5348
|
+
export async function createNoDbChaintracks(chain: Chain, whatsonchainApiKey = "", maxPerFile = 100000, maxRetained = 2, fetch?: ChaintracksFetchApi, cdnUrl = "https://cdn.projectbabbage.com/blockheaders/", liveHeightThreshold = 2000, reorgHeightThreshold = 400, bulkMigrationChunkSize = 500, batchInsertLimit = 400, addLiveRecursionLimit = 36): Promise<{
|
|
5429
5349
|
chain: Chain;
|
|
5430
5350
|
maxPerFile: number;
|
|
5431
5351
|
fetch: ChaintracksFetchApi;
|
|
@@ -5478,7 +5398,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5478
5398
|
##### Function: deserializeBlockHeader
|
|
5479
5399
|
|
|
5480
5400
|
```ts
|
|
5481
|
-
export function deserializeBlockHeader(buffer: number[] | Uint8Array, offset = 0
|
|
5401
|
+
export function deserializeBlockHeader(buffer: number[] | Uint8Array, height: number, offset = 0): BlockHeader
|
|
5482
5402
|
```
|
|
5483
5403
|
|
|
5484
5404
|
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
@@ -5543,7 +5463,7 @@ export function genesisHeader(chain: Chain): BlockHeader {
|
|
|
5543
5463
|
hash: "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943"
|
|
5544
5464
|
};
|
|
5545
5465
|
case "mock":
|
|
5546
|
-
throw new Error(
|
|
5466
|
+
throw new Error("genesisHeader does not support 'mock' chain. Mock chain generates its own genesis block.");
|
|
5547
5467
|
}
|
|
5548
5468
|
}
|
|
5549
5469
|
```
|
|
@@ -5585,18 +5505,82 @@ See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#
|
|
|
5585
5505
|
|
|
5586
5506
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5587
5507
|
|
|
5508
|
+
---
|
|
5509
|
+
##### Function: handlePostRawTxErrorResponse
|
|
5510
|
+
|
|
5511
|
+
Classify an error-status WoC response and mutate `r` accordingly.
|
|
5512
|
+
|
|
5513
|
+
```ts
|
|
5514
|
+
export function handlePostRawTxErrorResponse(r: PostTxResultForTxid, nne: () => Record<string, unknown>, response: {
|
|
5515
|
+
data?: unknown;
|
|
5516
|
+
statusText?: unknown;
|
|
5517
|
+
status?: unknown;
|
|
5518
|
+
ok?: boolean;
|
|
5519
|
+
}): void
|
|
5520
|
+
```
|
|
5521
|
+
|
|
5522
|
+
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
5523
|
+
|
|
5524
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5525
|
+
|
|
5526
|
+
---
|
|
5527
|
+
##### Function: handleScriptHashHistoryCatch
|
|
5528
|
+
|
|
5529
|
+
Decide whether a caught error is retryable for script-hash history calls.
|
|
5530
|
+
If not retryable, sets `r.error` and returns false.
|
|
5531
|
+
|
|
5532
|
+
```ts
|
|
5533
|
+
export function handleScriptHashHistoryCatch(r: GetScriptHashHistoryResult, error_: unknown, url: string, methodName: string, retry: number, maxRetry: number): boolean
|
|
5534
|
+
```
|
|
5535
|
+
|
|
5536
|
+
See also: [GetScriptHashHistoryResult](./client.md#interface-getscripthashhistoryresult)
|
|
5537
|
+
|
|
5538
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5539
|
+
|
|
5540
|
+
---
|
|
5541
|
+
##### Function: handleScriptHashHistoryResponse
|
|
5542
|
+
|
|
5543
|
+
Inspect a WoC script-hash history response and update `r` in-place.
|
|
5544
|
+
|
|
5545
|
+
Returns:
|
|
5546
|
+
- `'continue'` — rate-limited, caller should retry
|
|
5547
|
+
- `'return'` — done, caller should return `r`
|
|
5548
|
+
- `'ok'` — response was successful, continue parsing
|
|
5549
|
+
|
|
5550
|
+
```ts
|
|
5551
|
+
export function handleScriptHashHistoryResponse(r: GetScriptHashHistoryResult, response: ScriptHashHistoryResponse, methodName: string, retry: number): "continue" | "return" | "ok"
|
|
5552
|
+
```
|
|
5553
|
+
|
|
5554
|
+
See also: [GetScriptHashHistoryResult](./client.md#interface-getscripthashhistoryresult), [ScriptHashHistoryResponse](./services.md#interface-scripthashhistoryresponse)
|
|
5555
|
+
|
|
5556
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5557
|
+
|
|
5558
|
+
---
|
|
5559
|
+
##### Function: handleUtxoConnReset
|
|
5560
|
+
|
|
5561
|
+
Decide whether the ECONNRESET error is retryable and, if not, set `r.error`.
|
|
5562
|
+
Returns true when the caller should retry, false when it should return.
|
|
5563
|
+
|
|
5564
|
+
```ts
|
|
5565
|
+
export function handleUtxoConnReset(r: GetUtxoStatusResult, error_: unknown, url: string, retry: number, maxRetry: number): boolean
|
|
5566
|
+
```
|
|
5567
|
+
|
|
5568
|
+
See also: [GetUtxoStatusResult](./client.md#interface-getutxostatusresult)
|
|
5569
|
+
|
|
5570
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5571
|
+
|
|
5588
5572
|
---
|
|
5589
5573
|
##### Function: isBaseBlockHeader
|
|
5590
5574
|
|
|
5591
5575
|
Type guard function.
|
|
5592
5576
|
|
|
5593
5577
|
```ts
|
|
5594
|
-
export function isBaseBlockHeader(header:
|
|
5578
|
+
export function isBaseBlockHeader(header: AnyBlockHeader): header is BaseBlockHeader {
|
|
5595
5579
|
return typeof header.previousHash === "string";
|
|
5596
5580
|
}
|
|
5597
5581
|
```
|
|
5598
5582
|
|
|
5599
|
-
See also: [
|
|
5583
|
+
See also: [AnyBlockHeader](./services.md#type-anyblockheader), [BaseBlockHeader](./client.md#interface-baseblockheader)
|
|
5600
5584
|
|
|
5601
5585
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5602
5586
|
|
|
@@ -5606,12 +5590,12 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5606
5590
|
Type guard function.
|
|
5607
5591
|
|
|
5608
5592
|
```ts
|
|
5609
|
-
export function isBlockHeader(header:
|
|
5593
|
+
export function isBlockHeader(header: AnyBlockHeader): header is LiveBlockHeader {
|
|
5610
5594
|
return "height" in header && typeof header.previousHash === "string";
|
|
5611
5595
|
}
|
|
5612
5596
|
```
|
|
5613
5597
|
|
|
5614
|
-
See also: [
|
|
5598
|
+
See also: [AnyBlockHeader](./services.md#type-anyblockheader), [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
5615
5599
|
|
|
5616
5600
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5617
5601
|
|
|
@@ -5638,17 +5622,16 @@ The following properties must match:
|
|
|
5638
5622
|
|
|
5639
5623
|
```ts
|
|
5640
5624
|
export function isKnownValidBulkHeaderFile(vbf: BulkHeaderFileInfo): boolean {
|
|
5641
|
-
if (!vbf
|
|
5625
|
+
if (!vbf?.fileHash)
|
|
5642
5626
|
return false;
|
|
5643
5627
|
const bf = validBulkHeaderFilesByFileHash()[vbf.fileHash];
|
|
5644
|
-
if (
|
|
5645
|
-
bf
|
|
5646
|
-
bf
|
|
5647
|
-
bf
|
|
5648
|
-
bf
|
|
5649
|
-
bf
|
|
5650
|
-
bf
|
|
5651
|
-
bf.chain !== vbf.chain) {
|
|
5628
|
+
if (bf?.firstHeight !== vbf.firstHeight ||
|
|
5629
|
+
bf?.count !== vbf.count ||
|
|
5630
|
+
bf?.prevChainWork !== vbf.prevChainWork ||
|
|
5631
|
+
bf?.prevHash !== vbf.prevHash ||
|
|
5632
|
+
bf?.lastChainWork !== vbf.lastChainWork ||
|
|
5633
|
+
bf?.lastHash !== vbf.lastHash ||
|
|
5634
|
+
bf?.chain !== vbf.chain) {
|
|
5652
5635
|
return false;
|
|
5653
5636
|
}
|
|
5654
5637
|
return true;
|
|
@@ -5684,12 +5667,12 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5684
5667
|
Type guard function.
|
|
5685
5668
|
|
|
5686
5669
|
```ts
|
|
5687
|
-
export function isLiveBlockHeader(header:
|
|
5670
|
+
export function isLiveBlockHeader(header: AnyBlockHeader): header is LiveBlockHeader {
|
|
5688
5671
|
return "chainwork" in header && typeof header.previousHash === "string";
|
|
5689
5672
|
}
|
|
5690
5673
|
```
|
|
5691
5674
|
|
|
5692
|
-
See also: [
|
|
5675
|
+
See also: [AnyBlockHeader](./services.md#type-anyblockheader), [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
5693
5676
|
|
|
5694
5677
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5695
5678
|
|
|
@@ -5704,6 +5687,35 @@ export function isMoreWork(work1: string, work2: string): boolean
|
|
|
5704
5687
|
|
|
5705
5688
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5706
5689
|
|
|
5690
|
+
---
|
|
5691
|
+
##### Function: makeMerklePathNote
|
|
5692
|
+
|
|
5693
|
+
```ts
|
|
5694
|
+
export function makeMerklePathNote(what: MerklePathNoteWhat, name: string, extra: Partial<MerklePathNote> = {}): MerklePathNote
|
|
5695
|
+
```
|
|
5696
|
+
|
|
5697
|
+
See also: [MerklePathNote](./services.md#interface-merklepathnote), [MerklePathNoteWhat](./services.md#type-merklepathnotewhat)
|
|
5698
|
+
|
|
5699
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5700
|
+
|
|
5701
|
+
---
|
|
5702
|
+
##### Function: populateUtxoDetails
|
|
5703
|
+
|
|
5704
|
+
Populate UTXO details from a WoC result array
|
|
5705
|
+
|
|
5706
|
+
```ts
|
|
5707
|
+
export function populateUtxoDetails(r: GetUtxoStatusResult, result: Array<{
|
|
5708
|
+
tx_hash: string;
|
|
5709
|
+
value: number;
|
|
5710
|
+
height: number;
|
|
5711
|
+
tx_pos: number;
|
|
5712
|
+
}>, outpoint?: string): void
|
|
5713
|
+
```
|
|
5714
|
+
|
|
5715
|
+
See also: [GetUtxoStatusResult](./client.md#interface-getutxostatusresult)
|
|
5716
|
+
|
|
5717
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5718
|
+
|
|
5707
5719
|
---
|
|
5708
5720
|
##### Function: readUInt32BE
|
|
5709
5721
|
|
|
@@ -5751,7 +5763,7 @@ export function serializeBaseBlockHeader(header: BaseBlockHeader, buffer?: numbe
|
|
|
5751
5763
|
writer.writeUInt32LE(header.bits);
|
|
5752
5764
|
writer.writeUInt32LE(header.nonce);
|
|
5753
5765
|
const data = writer.toArray();
|
|
5754
|
-
if (buffer) {
|
|
5766
|
+
if (buffer != null) {
|
|
5755
5767
|
offset ||= 0;
|
|
5756
5768
|
for (let i = 0; i < data.length; i++) {
|
|
5757
5769
|
if (offset + i >= buffer.length) {
|
|
@@ -6104,17 +6116,31 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6104
6116
|
|
|
6105
6117
|
| |
|
|
6106
6118
|
| --- |
|
|
6119
|
+
| [AnyBlockHeader](#type-anyblockheader) |
|
|
6107
6120
|
| [EnqueueHandler](#type-enqueuehandler) |
|
|
6108
6121
|
| [ErrorHandler](#type-errorhandler) |
|
|
6109
6122
|
| [HeaderListener](#type-headerlistener) |
|
|
6110
6123
|
| [InsertHeaderResult](#type-insertheaderresult) |
|
|
6124
|
+
| [MerklePathNoteWhat](#type-merklepathnotewhat) |
|
|
6111
6125
|
| [ReorgListener](#type-reorglistener) |
|
|
6112
|
-
| [StopListenerToken](#type-stoplistenertoken) |
|
|
6113
6126
|
|
|
6114
6127
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6115
6128
|
|
|
6116
6129
|
---
|
|
6117
6130
|
|
|
6131
|
+
##### Type: AnyBlockHeader
|
|
6132
|
+
|
|
6133
|
+
Union of all block header variants
|
|
6134
|
+
|
|
6135
|
+
```ts
|
|
6136
|
+
export type AnyBlockHeader = BaseBlockHeader | BlockHeader | LiveBlockHeader
|
|
6137
|
+
```
|
|
6138
|
+
|
|
6139
|
+
See also: [BaseBlockHeader](./client.md#interface-baseblockheader), [BlockHeader](./client.md#interface-blockheader), [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
6140
|
+
|
|
6141
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6142
|
+
|
|
6143
|
+
---
|
|
6118
6144
|
##### Type: EnqueueHandler
|
|
6119
6145
|
|
|
6120
6146
|
```ts
|
|
@@ -6170,25 +6196,23 @@ See also: [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
|
6170
6196
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6171
6197
|
|
|
6172
6198
|
---
|
|
6173
|
-
##### Type:
|
|
6199
|
+
##### Type: MerklePathNoteWhat
|
|
6174
6200
|
|
|
6175
6201
|
```ts
|
|
6176
|
-
export type
|
|
6202
|
+
export type MerklePathNoteWhat = "getMerklePathRetry" | "getMerklePathNotFound" | "getMerklePathBadStatus" | "getMerklePathNoData" | "getMerklePathSuccess" | "getMerklePathNoHeader" | "getMerklePathError" | "getMerklePathInternal"
|
|
6177
6203
|
```
|
|
6178
6204
|
|
|
6179
|
-
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
6180
|
-
|
|
6181
6205
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6182
6206
|
|
|
6183
6207
|
---
|
|
6184
|
-
##### Type:
|
|
6208
|
+
##### Type: ReorgListener
|
|
6185
6209
|
|
|
6186
6210
|
```ts
|
|
6187
|
-
export type
|
|
6188
|
-
stop: (() => void) | undefined;
|
|
6189
|
-
}
|
|
6211
|
+
export type ReorgListener = (depth: number, oldTip: BlockHeader, newTip: BlockHeader, deactivatedHeaders?: BlockHeader[]) => void
|
|
6190
6212
|
```
|
|
6191
6213
|
|
|
6214
|
+
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
6215
|
+
|
|
6192
6216
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6193
6217
|
|
|
6194
6218
|
---
|