@bopen-io/wallet-toolbox 2.15.0-bopen.1 → 2.15.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/CHANGELOG.md +183 -45
- package/README.md +134 -98
- package/docs/client.md +2947 -3080
- package/docs/monitor.md +154 -165
- package/docs/no-send-expiry.md +7 -2
- package/docs/services.md +822 -885
- package/docs/setup.md +1 -46
- package/docs/storage.md +1636 -1654
- package/docs/wallet.md +1975 -2132
- package/out/src/CWIStyleWalletManager.d.ts +36 -5
- package/out/src/CWIStyleWalletManager.d.ts.map +1 -1
- package/out/src/CWIStyleWalletManager.js +356 -60
- package/out/src/CWIStyleWalletManager.js.map +1 -1
- package/out/src/Setup.d.ts +0 -10
- package/out/src/Setup.d.ts.map +1 -1
- package/out/src/Setup.js +0 -24
- package/out/src/Setup.js.map +1 -1
- package/out/src/Wallet.d.ts.map +1 -1
- package/out/src/Wallet.js +8 -3
- package/out/src/Wallet.js.map +1 -1
- package/out/src/WalletAuthenticationManager.d.ts +3 -0
- package/out/src/WalletAuthenticationManager.d.ts.map +1 -1
- package/out/src/WalletAuthenticationManager.js +86 -3
- package/out/src/WalletAuthenticationManager.js.map +1 -1
- package/out/src/WalletPermissionsManager.d.ts +63 -9
- package/out/src/WalletPermissionsManager.d.ts.map +1 -1
- package/out/src/WalletPermissionsManager.js +213 -49
- package/out/src/WalletPermissionsManager.js.map +1 -1
- package/out/src/monitor/Monitor.js +1 -1
- package/out/src/monitor/Monitor.js.map +1 -1
- package/out/src/monitor/MonitorDaemon.d.ts +0 -2
- package/out/src/monitor/MonitorDaemon.d.ts.map +1 -1
- package/out/src/monitor/MonitorDaemon.js +1 -9
- package/out/src/monitor/MonitorDaemon.js.map +1 -1
- package/out/src/monitor/monitorValidation.d.ts +2 -1
- package/out/src/monitor/monitorValidation.d.ts.map +1 -1
- package/out/src/monitor/monitorValidation.js +2 -2
- package/out/src/monitor/monitorValidation.js.map +1 -1
- package/out/src/monitor/tasks/TaskNewHeader.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskNewHeader.js +1 -1
- package/out/src/monitor/tasks/TaskNewHeader.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewUtxos.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReviewUtxos.js +2 -1
- package/out/src/monitor/tasks/TaskReviewUtxos.js.map +1 -1
- package/out/src/sdk/WERR_errors.d.ts +4 -0
- package/out/src/sdk/WERR_errors.d.ts.map +1 -1
- package/out/src/sdk/WERR_errors.js +4 -0
- package/out/src/sdk/WERR_errors.js.map +1 -1
- package/out/src/sdk/WalletErrorFromJson.d.ts.map +1 -1
- package/out/src/sdk/WalletErrorFromJson.js +23 -2
- package/out/src/sdk/WalletErrorFromJson.js.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts +11 -0
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/sdk/types.d.ts +12 -1
- package/out/src/sdk/types.d.ts.map +1 -1
- package/out/src/sdk/types.js +19 -2
- package/out/src/sdk/types.js.map +1 -1
- package/out/src/services/Services.d.ts.map +1 -1
- package/out/src/services/Services.js +5 -3
- package/out/src/services/Services.js.map +1 -1
- package/out/src/services/chaintracker/BHServiceClient.js +2 -2
- package/out/src/services/chaintracker/BHServiceClient.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Chaintracks.js +2 -2
- package/out/src/services/chaintracker/chaintracks/Chaintracks.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +3 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.js +3 -1
- package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.js.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/LiveIngestorBase.js +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorChaintracksSSE.js +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorChaintracksSSE.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.js +2 -0
- package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.js +2 -2
- package/out/src/services/chaintracker/chaintracks/Storage/BulkStorageBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.js +6 -6
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageBase.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.js +2 -2
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageIdb.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.d.ts +0 -5
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.js +5 -13
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.d.ts +1 -0
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.js +11 -3
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js +13 -9
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.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 +2 -2
- package/out/src/services/chaintracker/chaintracks/util/BulkFilesReader.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/InlineBulkFileDataValidator.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/InlineBulkFileDataValidator.js +2 -2
- package/out/src/services/chaintracker/chaintracks/util/InlineBulkFileDataValidator.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.d.ts +23 -5
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js +58 -16
- package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js.map +1 -1
- package/out/src/services/createDefaultWalletServicesOptions.d.ts +6 -3
- package/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -1
- package/out/src/services/createDefaultWalletServicesOptions.js +18 -6
- package/out/src/services/createDefaultWalletServicesOptions.js.map +1 -1
- package/out/src/services/networkConfig.d.ts +7 -0
- package/out/src/services/networkConfig.d.ts.map +1 -1
- package/out/src/services/networkConfig.js +25 -2
- package/out/src/services/networkConfig.js.map +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.d.ts +8 -2
- package/out/src/services/providers/SdkWhatsOnChain.d.ts.map +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.js +17 -6
- package/out/src/services/providers/SdkWhatsOnChain.js.map +1 -1
- package/out/src/services/validateMerklePathResult.d.ts +4 -3
- package/out/src/services/validateMerklePathResult.d.ts.map +1 -1
- package/out/src/services/validateMerklePathResult.js +6 -6
- package/out/src/services/validateMerklePathResult.js.map +1 -1
- package/out/src/signer/actionBatch/ActionBatchWorkspace.d.ts.map +1 -1
- package/out/src/signer/actionBatch/ActionBatchWorkspace.js +3 -2
- package/out/src/signer/actionBatch/ActionBatchWorkspace.js.map +1 -1
- package/out/src/signer/methods/createAction.d.ts +32 -1
- package/out/src/signer/methods/createAction.d.ts.map +1 -1
- package/out/src/signer/methods/createAction.js +56 -1
- package/out/src/signer/methods/createAction.js.map +1 -1
- package/out/src/signer/methods/internalizeAction.js +1 -1
- package/out/src/signer/methods/internalizeAction.js.map +1 -1
- package/out/src/signer/methods/signAction.js +8 -1
- package/out/src/signer/methods/signAction.js.map +1 -1
- package/out/src/storage/StorageIdb.js +4 -4
- package/out/src/storage/StorageIdb.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts +6 -5
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +321 -115
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
- package/out/src/storage/WalletStorageManager.js +5 -0
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/adminServer/adminServer.d.ts.map +1 -1
- package/out/src/storage/adminServer/adminServer.js +41 -3
- package/out/src/storage/adminServer/adminServer.js.map +1 -1
- package/out/src/storage/index.all.d.ts +0 -1
- package/out/src/storage/index.all.d.ts.map +1 -1
- package/out/src/storage/index.all.js +0 -1
- package/out/src/storage/index.all.js.map +1 -1
- package/out/src/storage/methods/ListOutputsSpecOp.d.ts.map +1 -1
- package/out/src/storage/methods/ListOutputsSpecOp.js +84 -0
- package/out/src/storage/methods/ListOutputsSpecOp.js.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js +7 -3
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -1
- package/out/src/storage/methods/createAction.d.ts +5 -0
- package/out/src/storage/methods/createAction.d.ts.map +1 -1
- package/out/src/storage/methods/createAction.js +13 -6
- package/out/src/storage/methods/createAction.js.map +1 -1
- package/out/src/storage/methods/generateChange.d.ts +6 -0
- package/out/src/storage/methods/generateChange.d.ts.map +1 -1
- package/out/src/storage/methods/generateChange.js +10 -3
- package/out/src/storage/methods/generateChange.js.map +1 -1
- package/out/src/storage/methods/internalizeAction.d.ts +8 -1
- package/out/src/storage/methods/internalizeAction.d.ts.map +1 -1
- package/out/src/storage/methods/internalizeAction.js +106 -42
- package/out/src/storage/methods/internalizeAction.js.map +1 -1
- package/out/src/storage/methods/listActionsKnex.d.ts.map +1 -1
- package/out/src/storage/methods/listActionsKnex.js +1 -0
- 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 +2 -1
- package/out/src/storage/methods/listOutputsKnex.js.map +1 -1
- package/out/src/storage/methods/noSendExpiry.d.ts.map +1 -1
- package/out/src/storage/methods/noSendExpiry.js +14 -4
- package/out/src/storage/methods/noSendExpiry.js.map +1 -1
- package/out/src/storage/methods/purgeData.d.ts.map +1 -1
- package/out/src/storage/methods/purgeData.js +3 -0
- 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 +3 -0
- package/out/src/storage/methods/reviewStatus.js.map +1 -1
- package/out/src/storage/portable/index.js +12 -38
- package/out/src/storage/portable/index.js.map +1 -1
- package/out/src/storage/remoting/StorageClientBase.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageClientBase.js +15 -5
- package/out/src/storage/remoting/StorageClientBase.js.map +1 -1
- package/out/src/storage/remoting/StorageServer.d.ts +4 -17
- package/out/src/storage/remoting/StorageServer.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageServer.js +25 -23
- package/out/src/storage/remoting/StorageServer.js.map +1 -1
- package/out/src/storage/remoting/syncChunkBinary.d.ts +10 -0
- package/out/src/storage/remoting/syncChunkBinary.d.ts.map +1 -1
- package/out/src/storage/remoting/syncChunkBinary.js +15 -11
- package/out/src/storage/remoting/syncChunkBinary.js.map +1 -1
- package/out/src/storage/schema/KnexMigrations.d.ts +3 -7
- package/out/src/storage/schema/KnexMigrations.d.ts.map +1 -1
- package/out/src/storage/schema/KnexMigrations.js +86 -166
- package/out/src/storage/schema/KnexMigrations.js.map +1 -1
- package/out/src/storage/sync/liveSyncGuards.d.ts +11 -0
- package/out/src/storage/sync/liveSyncGuards.d.ts.map +1 -0
- package/out/src/storage/sync/liveSyncGuards.js +22 -0
- package/out/src/storage/sync/liveSyncGuards.js.map +1 -0
- package/out/src/utility/actionOutputAuthorizations.d.ts +10 -0
- package/out/src/utility/actionOutputAuthorizations.d.ts.map +1 -0
- package/out/src/utility/actionOutputAuthorizations.js +25 -0
- package/out/src/utility/actionOutputAuthorizations.js.map +1 -0
- 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/numericTotalOutputs.d.ts +7 -0
- package/out/src/utility/numericTotalOutputs.d.ts.map +1 -0
- package/out/src/utility/numericTotalOutputs.js +15 -0
- package/out/src/utility/numericTotalOutputs.js.map +1 -0
- package/out/src/utility/utilityHelpers.d.ts.map +1 -1
- package/out/src/utility/utilityHelpers.js +2 -0
- package/out/src/utility/utilityHelpers.js.map +1 -1
- package/package.json +19 -24
- package/out/src/storage/adminServer/reqReviewQuery.d.ts +0 -41
- package/out/src/storage/adminServer/reqReviewQuery.d.ts.map +0 -1
- package/out/src/storage/adminServer/reqReviewQuery.js +0 -67
- package/out/src/storage/adminServer/reqReviewQuery.js.map +0 -1
- package/out/src/storage/knexPostgres.d.ts +0 -16
- package/out/src/storage/knexPostgres.d.ts.map +0 -1
- package/out/src/storage/knexPostgres.js +0 -34
- package/out/src/storage/knexPostgres.js.map +0 -1
package/docs/services.md
CHANGED
|
@@ -1537,7 +1537,6 @@ Chaintracks client API excluding events and callbacks
|
|
|
1537
1537
|
|
|
1538
1538
|
```ts
|
|
1539
1539
|
export interface ChaintracksClientApi extends ChainTracker {
|
|
1540
|
-
readonly supportsReorgEvents?: boolean;
|
|
1541
1540
|
getChain(): Promise<Chain>;
|
|
1542
1541
|
getInfo(): Promise<ChaintracksInfoApi>;
|
|
1543
1542
|
getPresentHeight(): Promise<number>;
|
|
@@ -1561,17 +1560,6 @@ export interface ChaintracksClientApi extends ChainTracker {
|
|
|
1561
1560
|
|
|
1562
1561
|
See also: [BaseBlockHeader](./client.md#interface-baseblockheader), [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [ChaintracksInfoApi](./services.md#interface-chaintracksinfoapi), [HeaderListener](./services.md#type-headerlistener), [ReorgListener](./services.md#type-reorglistener)
|
|
1563
1562
|
|
|
1564
|
-
###### Property supportsReorgEvents
|
|
1565
|
-
|
|
1566
|
-
Additive reorg-event capability. Method presence is not capability:
|
|
1567
|
-
`false` means subscribe/unsubscribe are unsupported stubs and must not be
|
|
1568
|
-
called; `true` promises working registration whose failures must propagate.
|
|
1569
|
-
Omit to infer from a callable `subscribeReorgs` implementation.
|
|
1570
|
-
|
|
1571
|
-
```ts
|
|
1572
|
-
readonly supportsReorgEvents?: boolean
|
|
1573
|
-
```
|
|
1574
|
-
|
|
1575
1563
|
###### Method addHeader
|
|
1576
1564
|
|
|
1577
1565
|
Submit a possibly new header for adding
|
|
@@ -2197,7 +2185,6 @@ export interface ChaintracksServiceOptions {
|
|
|
2197
2185
|
http?: Partial<HttpServerPolicyDefaults>;
|
|
2198
2186
|
maxRequestsPerMinute?: number;
|
|
2199
2187
|
maxHeaderSubmissionsPerMinute?: number;
|
|
2200
|
-
trustProxy?: boolean | number | string | string[];
|
|
2201
2188
|
maxHeadersPerRequest?: number;
|
|
2202
2189
|
maxWaitMsecs?: number;
|
|
2203
2190
|
logRequests?: boolean;
|
|
@@ -2233,7 +2220,7 @@ logRequests?: boolean
|
|
|
2233
2220
|
|
|
2234
2221
|
###### Property maxHeaderSubmissionsPerMinute
|
|
2235
2222
|
|
|
2236
|
-
|
|
2223
|
+
Process-global header submissions allowed per minute. Defaults to 120.
|
|
2237
2224
|
|
|
2238
2225
|
```ts
|
|
2239
2226
|
maxHeaderSubmissionsPerMinute?: number
|
|
@@ -2249,7 +2236,7 @@ maxHeadersPerRequest?: number
|
|
|
2249
2236
|
|
|
2250
2237
|
###### Property maxRequestsPerMinute
|
|
2251
2238
|
|
|
2252
|
-
|
|
2239
|
+
Process-global request starts allowed per minute. Defaults to 3,000.
|
|
2253
2240
|
|
|
2254
2241
|
```ts
|
|
2255
2242
|
maxRequestsPerMinute?: number
|
|
@@ -2271,14 +2258,6 @@ prepended to the path of each registered service endpoint
|
|
|
2271
2258
|
routingPrefix: string
|
|
2272
2259
|
```
|
|
2273
2260
|
|
|
2274
|
-
###### Property trustProxy
|
|
2275
|
-
|
|
2276
|
-
Express trusted-proxy policy used to derive the client address. Disabled by default.
|
|
2277
|
-
|
|
2278
|
-
```ts
|
|
2279
|
-
trustProxy?: boolean | number | string | string[]
|
|
2280
|
-
```
|
|
2281
|
-
|
|
2282
2261
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2283
2262
|
|
|
2284
2263
|
---
|
|
@@ -4208,25 +4187,25 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4208
4187
|
|
|
4209
4188
|
| | | |
|
|
4210
4189
|
| --- | --- | --- |
|
|
4211
|
-
| [ARC](#class-arc) | [BulkIngestorChaintracks](#class-bulkingestorchaintracks) | [
|
|
4212
|
-
| [ArcSSEClient](#class-arcsseclient) | [BulkIngestorWhatsOnChainCdn](#class-bulkingestorwhatsonchaincdn) | [
|
|
4213
|
-
| [Arcade](#class-arcade) | [BulkIngestorWhatsOnChainWs](#class-bulkingestorwhatsonchainws) | [
|
|
4214
|
-
| [BHServiceClient](#class-bhserviceclient) | [BulkStorageBase](#class-bulkstoragebase) | [
|
|
4215
|
-
| [Bitails](#class-bitails) | [Chaintracks](#class-chaintracks) | [
|
|
4216
|
-
| [BulkFileDataCacheFs](#class-bulkfiledatacachefs) | [ChaintracksAppendableFile](#class-chaintracksappendablefile) | [
|
|
4217
|
-
| [BulkFileDataManager](#class-bulkfiledatamanager) | [ChaintracksChainTracker](#class-chaintrackschaintracker) | [
|
|
4218
|
-
| [BulkFileDataReader](#class-bulkfiledatareader) | [ChaintracksFetch](#class-chaintracksfetch) | [
|
|
4219
|
-
| [BulkFileDataValidationError](#class-bulkfiledatavalidationerror) | [ChaintracksFetchError](#class-chaintracksfetcherror) | [
|
|
4220
|
-
| [BulkFilesReader](#class-bulkfilesreader) | [ChaintracksFsStatics](#class-chaintracksfsstatics) | [
|
|
4221
|
-
| [BulkFilesReaderFs](#class-bulkfilesreaderfs) | [ChaintracksKnexMigrations](#class-chaintracksknexmigrations) | [
|
|
4222
|
-
| [BulkFilesReaderStorage](#class-bulkfilesreaderstorage) | [
|
|
4223
|
-
| [BulkHeaderFile](#class-bulkheaderfile) | [
|
|
4224
|
-
| [BulkHeaderFileFs](#class-bulkheaderfilefs) | [
|
|
4225
|
-
| [BulkHeaderFileStorage](#class-bulkheaderfilestorage) | [
|
|
4226
|
-
| [BulkHeaderFiles](#class-bulkheaderfiles) | [
|
|
4227
|
-
| [BulkIngestorBase](#class-bulkingestorbase) | [
|
|
4228
|
-
| [BulkIngestorCDN](#class-bulkingestorcdn) | [
|
|
4229
|
-
| [BulkIngestorCDNBabbage](#class-bulkingestorcdnbabbage) | [
|
|
4190
|
+
| [ARC](#class-arc) | [BulkIngestorChaintracks](#class-bulkingestorchaintracks) | [DurableFileBulkFileDownloadBudget](#class-durablefilebulkfiledownloadbudget) |
|
|
4191
|
+
| [ArcSSEClient](#class-arcsseclient) | [BulkIngestorWhatsOnChainCdn](#class-bulkingestorwhatsonchaincdn) | [FixedWindowBulkFileDownloadBudget](#class-fixedwindowbulkfiledownloadbudget) |
|
|
4192
|
+
| [Arcade](#class-arcade) | [BulkIngestorWhatsOnChainWs](#class-bulkingestorwhatsonchainws) | [GoChaintracksServiceClient](#class-gochaintracksserviceclient) |
|
|
4193
|
+
| [BHServiceClient](#class-bhserviceclient) | [BulkStorageBase](#class-bulkstoragebase) | [HeightRange](#class-heightrange) |
|
|
4194
|
+
| [Bitails](#class-bitails) | [Chaintracks](#class-chaintracks) | [InlineBulkFileDataValidator](#class-inlinebulkfiledatavalidator) |
|
|
4195
|
+
| [BulkFileDataCacheFs](#class-bulkfiledatacachefs) | [ChaintracksAppendableFile](#class-chaintracksappendablefile) | [LiveIngestorBase](#class-liveingestorbase) |
|
|
4196
|
+
| [BulkFileDataManager](#class-bulkfiledatamanager) | [ChaintracksChainTracker](#class-chaintrackschaintracker) | [LiveIngestorChaintracksSSE](#class-liveingestorchaintrackssse) |
|
|
4197
|
+
| [BulkFileDataReader](#class-bulkfiledatareader) | [ChaintracksFetch](#class-chaintracksfetch) | [LiveIngestorWhatsOnChainPoll](#class-liveingestorwhatsonchainpoll) |
|
|
4198
|
+
| [BulkFileDataValidationError](#class-bulkfiledatavalidationerror) | [ChaintracksFetchError](#class-chaintracksfetcherror) | [LiveIngestorWhatsOnChainWs](#class-liveingestorwhatsonchainws) |
|
|
4199
|
+
| [BulkFilesReader](#class-bulkfilesreader) | [ChaintracksFsStatics](#class-chaintracksfsstatics) | [LocalChainTracker](#class-localchaintracker) |
|
|
4200
|
+
| [BulkFilesReaderFs](#class-bulkfilesreaderfs) | [ChaintracksKnexMigrations](#class-chaintracksknexmigrations) | [NodeBulkFileDataValidator](#class-nodebulkfiledatavalidator) |
|
|
4201
|
+
| [BulkFilesReaderStorage](#class-bulkfilesreaderstorage) | [ChaintracksReadableFile](#class-chaintracksreadablefile) | [SdkWhatsOnChain](#class-sdkwhatsonchain) |
|
|
4202
|
+
| [BulkHeaderFile](#class-bulkheaderfile) | [ChaintracksService](#class-chaintracksservice) | [ServiceCollection](#class-servicecollection) |
|
|
4203
|
+
| [BulkHeaderFileFs](#class-bulkheaderfilefs) | [ChaintracksServiceClient](#class-chaintracksserviceclient) | [Services](#class-services) |
|
|
4204
|
+
| [BulkHeaderFileStorage](#class-bulkheaderfilestorage) | [ChaintracksStorageBase](#class-chaintracksstoragebase) | [SingleWriterMultiReaderLock](#class-singlewritermultireaderlock) |
|
|
4205
|
+
| [BulkHeaderFiles](#class-bulkheaderfiles) | [ChaintracksStorageIdb](#class-chaintracksstorageidb) | [WhatsOnChain](#class-whatsonchain) |
|
|
4206
|
+
| [BulkIngestorBase](#class-bulkingestorbase) | [ChaintracksStorageKnex](#class-chaintracksstorageknex) | [WhatsOnChainNoServices](#class-whatsonchainnoservices) |
|
|
4207
|
+
| [BulkIngestorCDN](#class-bulkingestorcdn) | [ChaintracksStorageNoDb](#class-chaintracksstoragenodb) | [WhatsOnChainServices](#class-whatsonchainservices) |
|
|
4208
|
+
| [BulkIngestorCDNBabbage](#class-bulkingestorcdnbabbage) | [ChaintracksWritableFile](#class-chaintrackswritablefile) | |
|
|
4230
4209
|
|
|
4231
4210
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4232
4211
|
|
|
@@ -4247,10 +4226,10 @@ export class ARC {
|
|
|
4247
4226
|
readonly headers: Record<string, string> | undefined;
|
|
4248
4227
|
constructor(URL: string, config?: ArcConfig, name?: string);
|
|
4249
4228
|
constructor(URL: string, apiKey?: string, name?: string);
|
|
4250
|
-
constructor(URL: string, config?: string | ArcConfig, name?: string)
|
|
4251
|
-
async postRawTx(rawTx: HexString, txids?: string[]): Promise<PostTxResultForTxid>
|
|
4252
|
-
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
4253
|
-
async getTxData(txid: string): Promise<ArcMinerGetTxData>
|
|
4229
|
+
constructor(URL: string, config?: string | ArcConfig, name?: string)
|
|
4230
|
+
async postRawTx(rawTx: HexString, txids?: string[]): Promise<PostTxResultForTxid>
|
|
4231
|
+
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
4232
|
+
async getTxData(txid: string): Promise<ArcMinerGetTxData>
|
|
4254
4233
|
}
|
|
4255
4234
|
```
|
|
4256
4235
|
|
|
@@ -4292,7 +4271,7 @@ Argument Details
|
|
|
4292
4271
|
This seems to only work for recently submitted txids...but that's all we need to complete postBeef!
|
|
4293
4272
|
|
|
4294
4273
|
```ts
|
|
4295
|
-
async getTxData(txid: string): Promise<ArcMinerGetTxData>
|
|
4274
|
+
async getTxData(txid: string): Promise<ArcMinerGetTxData>
|
|
4296
4275
|
```
|
|
4297
4276
|
See also: [ArcMinerGetTxData](./services.md#interface-arcminergettxdata)
|
|
4298
4277
|
|
|
@@ -4304,7 +4283,7 @@ It does process multiple new transactions, however, which allows results for all
|
|
|
4304
4283
|
to be collected by the `/v1/tx/${txid}` endpoint.
|
|
4305
4284
|
|
|
4306
4285
|
```ts
|
|
4307
|
-
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
4286
|
+
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
4308
4287
|
```
|
|
4309
4288
|
See also: [PostBeefResult](./client.md#interface-postbeefresult)
|
|
4310
4289
|
|
|
@@ -4319,7 +4298,7 @@ The ARC '/v1/tx' endpoint, as of 2025-02-17 DOES NOT support the following hex s
|
|
|
4319
4298
|
1. V2 serialized Beef
|
|
4320
4299
|
|
|
4321
4300
|
```ts
|
|
4322
|
-
async postRawTx(rawTx: HexString, txids?: string[]): Promise<PostTxResultForTxid>
|
|
4301
|
+
async postRawTx(rawTx: HexString, txids?: string[]): Promise<PostTxResultForTxid>
|
|
4323
4302
|
```
|
|
4324
4303
|
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
4325
4304
|
|
|
@@ -4330,11 +4309,11 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4330
4309
|
|
|
4331
4310
|
```ts
|
|
4332
4311
|
export class ArcSSEClient {
|
|
4333
|
-
constructor(options: ArcSSEClientOptions)
|
|
4334
|
-
get lastEventId(): string | undefined
|
|
4335
|
-
connect(): void
|
|
4336
|
-
close(): void
|
|
4337
|
-
async fetchEvents(): Promise<number>
|
|
4312
|
+
constructor(options: ArcSSEClientOptions)
|
|
4313
|
+
get lastEventId(): string | undefined
|
|
4314
|
+
connect(): void
|
|
4315
|
+
close(): void
|
|
4316
|
+
async fetchEvents(): Promise<number>
|
|
4338
4317
|
}
|
|
4339
4318
|
```
|
|
4340
4319
|
|
|
@@ -4345,7 +4324,7 @@ See also: [ArcSSEClientOptions](./services.md#interface-arcsseclientoptions)
|
|
|
4345
4324
|
Close the connection, discard unacknowledged network events, and reset lifecycle state.
|
|
4346
4325
|
|
|
4347
4326
|
```ts
|
|
4348
|
-
close(): void
|
|
4327
|
+
close(): void
|
|
4349
4328
|
```
|
|
4350
4329
|
|
|
4351
4330
|
###### Method connect
|
|
@@ -4353,7 +4332,7 @@ close(): void
|
|
|
4353
4332
|
Open the SSE connection. Events are processed serially in exact arrival order.
|
|
4354
4333
|
|
|
4355
4334
|
```ts
|
|
4356
|
-
connect(): void
|
|
4335
|
+
connect(): void
|
|
4357
4336
|
```
|
|
4358
4337
|
|
|
4359
4338
|
###### Method fetchEvents
|
|
@@ -4361,7 +4340,7 @@ connect(): void
|
|
|
4361
4340
|
Ensure a connection is open; events still commit asynchronously in arrival order.
|
|
4362
4341
|
|
|
4363
4342
|
```ts
|
|
4364
|
-
async fetchEvents(): Promise<number>
|
|
4343
|
+
async fetchEvents(): Promise<number>
|
|
4365
4344
|
```
|
|
4366
4345
|
|
|
4367
4346
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -4380,12 +4359,12 @@ export class Arcade {
|
|
|
4380
4359
|
readonly headers: Record<string, string> | undefined;
|
|
4381
4360
|
constructor(URL: string, config?: ArcConfig, name?: string);
|
|
4382
4361
|
constructor(URL: string, apiKey?: string, name?: string);
|
|
4383
|
-
constructor(URL: string, config?: string | ArcConfig, name?: string)
|
|
4384
|
-
async postRawTx(rawTx: HexString, txids?: string[]): Promise<PostTxResultForTxid>
|
|
4385
|
-
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
4386
|
-
async getTxData(txid: string): Promise<ArcMinerGetTxData>
|
|
4387
|
-
async getStatusForTxids(txids: string[]): Promise<GetStatusForTxidsResult>
|
|
4388
|
-
async getMerklePath(txid: string, services: WalletServices): Promise<GetMerklePathResult>
|
|
4362
|
+
constructor(URL: string, config?: string | ArcConfig, name?: string)
|
|
4363
|
+
async postRawTx(rawTx: HexString, txids?: string[]): Promise<PostTxResultForTxid>
|
|
4364
|
+
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
4365
|
+
async getTxData(txid: string): Promise<ArcMinerGetTxData>
|
|
4366
|
+
async getStatusForTxids(txids: string[]): Promise<GetStatusForTxidsResult>
|
|
4367
|
+
async getMerklePath(txid: string, services: WalletServices): Promise<GetMerklePathResult>
|
|
4389
4368
|
}
|
|
4390
4369
|
```
|
|
4391
4370
|
|
|
@@ -4413,7 +4392,7 @@ states remain unknown, while MINED/IMMUTABLE are authoritative mined
|
|
|
4413
4392
|
observations whose proof is validated separately.
|
|
4414
4393
|
|
|
4415
4394
|
```ts
|
|
4416
|
-
async getStatusForTxids(txids: string[]): Promise<GetStatusForTxidsResult>
|
|
4395
|
+
async getStatusForTxids(txids: string[]): Promise<GetStatusForTxidsResult>
|
|
4417
4396
|
```
|
|
4418
4397
|
See also: [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresult)
|
|
4419
4398
|
|
|
@@ -4422,7 +4401,7 @@ See also: [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresul
|
|
|
4422
4401
|
Look up a transaction's current status (and merkle path once mined) via `GET /tx/{txid}`.
|
|
4423
4402
|
|
|
4424
4403
|
```ts
|
|
4425
|
-
async getTxData(txid: string): Promise<ArcMinerGetTxData>
|
|
4404
|
+
async getTxData(txid: string): Promise<ArcMinerGetTxData>
|
|
4426
4405
|
```
|
|
4427
4406
|
See also: [ArcMinerGetTxData](./services.md#interface-arcminergettxdata)
|
|
4428
4407
|
|
|
@@ -4434,7 +4413,7 @@ Submit a single transaction to Arcade's `POST /tx` endpoint.
|
|
|
4434
4413
|
txid is taken from `txids` when supplied (Arcade derives the same txid from the parsed tx).
|
|
4435
4414
|
|
|
4436
4415
|
```ts
|
|
4437
|
-
async postRawTx(rawTx: HexString, txids?: string[]): Promise<PostTxResultForTxid>
|
|
4416
|
+
async postRawTx(rawTx: HexString, txids?: string[]): Promise<PostTxResultForTxid>
|
|
4438
4417
|
```
|
|
4439
4418
|
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
4440
4419
|
|
|
@@ -4445,51 +4424,42 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4445
4424
|
|
|
4446
4425
|
```ts
|
|
4447
4426
|
export class BHServiceClient implements ChaintracksClientApi {
|
|
4448
|
-
readonly supportsReorgEvents = false;
|
|
4449
4427
|
bhs: BlockHeadersService;
|
|
4450
4428
|
cache: Record<number, string>;
|
|
4451
4429
|
chain: Chain;
|
|
4452
4430
|
serviceUrl: string;
|
|
4453
4431
|
options: ChaintracksServiceClientOptions;
|
|
4454
4432
|
apiKey: string;
|
|
4455
|
-
constructor(chain: Chain, url: string, apiKey: string, options: ChaintracksServiceClientOptions = {})
|
|
4456
|
-
async currentHeight(): Promise<number>
|
|
4457
|
-
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
4458
|
-
async getPresentHeight(): Promise<number>
|
|
4459
|
-
async findHeaderForHeight(height: number): Promise<BlockHeader | undefined>
|
|
4460
|
-
async findHeaderForBlockHash(hash: string): Promise<BlockHeader | undefined>
|
|
4461
|
-
async getHeaders(height: number, count: number): Promise<string>
|
|
4462
|
-
async findChainWorkForBlockHash(_hash: string): Promise<string | undefined>
|
|
4463
|
-
async findChainTipHeader(): Promise<BlockHeader>
|
|
4464
|
-
async getJsonOrUndefined<T>(path: string): Promise<T | undefined>
|
|
4465
|
-
async getJson<T>(path: string): Promise<T>
|
|
4466
|
-
async postJsonVoid<T>(_path: string, _params: T): Promise<void>
|
|
4467
|
-
async addHeader(_header: any): Promise<void>
|
|
4468
|
-
async findHeaderForMerkleRoot(_merkleRoot: string, _height?: number): Promise<undefined>
|
|
4469
|
-
async startListening(): Promise<void>
|
|
4470
|
-
async listening(): Promise<void>
|
|
4471
|
-
async isSynchronized(): Promise<boolean>
|
|
4472
|
-
async getChain(): Promise<Chain>
|
|
4473
|
-
async isListening(): Promise<boolean>
|
|
4474
|
-
async getChainTipHeader(): Promise<BlockHeader>
|
|
4475
|
-
async findChainTipHash(): Promise<string>
|
|
4476
|
-
async subscribeHeaders(_listener: HeaderListener): Promise<string>
|
|
4477
|
-
async subscribeReorgs(_listener: ReorgListener): Promise<string>
|
|
4478
|
-
async unsubscribe(_subscriptionId: string): Promise<boolean>
|
|
4479
|
-
async getInfo(): Promise<ChaintracksInfoApi>
|
|
4433
|
+
constructor(chain: Chain, url: string, apiKey: string, options: ChaintracksServiceClientOptions = {})
|
|
4434
|
+
async currentHeight(): Promise<number>
|
|
4435
|
+
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
4436
|
+
async getPresentHeight(): Promise<number>
|
|
4437
|
+
async findHeaderForHeight(height: number): Promise<BlockHeader | undefined>
|
|
4438
|
+
async findHeaderForBlockHash(hash: string): Promise<BlockHeader | undefined>
|
|
4439
|
+
async getHeaders(height: number, count: number): Promise<string>
|
|
4440
|
+
async findChainWorkForBlockHash(_hash: string): Promise<string | undefined>
|
|
4441
|
+
async findChainTipHeader(): Promise<BlockHeader>
|
|
4442
|
+
async getJsonOrUndefined<T>(path: string): Promise<T | undefined>
|
|
4443
|
+
async getJson<T>(path: string): Promise<T>
|
|
4444
|
+
async postJsonVoid<T>(_path: string, _params: T): Promise<void>
|
|
4445
|
+
async addHeader(_header: any): Promise<void>
|
|
4446
|
+
async findHeaderForMerkleRoot(_merkleRoot: string, _height?: number): Promise<undefined>
|
|
4447
|
+
async startListening(): Promise<void>
|
|
4448
|
+
async listening(): Promise<void>
|
|
4449
|
+
async isSynchronized(): Promise<boolean>
|
|
4450
|
+
async getChain(): Promise<Chain>
|
|
4451
|
+
async isListening(): Promise<boolean>
|
|
4452
|
+
async getChainTipHeader(): Promise<BlockHeader>
|
|
4453
|
+
async findChainTipHash(): Promise<string>
|
|
4454
|
+
async subscribeHeaders(_listener: HeaderListener): Promise<string>
|
|
4455
|
+
async subscribeReorgs(_listener: ReorgListener): Promise<string>
|
|
4456
|
+
async unsubscribe(_subscriptionId: string): Promise<boolean>
|
|
4457
|
+
async getInfo(): Promise<ChaintracksInfoApi>
|
|
4480
4458
|
}
|
|
4481
4459
|
```
|
|
4482
4460
|
|
|
4483
4461
|
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [ChaintracksClientApi](./services.md#interface-chaintracksclientapi), [ChaintracksInfoApi](./services.md#interface-chaintracksinfoapi), [ChaintracksServiceClientOptions](./services.md#interface-chaintracksserviceclientoptions), [HeaderListener](./services.md#type-headerlistener), [ReorgListener](./services.md#type-reorglistener)
|
|
4484
4462
|
|
|
4485
|
-
###### Property supportsReorgEvents
|
|
4486
|
-
|
|
4487
|
-
HTTP polling client; callback event methods are legacy unsupported stubs.
|
|
4488
|
-
|
|
4489
|
-
```ts
|
|
4490
|
-
readonly supportsReorgEvents = false
|
|
4491
|
-
```
|
|
4492
|
-
|
|
4493
4463
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4494
4464
|
|
|
4495
4465
|
---
|
|
@@ -4502,11 +4472,11 @@ export class Bitails {
|
|
|
4502
4472
|
readonly URL: string;
|
|
4503
4473
|
readonly httpClient: HttpClient;
|
|
4504
4474
|
readonly requestTimeoutMsecs: number;
|
|
4505
|
-
constructor(chain: Chain = "main", config: BitailsConfig = {})
|
|
4506
|
-
getHttpHeaders(): Record<string, string>
|
|
4507
|
-
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
4508
|
-
async postRaws(raws: HexString[], txids?: string[]): Promise<PostBeefResult>
|
|
4509
|
-
async getMerklePath(txid: string, services: WalletServices): Promise<GetMerklePathResult>
|
|
4475
|
+
constructor(chain: Chain = "main", config: BitailsConfig = {})
|
|
4476
|
+
getHttpHeaders(): Record<string, string>
|
|
4477
|
+
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
4478
|
+
async postRaws(raws: HexString[], txids?: string[]): Promise<PostBeefResult>
|
|
4479
|
+
async getMerklePath(txid: string, services: WalletServices): Promise<GetMerklePathResult>
|
|
4510
4480
|
}
|
|
4511
4481
|
```
|
|
4512
4482
|
|
|
@@ -4519,14 +4489,14 @@ Bitails does not natively support a postBeef end-point aware of multiple txids o
|
|
|
4519
4489
|
Send rawTx in `txids` order from beef.
|
|
4520
4490
|
|
|
4521
4491
|
```ts
|
|
4522
|
-
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
4492
|
+
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
4523
4493
|
```
|
|
4524
4494
|
See also: [PostBeefResult](./client.md#interface-postbeefresult)
|
|
4525
4495
|
|
|
4526
4496
|
###### Method postRaws
|
|
4527
4497
|
|
|
4528
4498
|
```ts
|
|
4529
|
-
async postRaws(raws: HexString[], txids?: string[]): Promise<PostBeefResult>
|
|
4499
|
+
async postRaws(raws: HexString[], txids?: string[]): Promise<PostBeefResult>
|
|
4530
4500
|
```
|
|
4531
4501
|
See also: [PostBeefResult](./client.md#interface-postbeefresult)
|
|
4532
4502
|
|
|
@@ -4550,12 +4520,12 @@ byte length and SHA-256 digest.
|
|
|
4550
4520
|
|
|
4551
4521
|
```ts
|
|
4552
4522
|
export class BulkFileDataCacheFs implements BulkFileDataCacheApi {
|
|
4553
|
-
constructor(rootFolderOrOptions: string | BulkFileDataCacheFsOptions)
|
|
4554
|
-
async get(file: Readonly<BulkHeaderFileInfo>): Promise<Uint8Array | undefined>
|
|
4555
|
-
async set(file: Readonly<BulkHeaderFileInfo>, data: Uint8Array): Promise<void>
|
|
4556
|
-
async promoteValidated(file: Readonly<BulkHeaderFileInfo>, data: Uint8Array): Promise<void>
|
|
4557
|
-
async quarantine(file: Readonly<BulkHeaderFileInfo>, reason: string, rejectedData?: Uint8Array): Promise<void>
|
|
4558
|
-
async delete(file: Readonly<BulkHeaderFileInfo>): Promise<void>
|
|
4523
|
+
constructor(rootFolderOrOptions: string | BulkFileDataCacheFsOptions)
|
|
4524
|
+
async get(file: Readonly<BulkHeaderFileInfo>): Promise<Uint8Array | undefined>
|
|
4525
|
+
async set(file: Readonly<BulkHeaderFileInfo>, data: Uint8Array): Promise<void>
|
|
4526
|
+
async promoteValidated(file: Readonly<BulkHeaderFileInfo>, data: Uint8Array): Promise<void>
|
|
4527
|
+
async quarantine(file: Readonly<BulkHeaderFileInfo>, reason: string, rejectedData?: Uint8Array): Promise<void>
|
|
4528
|
+
async delete(file: Readonly<BulkHeaderFileInfo>): Promise<void>
|
|
4559
4529
|
}
|
|
4560
4530
|
```
|
|
4561
4531
|
|
|
@@ -4576,7 +4546,7 @@ subject to the optional `maxRetained` limit.
|
|
|
4576
4546
|
|
|
4577
4547
|
```ts
|
|
4578
4548
|
export class BulkFileDataManager {
|
|
4579
|
-
static createDefaultOptions(chain: Chain): BulkFileDataManagerOptions
|
|
4549
|
+
static createDefaultOptions(chain: Chain): BulkFileDataManagerOptions
|
|
4580
4550
|
readonly chain: Chain;
|
|
4581
4551
|
readonly maxPerFile: number;
|
|
4582
4552
|
readonly fetch?: ChaintracksFetchApi;
|
|
@@ -4586,29 +4556,29 @@ export class BulkFileDataManager {
|
|
|
4586
4556
|
readonly downloadBudget?: BulkFileDownloadBudgetApi;
|
|
4587
4557
|
readonly validator: BulkFileDataValidatorApi;
|
|
4588
4558
|
readonly failedLoadRetryMsecs: number;
|
|
4589
|
-
constructor(options: BulkFileDataManagerOptions | Chain)
|
|
4590
|
-
getStats(): BulkFileDataManagerStats
|
|
4591
|
-
async deleteBulkFiles(): Promise<void>
|
|
4592
|
-
async setStorage(storage: ChaintracksStorageBulkFileApi, log: (...args: any[]) => void): Promise<void>
|
|
4559
|
+
constructor(options: BulkFileDataManagerOptions | Chain)
|
|
4560
|
+
getStats(): BulkFileDataManagerStats
|
|
4561
|
+
async deleteBulkFiles(): Promise<void>
|
|
4562
|
+
async setStorage(storage: ChaintracksStorageBulkFileApi, log: (...args: any[]) => void): Promise<void>
|
|
4593
4563
|
heightRangesFromBulkFiles(files: BulkHeaderFileInfo[]): {
|
|
4594
4564
|
all: HeightRange;
|
|
4595
4565
|
cdn: HeightRange;
|
|
4596
4566
|
incremental: HeightRange;
|
|
4597
|
-
}
|
|
4598
|
-
async createReader(range?: HeightRange, maxBufferSize?: number): Promise<BulkFileDataReader>
|
|
4599
|
-
async updateFromUrl(cdnUrl: string): Promise<void>
|
|
4600
|
-
async merge(files: BulkHeaderFileInfo[]): Promise<BulkFileDataManagerMergeResult>
|
|
4601
|
-
toLogString(what?: BulkFileDataManagerMergeResult | BulkFileData[] | BulkHeaderFileInfo[]): string
|
|
4602
|
-
async mergeIncrementalBlockHeaders(newBulkHeaders: BlockHeader[], incrementalChainWork?: string): Promise<void>
|
|
4603
|
-
async getBulkFiles(keepData?: boolean): Promise<BulkHeaderFileInfo[]>
|
|
4604
|
-
async getHeightRange(): Promise<HeightRange>
|
|
4605
|
-
async getDataFromFile(file: BulkHeaderFileInfo, offset?: number, length?: number): Promise<Uint8Array | undefined>
|
|
4606
|
-
async findHeaderForHeightOrUndefined(height: number): Promise<BlockHeader | undefined>
|
|
4607
|
-
async getFileForHeight(height: number): Promise<BulkHeaderFileInfo | undefined>
|
|
4608
|
-
async getLastFile(fromEnd = 1): Promise<BulkHeaderFileInfo | undefined>
|
|
4609
|
-
async ReValidate(): Promise<void>
|
|
4610
|
-
async exportHeadersToFs(toFs: ChaintracksFsApi, toHeadersPerFile: number, toFolder: string, sourceUrl?: string, maxHeight?: number): Promise<void>
|
|
4611
|
-
async destroy(): Promise<void>
|
|
4567
|
+
}
|
|
4568
|
+
async createReader(range?: HeightRange, maxBufferSize?: number): Promise<BulkFileDataReader>
|
|
4569
|
+
async updateFromUrl(cdnUrl: string): Promise<void>
|
|
4570
|
+
async merge(files: BulkHeaderFileInfo[]): Promise<BulkFileDataManagerMergeResult>
|
|
4571
|
+
toLogString(what?: BulkFileDataManagerMergeResult | BulkFileData[] | BulkHeaderFileInfo[]): string
|
|
4572
|
+
async mergeIncrementalBlockHeaders(newBulkHeaders: BlockHeader[], incrementalChainWork?: string): Promise<void>
|
|
4573
|
+
async getBulkFiles(keepData?: boolean): Promise<BulkHeaderFileInfo[]>
|
|
4574
|
+
async getHeightRange(): Promise<HeightRange>
|
|
4575
|
+
async getDataFromFile(file: BulkHeaderFileInfo, offset?: number, length?: number): Promise<Uint8Array | undefined>
|
|
4576
|
+
async findHeaderForHeightOrUndefined(height: number): Promise<BlockHeader | undefined>
|
|
4577
|
+
async getFileForHeight(height: number): Promise<BulkHeaderFileInfo | undefined>
|
|
4578
|
+
async getLastFile(fromEnd = 1): Promise<BulkHeaderFileInfo | undefined>
|
|
4579
|
+
async ReValidate(): Promise<void>
|
|
4580
|
+
async exportHeadersToFs(toFs: ChaintracksFsApi, toHeadersPerFile: number, toFolder: string, sourceUrl?: string, maxHeight?: number): Promise<void>
|
|
4581
|
+
async destroy(): Promise<void>
|
|
4612
4582
|
}
|
|
4613
4583
|
```
|
|
4614
4584
|
|
|
@@ -4623,7 +4593,7 @@ Synchronizes bfds and storage files, after which this manager maintains sync.
|
|
|
4623
4593
|
There should be no changes to bulk files by direct access to storage bulk file methods.
|
|
4624
4594
|
|
|
4625
4595
|
```ts
|
|
4626
|
-
async setStorage(storage: ChaintracksStorageBulkFileApi, log: (...args: any[]) => void): Promise<void>
|
|
4596
|
+
async setStorage(storage: ChaintracksStorageBulkFileApi, log: (...args: any[]) => void): Promise<void>
|
|
4627
4597
|
```
|
|
4628
4598
|
See also: [ChaintracksStorageBulkFileApi](./services.md#interface-chaintracksstoragebulkfileapi)
|
|
4629
4599
|
|
|
@@ -4638,8 +4608,8 @@ export class BulkFileDataReader {
|
|
|
4638
4608
|
readonly range: HeightRange;
|
|
4639
4609
|
readonly maxBufferSize: number;
|
|
4640
4610
|
nextHeight: number;
|
|
4641
|
-
constructor(manager: BulkFileDataManager, range: HeightRange, maxBufferSize: number)
|
|
4642
|
-
async read(): Promise<Uint8Array | undefined>
|
|
4611
|
+
constructor(manager: BulkFileDataManager, range: HeightRange, maxBufferSize: number)
|
|
4612
|
+
async read(): Promise<Uint8Array | undefined>
|
|
4643
4613
|
}
|
|
4644
4614
|
```
|
|
4645
4615
|
|
|
@@ -4648,7 +4618,7 @@ See also: [BulkFileDataManager](./services.md#class-bulkfiledatamanager), [Heigh
|
|
|
4648
4618
|
###### Method read
|
|
4649
4619
|
|
|
4650
4620
|
```ts
|
|
4651
|
-
async read(): Promise<Uint8Array | undefined>
|
|
4621
|
+
async read(): Promise<Uint8Array | undefined>
|
|
4652
4622
|
```
|
|
4653
4623
|
|
|
4654
4624
|
Returns
|
|
@@ -4667,7 +4637,7 @@ a replacement that cannot be validated.
|
|
|
4667
4637
|
|
|
4668
4638
|
```ts
|
|
4669
4639
|
export class BulkFileDataValidationError extends Error {
|
|
4670
|
-
constructor(message: string, public readonly data?: Uint8Array)
|
|
4640
|
+
constructor(message: string, public readonly data?: Uint8Array)
|
|
4671
4641
|
}
|
|
4672
4642
|
```
|
|
4673
4643
|
|
|
@@ -4685,18 +4655,18 @@ export class BulkFilesReader {
|
|
|
4685
4655
|
range: HeightRange;
|
|
4686
4656
|
maxBufferSize = 400 * 80;
|
|
4687
4657
|
nextHeight: number | undefined;
|
|
4688
|
-
constructor(files: BulkHeaderFile[], range?: HeightRange, maxBufferSize?: number)
|
|
4689
|
-
protected setRange(range?: HeightRange)
|
|
4690
|
-
setMaxBufferSize(maxBufferSize: number | undefined)
|
|
4691
|
-
get heightRange(): HeightRange
|
|
4692
|
-
async readBufferForHeightOrUndefined(height: number): Promise<Uint8Array | undefined>
|
|
4693
|
-
async readBufferForHeight(height: number): Promise<Uint8Array>
|
|
4694
|
-
async readHeaderForHeight(height: number): Promise<BaseBlockHeader>
|
|
4695
|
-
async readHeaderForHeightOrUndefined(height: number): Promise<BaseBlockHeader | undefined>
|
|
4696
|
-
async read(): Promise<Uint8Array | undefined>
|
|
4697
|
-
resetRange(range: HeightRange, maxBufferSize?: number)
|
|
4698
|
-
async validateFiles(): Promise<void>
|
|
4699
|
-
async exportHeadersToFs(toFs: ChaintracksFsApi, toHeadersPerFile: number, toFolder: string): Promise<void>
|
|
4658
|
+
constructor(files: BulkHeaderFile[], range?: HeightRange, maxBufferSize?: number)
|
|
4659
|
+
protected setRange(range?: HeightRange)
|
|
4660
|
+
setMaxBufferSize(maxBufferSize: number | undefined)
|
|
4661
|
+
get heightRange(): HeightRange
|
|
4662
|
+
async readBufferForHeightOrUndefined(height: number): Promise<Uint8Array | undefined>
|
|
4663
|
+
async readBufferForHeight(height: number): Promise<Uint8Array>
|
|
4664
|
+
async readHeaderForHeight(height: number): Promise<BaseBlockHeader>
|
|
4665
|
+
async readHeaderForHeightOrUndefined(height: number): Promise<BaseBlockHeader | undefined>
|
|
4666
|
+
async read(): Promise<Uint8Array | undefined>
|
|
4667
|
+
resetRange(range: HeightRange, maxBufferSize?: number)
|
|
4668
|
+
async validateFiles(): Promise<void>
|
|
4669
|
+
async exportHeadersToFs(toFs: ChaintracksFsApi, toHeadersPerFile: number, toFolder: string): Promise<void>
|
|
4700
4670
|
}
|
|
4701
4671
|
```
|
|
4702
4672
|
|
|
@@ -4739,7 +4709,7 @@ See also: [HeightRange](./services.md#class-heightrange)
|
|
|
4739
4709
|
###### Method read
|
|
4740
4710
|
|
|
4741
4711
|
```ts
|
|
4742
|
-
async read(): Promise<Uint8Array | undefined>
|
|
4712
|
+
async read(): Promise<Uint8Array | undefined>
|
|
4743
4713
|
```
|
|
4744
4714
|
|
|
4745
4715
|
Returns
|
|
@@ -4751,7 +4721,7 @@ an array containing the next `maxBufferSize` bytes of headers from the files.
|
|
|
4751
4721
|
Reset the reading process and adjust the range to be read to a new subset of what's available...
|
|
4752
4722
|
|
|
4753
4723
|
```ts
|
|
4754
|
-
resetRange(range: HeightRange, maxBufferSize?: number)
|
|
4724
|
+
resetRange(range: HeightRange, maxBufferSize?: number)
|
|
4755
4725
|
```
|
|
4756
4726
|
See also: [HeightRange](./services.md#class-heightrange)
|
|
4757
4727
|
|
|
@@ -4769,10 +4739,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4769
4739
|
|
|
4770
4740
|
```ts
|
|
4771
4741
|
export class BulkFilesReaderFs extends BulkFilesReader {
|
|
4772
|
-
constructor(public fs: ChaintracksFsApi, files: BulkHeaderFileFs[], range?: HeightRange, maxBufferSize?: number)
|
|
4773
|
-
static async fromFs(fs: ChaintracksFsApi, rootFolder: string, jsonFilename: string, range?: HeightRange, maxBufferSize?: number): Promise<BulkFilesReaderFs>
|
|
4774
|
-
static async writeEmptyJsonFile(fs: ChaintracksFsApi, rootFolder: string, jsonFilename: string): Promise<string>
|
|
4775
|
-
static async readJsonFile(fs: ChaintracksFsApi, rootFolder: string, jsonFilename: string, failToEmptyRange: boolean = true): Promise<BulkHeaderFilesInfo>
|
|
4742
|
+
constructor(public fs: ChaintracksFsApi, files: BulkHeaderFileFs[], range?: HeightRange, maxBufferSize?: number)
|
|
4743
|
+
static async fromFs(fs: ChaintracksFsApi, rootFolder: string, jsonFilename: string, range?: HeightRange, maxBufferSize?: number): Promise<BulkFilesReaderFs>
|
|
4744
|
+
static async writeEmptyJsonFile(fs: ChaintracksFsApi, rootFolder: string, jsonFilename: string): Promise<string>
|
|
4745
|
+
static async readJsonFile(fs: ChaintracksFsApi, rootFolder: string, jsonFilename: string, failToEmptyRange: boolean = true): Promise<BulkHeaderFilesInfo>
|
|
4776
4746
|
}
|
|
4777
4747
|
```
|
|
4778
4748
|
|
|
@@ -4783,7 +4753,7 @@ See also: [BulkFilesReader](./services.md#class-bulkfilesreader), [BulkHeaderFil
|
|
|
4783
4753
|
Return a BulkFilesReader configured to access the intersection of `range` and available headers.
|
|
4784
4754
|
|
|
4785
4755
|
```ts
|
|
4786
|
-
static async fromFs(fs: ChaintracksFsApi, rootFolder: string, jsonFilename: string, range?: HeightRange, maxBufferSize?: number): Promise<BulkFilesReaderFs>
|
|
4756
|
+
static async fromFs(fs: ChaintracksFsApi, rootFolder: string, jsonFilename: string, range?: HeightRange, maxBufferSize?: number): Promise<BulkFilesReaderFs>
|
|
4787
4757
|
```
|
|
4788
4758
|
See also: [BulkFilesReaderFs](./services.md#class-bulkfilesreaderfs), [ChaintracksFsApi](./services.md#interface-chaintracksfsapi), [HeightRange](./services.md#class-heightrange)
|
|
4789
4759
|
|
|
@@ -4794,8 +4764,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4794
4764
|
|
|
4795
4765
|
```ts
|
|
4796
4766
|
export class BulkFilesReaderStorage extends BulkFilesReader {
|
|
4797
|
-
constructor(storage: ChaintracksStorageBase, files: BulkHeaderFileStorage[], range?: HeightRange, maxBufferSize?: number)
|
|
4798
|
-
static async fromStorage(storage: ChaintracksStorageBase, fetch?: ChaintracksFetchApi, range?: HeightRange, maxBufferSize?: number): Promise<BulkFilesReaderStorage>
|
|
4767
|
+
constructor(storage: ChaintracksStorageBase, files: BulkHeaderFileStorage[], range?: HeightRange, maxBufferSize?: number)
|
|
4768
|
+
static async fromStorage(storage: ChaintracksStorageBase, fetch?: ChaintracksFetchApi, range?: HeightRange, maxBufferSize?: number): Promise<BulkFilesReaderStorage>
|
|
4799
4769
|
}
|
|
4800
4770
|
```
|
|
4801
4771
|
|
|
@@ -4821,15 +4791,15 @@ export abstract class BulkHeaderFile implements BulkHeaderFileInfo {
|
|
|
4821
4791
|
prevHash: string;
|
|
4822
4792
|
sourceUrl?: string;
|
|
4823
4793
|
validated?: boolean;
|
|
4824
|
-
constructor(info: BulkHeaderFileInfo)
|
|
4794
|
+
constructor(info: BulkHeaderFileInfo)
|
|
4825
4795
|
abstract readDataFromFile(length: number, offset: number): Promise<Uint8Array | undefined>;
|
|
4826
|
-
protected validateReadBounds(length: number, offset: number): void
|
|
4827
|
-
get heightRange(): HeightRange
|
|
4828
|
-
async ensureData(): Promise<Uint8Array>
|
|
4829
|
-
async computeFileHash(): Promise<string>
|
|
4830
|
-
async releaseData(): Promise<void>
|
|
4831
|
-
toCdnInfo(): BulkHeaderFileInfo
|
|
4832
|
-
toStorageInfo(): BulkHeaderFileInfo
|
|
4796
|
+
protected validateReadBounds(length: number, offset: number): void
|
|
4797
|
+
get heightRange(): HeightRange
|
|
4798
|
+
async ensureData(): Promise<Uint8Array>
|
|
4799
|
+
async computeFileHash(): Promise<string>
|
|
4800
|
+
async releaseData(): Promise<void>
|
|
4801
|
+
toCdnInfo(): BulkHeaderFileInfo
|
|
4802
|
+
toStorageInfo(): BulkHeaderFileInfo
|
|
4833
4803
|
}
|
|
4834
4804
|
```
|
|
4835
4805
|
|
|
@@ -4840,7 +4810,7 @@ See also: [BulkHeaderFileInfo](./services.md#interface-bulkheaderfileinfo), [Cha
|
|
|
4840
4810
|
Whenever reloading data from a backing store, validated fileHash must be re-verified
|
|
4841
4811
|
|
|
4842
4812
|
```ts
|
|
4843
|
-
async computeFileHash(): Promise<string>
|
|
4813
|
+
async computeFileHash(): Promise<string>
|
|
4844
4814
|
```
|
|
4845
4815
|
|
|
4846
4816
|
Returns
|
|
@@ -4854,9 +4824,9 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4854
4824
|
|
|
4855
4825
|
```ts
|
|
4856
4826
|
export class BulkHeaderFileFs extends BulkHeaderFile {
|
|
4857
|
-
constructor(info: BulkHeaderFileInfo, public fs: ChaintracksFsApi, public rootFolder: string)
|
|
4858
|
-
override async readDataFromFile(length: number, offset: number): Promise<Uint8Array | undefined>
|
|
4859
|
-
override async ensureData(): Promise<Uint8Array>
|
|
4827
|
+
constructor(info: BulkHeaderFileInfo, public fs: ChaintracksFsApi, public rootFolder: string)
|
|
4828
|
+
override async readDataFromFile(length: number, offset: number): Promise<Uint8Array | undefined>
|
|
4829
|
+
override async ensureData(): Promise<Uint8Array>
|
|
4860
4830
|
}
|
|
4861
4831
|
```
|
|
4862
4832
|
|
|
@@ -4869,9 +4839,9 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4869
4839
|
|
|
4870
4840
|
```ts
|
|
4871
4841
|
export class BulkHeaderFileStorage extends BulkHeaderFile {
|
|
4872
|
-
constructor(info: BulkHeaderFileInfo, public storage: ChaintracksStorageBase, public fetch?: ChaintracksFetchApi)
|
|
4873
|
-
override async readDataFromFile(length: number, offset: number): Promise<Uint8Array | undefined>
|
|
4874
|
-
override async ensureData(): Promise<Uint8Array>
|
|
4842
|
+
constructor(info: BulkHeaderFileInfo, public storage: ChaintracksStorageBase, public fetch?: ChaintracksFetchApi)
|
|
4843
|
+
override async readDataFromFile(length: number, offset: number): Promise<Uint8Array | undefined>
|
|
4844
|
+
override async ensureData(): Promise<Uint8Array>
|
|
4875
4845
|
}
|
|
4876
4846
|
```
|
|
4877
4847
|
|
|
@@ -4884,7 +4854,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4884
4854
|
|
|
4885
4855
|
```ts
|
|
4886
4856
|
export abstract class BulkHeaderFiles implements BulkHeaderFilesInfo {
|
|
4887
|
-
constructor(public rootFolder: string, public jsonFilename: string, public files: BulkHeaderFileInfo[], public headersPerFile: number)
|
|
4857
|
+
constructor(public rootFolder: string, public jsonFilename: string, public files: BulkHeaderFileInfo[], public headersPerFile: number)
|
|
4888
4858
|
}
|
|
4889
4859
|
```
|
|
4890
4860
|
|
|
@@ -4897,19 +4867,19 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4897
4867
|
|
|
4898
4868
|
```ts
|
|
4899
4869
|
export abstract class BulkIngestorBase implements BulkIngestorApi {
|
|
4900
|
-
static createBulkIngestorBaseOptions(chain: Chain)
|
|
4870
|
+
static createBulkIngestorBaseOptions(chain: Chain)
|
|
4901
4871
|
chain: Chain;
|
|
4902
4872
|
jsonFilename: string;
|
|
4903
4873
|
log: (...args: any[]) => void = () => { };
|
|
4904
|
-
constructor(options: BulkIngestorBaseOptions)
|
|
4905
|
-
async setStorage(storage: ChaintracksStorageBase, log: (...args: any[]) => void): Promise<void>
|
|
4906
|
-
async shutdown(): Promise<void>
|
|
4907
|
-
storageOrUndefined(): ChaintracksStorageApi | undefined
|
|
4908
|
-
storage(): ChaintracksStorageBase
|
|
4874
|
+
constructor(options: BulkIngestorBaseOptions)
|
|
4875
|
+
async setStorage(storage: ChaintracksStorageBase, log: (...args: any[]) => void): Promise<void>
|
|
4876
|
+
async shutdown(): Promise<void>
|
|
4877
|
+
storageOrUndefined(): ChaintracksStorageApi | undefined
|
|
4878
|
+
storage(): ChaintracksStorageBase
|
|
4909
4879
|
filesInfo: BulkHeaderFilesInfo | undefined;
|
|
4910
|
-
async getPresentHeight(): Promise<number | undefined>
|
|
4880
|
+
async getPresentHeight(): Promise<number | undefined>
|
|
4911
4881
|
abstract fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>;
|
|
4912
|
-
async synchronize(presentHeight: number, before: HeightRanges, priorLiveHeaders: BlockHeader[]): Promise<BulkSyncResult>
|
|
4882
|
+
async synchronize(presentHeight: number, before: HeightRanges, priorLiveHeaders: BlockHeader[]): Promise<BulkSyncResult>
|
|
4913
4883
|
}
|
|
4914
4884
|
```
|
|
4915
4885
|
|
|
@@ -4927,7 +4897,7 @@ See also: [BulkHeaderFilesInfo](./services.md#interface-bulkheaderfilesinfo)
|
|
|
4927
4897
|
###### Method createBulkIngestorBaseOptions
|
|
4928
4898
|
|
|
4929
4899
|
```ts
|
|
4930
|
-
static createBulkIngestorBaseOptions(chain: Chain)
|
|
4900
|
+
static createBulkIngestorBaseOptions(chain: Chain)
|
|
4931
4901
|
```
|
|
4932
4902
|
See also: [Chain](./client.md#type-chain)
|
|
4933
4903
|
|
|
@@ -4969,7 +4939,7 @@ Argument Details
|
|
|
4969
4939
|
At least one derived BulkIngestor must override this method to provide the current height of the active chain tip.
|
|
4970
4940
|
|
|
4971
4941
|
```ts
|
|
4972
|
-
async getPresentHeight(): Promise<number | undefined>
|
|
4942
|
+
async getPresentHeight(): Promise<number | undefined>
|
|
4973
4943
|
```
|
|
4974
4944
|
|
|
4975
4945
|
Returns
|
|
@@ -4983,7 +4953,7 @@ A BulkIngestor has two potential goals:
|
|
|
4983
4953
|
2. To source missing live headers to be forwarded to live storage.
|
|
4984
4954
|
|
|
4985
4955
|
```ts
|
|
4986
|
-
async synchronize(presentHeight: number, before: HeightRanges, priorLiveHeaders: BlockHeader[]): Promise<BulkSyncResult>
|
|
4956
|
+
async synchronize(presentHeight: number, before: HeightRanges, priorLiveHeaders: BlockHeader[]): Promise<BulkSyncResult>
|
|
4987
4957
|
```
|
|
4988
4958
|
See also: [BlockHeader](./client.md#interface-blockheader), [BulkSyncResult](./services.md#interface-bulksyncresult), [HeightRanges](./services.md#interface-heightranges)
|
|
4989
4959
|
|
|
@@ -5007,7 +4977,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5007
4977
|
|
|
5008
4978
|
```ts
|
|
5009
4979
|
export class BulkIngestorCDN extends BulkIngestorBase {
|
|
5010
|
-
static createBulkIngestorCDNOptions(chain: Chain, cdnUrl: string, fetch: ChaintracksFetchApi, maxPerFile?: number): BulkIngestorCDNOptions
|
|
4980
|
+
static createBulkIngestorCDNOptions(chain: Chain, cdnUrl: string, fetch: ChaintracksFetchApi, maxPerFile?: number): BulkIngestorCDNOptions
|
|
5011
4981
|
fetch: ChaintracksFetchApi;
|
|
5012
4982
|
jsonResource: string;
|
|
5013
4983
|
cdnUrl: string;
|
|
@@ -5015,10 +4985,10 @@ export class BulkIngestorCDN extends BulkIngestorBase {
|
|
|
5015
4985
|
availableBulkFiles: BulkHeaderFilesInfo | undefined;
|
|
5016
4986
|
selectedFiles: BulkHeaderFileInfo[] | undefined;
|
|
5017
4987
|
currentRange: HeightRange | undefined;
|
|
5018
|
-
constructor(options: BulkIngestorCDNOptions)
|
|
5019
|
-
override async getPresentHeight(): Promise<number | undefined>
|
|
5020
|
-
getJsonHttpHeaders(): Record<string, string>
|
|
5021
|
-
async fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
4988
|
+
constructor(options: BulkIngestorCDNOptions)
|
|
4989
|
+
override async getPresentHeight(): Promise<number | undefined>
|
|
4990
|
+
getJsonHttpHeaders(): Record<string, string>
|
|
4991
|
+
async fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5022
4992
|
}
|
|
5023
4993
|
```
|
|
5024
4994
|
|
|
@@ -5027,7 +4997,7 @@ See also: [BlockHeader](./client.md#interface-blockheader), [BulkHeaderFileInfo]
|
|
|
5027
4997
|
###### Method createBulkIngestorCDNOptions
|
|
5028
4998
|
|
|
5029
4999
|
```ts
|
|
5030
|
-
static createBulkIngestorCDNOptions(chain: Chain, cdnUrl: string, fetch: ChaintracksFetchApi, maxPerFile?: number): BulkIngestorCDNOptions
|
|
5000
|
+
static createBulkIngestorCDNOptions(chain: Chain, cdnUrl: string, fetch: ChaintracksFetchApi, maxPerFile?: number): BulkIngestorCDNOptions
|
|
5031
5001
|
```
|
|
5032
5002
|
See also: [BulkIngestorCDNOptions](./services.md#interface-bulkingestorcdnoptions), [Chain](./client.md#type-chain), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi)
|
|
5033
5003
|
|
|
@@ -5062,7 +5032,7 @@ Context Replace:
|
|
|
5062
5032
|
- Proceed as context Incremental.
|
|
5063
5033
|
|
|
5064
5034
|
```ts
|
|
5065
|
-
async fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5035
|
+
async fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5066
5036
|
```
|
|
5067
5037
|
See also: [BlockHeader](./client.md#interface-blockheader), [HeightRange](./services.md#class-heightrange), [HeightRanges](./services.md#interface-heightranges)
|
|
5068
5038
|
|
|
@@ -5082,7 +5052,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5082
5052
|
|
|
5083
5053
|
```ts
|
|
5084
5054
|
export class BulkIngestorCDNBabbage extends BulkIngestorCDN {
|
|
5085
|
-
static createBulkIngestorCDNBabbageOptions(chain: Chain, fetch: ChaintracksFetchApi): BulkIngestorCDNOptions
|
|
5055
|
+
static createBulkIngestorCDNBabbageOptions(chain: Chain, fetch: ChaintracksFetchApi): BulkIngestorCDNOptions
|
|
5086
5056
|
}
|
|
5087
5057
|
```
|
|
5088
5058
|
|
|
@@ -5091,7 +5061,7 @@ See also: [BulkIngestorCDN](./services.md#class-bulkingestorcdn), [BulkIngestorC
|
|
|
5091
5061
|
###### Method createBulkIngestorCDNBabbageOptions
|
|
5092
5062
|
|
|
5093
5063
|
```ts
|
|
5094
|
-
static createBulkIngestorCDNBabbageOptions(chain: Chain, fetch: ChaintracksFetchApi): BulkIngestorCDNOptions
|
|
5064
|
+
static createBulkIngestorCDNBabbageOptions(chain: Chain, fetch: ChaintracksFetchApi): BulkIngestorCDNOptions
|
|
5095
5065
|
```
|
|
5096
5066
|
See also: [BulkIngestorCDNOptions](./services.md#interface-bulkingestorcdnoptions), [Chain](./client.md#type-chain), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi)
|
|
5097
5067
|
|
|
@@ -5111,9 +5081,9 @@ continuity, and genesis checks before storage.
|
|
|
5111
5081
|
|
|
5112
5082
|
```ts
|
|
5113
5083
|
export class BulkIngestorChaintracks extends BulkIngestorBase {
|
|
5114
|
-
constructor(options: BulkIngestorChaintracksOptions)
|
|
5115
|
-
override async getPresentHeight(): Promise<number>
|
|
5116
|
-
async fetchHeaders(_before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5084
|
+
constructor(options: BulkIngestorChaintracksOptions)
|
|
5085
|
+
override async getPresentHeight(): Promise<number>
|
|
5086
|
+
async fetchHeaders(_before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5117
5087
|
}
|
|
5118
5088
|
```
|
|
5119
5089
|
|
|
@@ -5126,14 +5096,14 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5126
5096
|
|
|
5127
5097
|
```ts
|
|
5128
5098
|
export class BulkIngestorWhatsOnChainCdn extends BulkIngestorBase {
|
|
5129
|
-
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5099
|
+
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5130
5100
|
fetch: ChaintracksFetchApi;
|
|
5131
5101
|
idleWait: number;
|
|
5132
5102
|
woc: WhatsOnChainServices;
|
|
5133
5103
|
stopOldListenersToken: StopListenerToken = { stop: undefined };
|
|
5134
|
-
constructor(options: BulkIngestorWhatsOnChainOptions)
|
|
5135
|
-
override async getPresentHeight(): Promise<number | undefined>
|
|
5136
|
-
async fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5104
|
+
constructor(options: BulkIngestorWhatsOnChainOptions)
|
|
5105
|
+
override async getPresentHeight(): Promise<number | undefined>
|
|
5106
|
+
async fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5137
5107
|
}
|
|
5138
5108
|
```
|
|
5139
5109
|
|
|
@@ -5142,7 +5112,7 @@ See also: [BlockHeader](./client.md#interface-blockheader), [BulkIngestorBase](.
|
|
|
5142
5112
|
###### Method createBulkIngestorWhatsOnChainOptions
|
|
5143
5113
|
|
|
5144
5114
|
```ts
|
|
5145
|
-
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5115
|
+
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5146
5116
|
```
|
|
5147
5117
|
See also: [BulkIngestorWhatsOnChainOptions](./services.md#interface-bulkingestorwhatsonchainoptions), [Chain](./client.md#type-chain)
|
|
5148
5118
|
|
|
@@ -5158,14 +5128,14 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5158
5128
|
|
|
5159
5129
|
```ts
|
|
5160
5130
|
export class BulkIngestorWhatsOnChainWs extends BulkIngestorBase {
|
|
5161
|
-
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5131
|
+
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5162
5132
|
idleWait: number;
|
|
5163
5133
|
maxHeadersPerRequest: number;
|
|
5164
5134
|
woc: WhatsOnChainServices;
|
|
5165
5135
|
stopOldListenersToken: StopListenerToken = { stop: undefined };
|
|
5166
|
-
constructor(options: BulkIngestorWhatsOnChainOptions)
|
|
5167
|
-
override async getPresentHeight(): Promise<number | undefined>
|
|
5168
|
-
async fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5136
|
+
constructor(options: BulkIngestorWhatsOnChainOptions)
|
|
5137
|
+
override async getPresentHeight(): Promise<number | undefined>
|
|
5138
|
+
async fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5169
5139
|
}
|
|
5170
5140
|
```
|
|
5171
5141
|
|
|
@@ -5174,7 +5144,7 @@ See also: [BlockHeader](./client.md#interface-blockheader), [BulkIngestorBase](.
|
|
|
5174
5144
|
###### Method createBulkIngestorWhatsOnChainOptions
|
|
5175
5145
|
|
|
5176
5146
|
```ts
|
|
5177
|
-
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5147
|
+
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5178
5148
|
```
|
|
5179
5149
|
See also: [BulkIngestorWhatsOnChainOptions](./services.md#interface-bulkingestorwhatsonchainoptions), [Chain](./client.md#type-chain)
|
|
5180
5150
|
|
|
@@ -5190,20 +5160,20 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5190
5160
|
|
|
5191
5161
|
```ts
|
|
5192
5162
|
export abstract class BulkStorageBase implements BulkStorageApi {
|
|
5193
|
-
static createBulkStorageBaseOptions(chain: Chain, fs: ChaintracksFsApi): BulkStorageBaseOptions
|
|
5163
|
+
static createBulkStorageBaseOptions(chain: Chain, fs: ChaintracksFsApi): BulkStorageBaseOptions
|
|
5194
5164
|
chain: Chain;
|
|
5195
5165
|
fs: ChaintracksFsApi;
|
|
5196
5166
|
log: (...args: any[]) => void = () => { };
|
|
5197
|
-
constructor(options: BulkStorageBaseOptions)
|
|
5198
|
-
async shutdown(): Promise<void>
|
|
5167
|
+
constructor(options: BulkStorageBaseOptions)
|
|
5168
|
+
async shutdown(): Promise<void>
|
|
5199
5169
|
abstract appendHeaders(minHeight: number, count: number, newBulkHeaders: Uint8Array): Promise<void>;
|
|
5200
5170
|
abstract getMaxHeight(): Promise<number>;
|
|
5201
5171
|
abstract headersToBuffer(height: number, count: number): Promise<Uint8Array>;
|
|
5202
5172
|
abstract findHeaderForHeightOrUndefined(height: number): Promise<BlockHeader | undefined>;
|
|
5203
|
-
async findHeaderForHeight(height: number): Promise<BlockHeader>
|
|
5204
|
-
async getHeightRange(): Promise<HeightRange>
|
|
5205
|
-
async setStorage(storage: ChaintracksStorageBase, log: (...args: any[]) => void): Promise<void>
|
|
5206
|
-
async exportBulkHeaders(rootFolder: string, jsonFilename: string, maxPerFile: number): Promise<void>
|
|
5173
|
+
async findHeaderForHeight(height: number): Promise<BlockHeader>
|
|
5174
|
+
async getHeightRange(): Promise<HeightRange>
|
|
5175
|
+
async setStorage(storage: ChaintracksStorageBase, log: (...args: any[]) => void): Promise<void>
|
|
5176
|
+
async exportBulkHeaders(rootFolder: string, jsonFilename: string, maxPerFile: number): Promise<void>
|
|
5207
5177
|
}
|
|
5208
5178
|
```
|
|
5209
5179
|
|
|
@@ -5216,37 +5186,37 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5216
5186
|
|
|
5217
5187
|
```ts
|
|
5218
5188
|
export class Chaintracks implements ChaintracksManagementApi {
|
|
5219
|
-
static createOptions(chain: Chain): ChaintracksOptions
|
|
5189
|
+
static createOptions(chain: Chain): ChaintracksOptions
|
|
5220
5190
|
log: (...args: any[]) => void = () => { };
|
|
5221
5191
|
readonly chain: Chain;
|
|
5222
5192
|
readonly readonly: boolean;
|
|
5223
|
-
constructor(public options: ChaintracksOptions)
|
|
5224
|
-
async getChain(): Promise<Chain>
|
|
5225
|
-
async getPresentHeight(): Promise<number>
|
|
5226
|
-
async currentHeight(): Promise<number>
|
|
5227
|
-
getAvailabilitySnapshot(): ChaintracksAvailabilitySnapshotApi
|
|
5228
|
-
async subscribeHeaders(listener: HeaderListener): Promise<string>
|
|
5229
|
-
async subscribeReorgs(listener: ReorgListener): Promise<string>
|
|
5230
|
-
async unsubscribe(subscriptionId: string): Promise<boolean>
|
|
5231
|
-
async addHeader(header: BaseBlockHeader): Promise<void>
|
|
5232
|
-
async makeAvailable(): Promise<void>
|
|
5233
|
-
async startPromises(): Promise<void>
|
|
5234
|
-
async destroy(): Promise<void>
|
|
5235
|
-
async listening(): Promise<void>
|
|
5236
|
-
async isListening(): Promise<boolean>
|
|
5237
|
-
async isSynchronized(): Promise<boolean>
|
|
5238
|
-
async findHeaderForHeight(height: number): Promise<BlockHeader | undefined>
|
|
5239
|
-
async findHeaderForBlockHash(hash: string): Promise<BlockHeader | undefined>
|
|
5240
|
-
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
5241
|
-
async getInfo(): Promise<ChaintracksInfoApi>
|
|
5242
|
-
async getHeaders(height: number, count: number): Promise<string>
|
|
5243
|
-
async findChainTipHeader(): Promise<BlockHeader>
|
|
5244
|
-
async findChainTipHash(): Promise<string>
|
|
5245
|
-
async findLiveHeaderForBlockHash(hash: string): Promise<LiveBlockHeader | undefined>
|
|
5246
|
-
async findChainWorkForBlockHash(hash: string): Promise<string | undefined>
|
|
5247
|
-
async validate(): Promise<boolean>
|
|
5248
|
-
async exportBulkHeaders(toFolder: string, toFs: ChaintracksFsApi, sourceUrl?: string, toHeadersPerFile?: number, maxHeight?: number): Promise<void>
|
|
5249
|
-
async startListening(): Promise<void>
|
|
5193
|
+
constructor(public options: ChaintracksOptions)
|
|
5194
|
+
async getChain(): Promise<Chain>
|
|
5195
|
+
async getPresentHeight(): Promise<number>
|
|
5196
|
+
async currentHeight(): Promise<number>
|
|
5197
|
+
getAvailabilitySnapshot(): ChaintracksAvailabilitySnapshotApi
|
|
5198
|
+
async subscribeHeaders(listener: HeaderListener): Promise<string>
|
|
5199
|
+
async subscribeReorgs(listener: ReorgListener): Promise<string>
|
|
5200
|
+
async unsubscribe(subscriptionId: string): Promise<boolean>
|
|
5201
|
+
async addHeader(header: BaseBlockHeader): Promise<void>
|
|
5202
|
+
async makeAvailable(): Promise<void>
|
|
5203
|
+
async startPromises(): Promise<void>
|
|
5204
|
+
async destroy(): Promise<void>
|
|
5205
|
+
async listening(): Promise<void>
|
|
5206
|
+
async isListening(): Promise<boolean>
|
|
5207
|
+
async isSynchronized(): Promise<boolean>
|
|
5208
|
+
async findHeaderForHeight(height: number): Promise<BlockHeader | undefined>
|
|
5209
|
+
async findHeaderForBlockHash(hash: string): Promise<BlockHeader | undefined>
|
|
5210
|
+
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
5211
|
+
async getInfo(): Promise<ChaintracksInfoApi>
|
|
5212
|
+
async getHeaders(height: number, count: number): Promise<string>
|
|
5213
|
+
async findChainTipHeader(): Promise<BlockHeader>
|
|
5214
|
+
async findChainTipHash(): Promise<string>
|
|
5215
|
+
async findLiveHeaderForBlockHash(hash: string): Promise<LiveBlockHeader | undefined>
|
|
5216
|
+
async findChainWorkForBlockHash(hash: string): Promise<string | undefined>
|
|
5217
|
+
async validate(): Promise<boolean>
|
|
5218
|
+
async exportBulkHeaders(toFolder: string, toFs: ChaintracksFsApi, sourceUrl?: string, toHeadersPerFile?: number, maxHeight?: number): Promise<void>
|
|
5219
|
+
async startListening(): Promise<void>
|
|
5250
5220
|
private async syncBulkStorageNoLock(presentHeight: number, initialRanges: HeightRanges): Promise<void> {
|
|
5251
5221
|
let newLiveHeaders: BlockHeader[] = [];
|
|
5252
5222
|
let before = initialRanges;
|
|
@@ -5324,7 +5294,7 @@ bulk ingestors will be attempted to resolve the linkage up to a depth of `addLiv
|
|
|
5324
5294
|
Headers are considered in the order they were added.
|
|
5325
5295
|
|
|
5326
5296
|
```ts
|
|
5327
|
-
async addHeader(header: BaseBlockHeader): Promise<void>
|
|
5297
|
+
async addHeader(header: BaseBlockHeader): Promise<void>
|
|
5328
5298
|
```
|
|
5329
5299
|
See also: [BaseBlockHeader](./client.md#interface-baseblockheader)
|
|
5330
5300
|
|
|
@@ -5333,7 +5303,7 @@ See also: [BaseBlockHeader](./client.md#interface-baseblockheader)
|
|
|
5333
5303
|
Returns local process state without locks, storage reads, or network I/O.
|
|
5334
5304
|
|
|
5335
5305
|
```ts
|
|
5336
|
-
getAvailabilitySnapshot(): ChaintracksAvailabilitySnapshotApi
|
|
5306
|
+
getAvailabilitySnapshot(): ChaintracksAvailabilitySnapshotApi
|
|
5337
5307
|
```
|
|
5338
5308
|
See also: [ChaintracksAvailabilitySnapshotApi](./services.md#interface-chaintracksavailabilitysnapshotapi)
|
|
5339
5309
|
|
|
@@ -5343,7 +5313,7 @@ Returns the last known valid height immediately and refreshes stale state
|
|
|
5343
5313
|
once in the background. Cold start waits for the single shared refresh.
|
|
5344
5314
|
|
|
5345
5315
|
```ts
|
|
5346
|
-
async getPresentHeight(): Promise<number>
|
|
5316
|
+
async getPresentHeight(): Promise<number>
|
|
5347
5317
|
```
|
|
5348
5318
|
|
|
5349
5319
|
###### Method makeAvailable
|
|
@@ -5355,7 +5325,7 @@ Note that the main thread continues running and takes additional write locks
|
|
|
5355
5325
|
itself when already available.
|
|
5356
5326
|
|
|
5357
5327
|
```ts
|
|
5358
|
-
async makeAvailable(): Promise<void>
|
|
5328
|
+
async makeAvailable(): Promise<void>
|
|
5359
5329
|
```
|
|
5360
5330
|
|
|
5361
5331
|
Returns
|
|
@@ -5365,7 +5335,7 @@ when available for client requests
|
|
|
5365
5335
|
###### Method validate
|
|
5366
5336
|
|
|
5367
5337
|
```ts
|
|
5368
|
-
async validate(): Promise<boolean>
|
|
5338
|
+
async validate(): Promise<boolean>
|
|
5369
5339
|
```
|
|
5370
5340
|
|
|
5371
5341
|
Returns
|
|
@@ -5379,8 +5349,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5379
5349
|
|
|
5380
5350
|
```ts
|
|
5381
5351
|
export class ChaintracksAppendableFile extends ChaintracksFolderAwareFile implements ChaintracksAppendableFileApi {
|
|
5382
|
-
static async openAsAppendable(path: string): Promise<ChaintracksAppendableFile>
|
|
5383
|
-
async append(data: Uint8Array): Promise<void>
|
|
5352
|
+
static async openAsAppendable(path: string): Promise<ChaintracksAppendableFile>
|
|
5353
|
+
async append(data: Uint8Array): Promise<void>
|
|
5384
5354
|
}
|
|
5385
5355
|
```
|
|
5386
5356
|
|
|
@@ -5393,38 +5363,18 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5393
5363
|
|
|
5394
5364
|
```ts
|
|
5395
5365
|
export class ChaintracksChainTracker implements ChainTracker {
|
|
5366
|
+
chaintracks: ChaintracksClientApi;
|
|
5396
5367
|
cache: Record<number, string>;
|
|
5397
5368
|
options: ChaintracksChainTrackerOptions;
|
|
5398
5369
|
readonly telemetry: Telemetry;
|
|
5399
|
-
constructor(chain?: Chain, chaintracks?: ChaintracksClientApi, options?: ChaintracksChainTrackerOptions)
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
getVerificationContext(): string
|
|
5403
|
-
async getVerificationContextToken(signal?: AbortSignal): Promise<string>
|
|
5404
|
-
async dispose(): Promise<void>
|
|
5405
|
-
async currentHeight(signal?: AbortSignal): Promise<number>
|
|
5406
|
-
async isValidRootForHeight(root: string, height: number, signal?: AbortSignal): Promise<boolean>
|
|
5370
|
+
constructor(chain?: Chain, chaintracks?: ChaintracksClientApi, options?: ChaintracksChainTrackerOptions)
|
|
5371
|
+
async currentHeight(): Promise<number>
|
|
5372
|
+
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
5407
5373
|
}
|
|
5408
5374
|
```
|
|
5409
5375
|
|
|
5410
5376
|
See also: [Chain](./client.md#type-chain), [ChaintracksChainTrackerOptions](./services.md#interface-chaintrackschaintrackeroptions), [ChaintracksClientApi](./services.md#interface-chaintracksclientapi)
|
|
5411
5377
|
|
|
5412
|
-
###### Method getVerificationContext
|
|
5413
|
-
|
|
5414
|
-
Local provider-generation marker for consumers that invalidate derived verdicts.
|
|
5415
|
-
|
|
5416
|
-
```ts
|
|
5417
|
-
getVerificationContext(): string
|
|
5418
|
-
```
|
|
5419
|
-
|
|
5420
|
-
###### Method getVerificationContextToken
|
|
5421
|
-
|
|
5422
|
-
Fresh provider-bound canonical tip token; unlike the stable context, normal tip advances change it.
|
|
5423
|
-
|
|
5424
|
-
```ts
|
|
5425
|
-
async getVerificationContextToken(signal?: AbortSignal): Promise<string>
|
|
5426
|
-
```
|
|
5427
|
-
|
|
5428
5378
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5429
5379
|
|
|
5430
5380
|
---
|
|
@@ -5439,10 +5389,10 @@ every materialized response has an explicit byte ceiling.
|
|
|
5439
5389
|
```ts
|
|
5440
5390
|
export class ChaintracksFetch implements ChaintracksFetchApi {
|
|
5441
5391
|
httpClient: HttpClient = defaultHttpClient();
|
|
5442
|
-
constructor(options: ChaintracksFetchOptions = {})
|
|
5443
|
-
async download(url: string, maxResponseBytes?: number, options?: ChaintracksDownloadOptions): Promise<Uint8Array>
|
|
5444
|
-
async fetchJson<R>(url: string): Promise<R>
|
|
5445
|
-
pathJoin(baseUrl: string, subpath: string): string
|
|
5392
|
+
constructor(options: ChaintracksFetchOptions = {})
|
|
5393
|
+
async download(url: string, maxResponseBytes?: number, options?: ChaintracksDownloadOptions): Promise<Uint8Array>
|
|
5394
|
+
async fetchJson<R>(url: string): Promise<R>
|
|
5395
|
+
pathJoin(baseUrl: string, subpath: string): string
|
|
5446
5396
|
}
|
|
5447
5397
|
```
|
|
5448
5398
|
|
|
@@ -5455,8 +5405,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5455
5405
|
|
|
5456
5406
|
```ts
|
|
5457
5407
|
export class ChaintracksFetchError extends Error {
|
|
5458
|
-
constructor(message: string, public readonly url: string, public readonly status: number, public readonly statusText: string, public readonly retryAfterMsecs?: number)
|
|
5459
|
-
get retryable(): boolean
|
|
5408
|
+
constructor(message: string, public readonly url: string, public readonly status: number, public readonly statusText: string, public readonly retryAfterMsecs?: number)
|
|
5409
|
+
get retryable(): boolean
|
|
5460
5410
|
}
|
|
5461
5411
|
```
|
|
5462
5412
|
|
|
@@ -5467,14 +5417,14 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5467
5417
|
|
|
5468
5418
|
```ts
|
|
5469
5419
|
export abstract class ChaintracksFsStatics {
|
|
5470
|
-
static async delete(path: string): Promise<void>
|
|
5471
|
-
static async writeFile(path: string, data: Uint8Array): Promise<void>
|
|
5472
|
-
static async readFile(path: string): Promise<Uint8Array>
|
|
5473
|
-
static async openReadableFile(path: string): Promise<ChaintracksReadableFileApi>
|
|
5474
|
-
static async openWritableFile(path: string): Promise<ChaintracksWritableFileApi>
|
|
5475
|
-
static async openAppendableFile(path: string): Promise<ChaintracksAppendableFileApi>
|
|
5476
|
-
static async ensureFoldersExist(path: string): Promise<void>
|
|
5477
|
-
static pathJoin(...parts: string[]): string
|
|
5420
|
+
static async delete(path: string): Promise<void>
|
|
5421
|
+
static async writeFile(path: string, data: Uint8Array): Promise<void>
|
|
5422
|
+
static async readFile(path: string): Promise<Uint8Array>
|
|
5423
|
+
static async openReadableFile(path: string): Promise<ChaintracksReadableFileApi>
|
|
5424
|
+
static async openWritableFile(path: string): Promise<ChaintracksWritableFileApi>
|
|
5425
|
+
static async openAppendableFile(path: string): Promise<ChaintracksAppendableFileApi>
|
|
5426
|
+
static async ensureFoldersExist(path: string): Promise<void>
|
|
5427
|
+
static pathJoin(...parts: string[]): string
|
|
5478
5428
|
}
|
|
5479
5429
|
```
|
|
5480
5430
|
|
|
@@ -5488,13 +5438,13 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5488
5438
|
```ts
|
|
5489
5439
|
export class ChaintracksKnexMigrations implements MigrationSource<string> {
|
|
5490
5440
|
migrations: Record<string, Migration> = {};
|
|
5491
|
-
constructor(public chain: Chain)
|
|
5492
|
-
async getMigrations(): Promise<string[]>
|
|
5493
|
-
getMigrationName(migration: string)
|
|
5494
|
-
async getMigration(migration: string): Promise<Migration>
|
|
5495
|
-
async getLatestMigration(): Promise<string>
|
|
5496
|
-
static async latestMigration(): Promise<string>
|
|
5497
|
-
setupMigrations(): Record<string, Migration>
|
|
5441
|
+
constructor(public chain: Chain)
|
|
5442
|
+
async getMigrations(): Promise<string[]>
|
|
5443
|
+
getMigrationName(migration: string)
|
|
5444
|
+
async getMigration(migration: string): Promise<Migration>
|
|
5445
|
+
async getLatestMigration(): Promise<string>
|
|
5446
|
+
static async latestMigration(): Promise<string>
|
|
5447
|
+
setupMigrations(): Record<string, Migration>
|
|
5498
5448
|
}
|
|
5499
5449
|
```
|
|
5500
5450
|
|
|
@@ -5502,18 +5452,6 @@ See also: [Chain](./client.md#type-chain)
|
|
|
5502
5452
|
|
|
5503
5453
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5504
5454
|
|
|
5505
|
-
---
|
|
5506
|
-
##### Class: ChaintracksQueueCapacityError
|
|
5507
|
-
|
|
5508
|
-
```ts
|
|
5509
|
-
export class ChaintracksQueueCapacityError extends Error {
|
|
5510
|
-
readonly code = "ERR_CHAINTRACKS_QUEUE_CAPACITY";
|
|
5511
|
-
constructor()
|
|
5512
|
-
}
|
|
5513
|
-
```
|
|
5514
|
-
|
|
5515
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5516
|
-
|
|
5517
5455
|
---
|
|
5518
5456
|
##### Class: ChaintracksReadableFile
|
|
5519
5457
|
|
|
@@ -5522,11 +5460,11 @@ export class ChaintracksReadableFile implements ChaintracksReadableFileApi {
|
|
|
5522
5460
|
path: string;
|
|
5523
5461
|
parsedPath: Path.ParsedPath;
|
|
5524
5462
|
f: fs.FileHandle;
|
|
5525
|
-
protected constructor(path: string, f: fs.FileHandle)
|
|
5526
|
-
async close(): Promise<void>
|
|
5527
|
-
async getLength(): Promise<number>
|
|
5528
|
-
async read(length?: number, offset?: number): Promise<Uint8Array>
|
|
5529
|
-
static async openAsReadable(path: string): Promise<ChaintracksReadableFile>
|
|
5463
|
+
protected constructor(path: string, f: fs.FileHandle)
|
|
5464
|
+
async close(): Promise<void>
|
|
5465
|
+
async getLength(): Promise<number>
|
|
5466
|
+
async read(length?: number, offset?: number): Promise<Uint8Array>
|
|
5467
|
+
static async openAsReadable(path: string): Promise<ChaintracksReadableFile>
|
|
5530
5468
|
}
|
|
5531
5469
|
```
|
|
5532
5470
|
|
|
@@ -5539,16 +5477,16 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5539
5477
|
|
|
5540
5478
|
```ts
|
|
5541
5479
|
export class ChaintracksService {
|
|
5542
|
-
static createChaintracksServiceOptions(chain: Chain): ChaintracksServiceOptions
|
|
5480
|
+
static createChaintracksServiceOptions(chain: Chain): ChaintracksServiceOptions
|
|
5543
5481
|
chain: Chain;
|
|
5544
5482
|
options: ChaintracksServiceOptions;
|
|
5545
5483
|
port?: number;
|
|
5546
5484
|
chaintracks: Chaintracks;
|
|
5547
5485
|
services: Services;
|
|
5548
5486
|
server?: Server<typeof IncomingMessage, typeof ServerResponse>;
|
|
5549
|
-
constructor(options: ChaintracksServiceOptions)
|
|
5550
|
-
async stopJsonRpcServer(): Promise<void>
|
|
5551
|
-
async startJsonRpcServer(port?: number): Promise<void>
|
|
5487
|
+
constructor(options: ChaintracksServiceOptions)
|
|
5488
|
+
async stopJsonRpcServer(): Promise<void>
|
|
5489
|
+
async startJsonRpcServer(port?: number): Promise<void>
|
|
5552
5490
|
}
|
|
5553
5491
|
```
|
|
5554
5492
|
|
|
@@ -5563,45 +5501,36 @@ Connects to a ChaintracksService to implement 'ChaintracksClientApi'
|
|
|
5563
5501
|
|
|
5564
5502
|
```ts
|
|
5565
5503
|
export class ChaintracksServiceClient implements ChaintracksClientApi {
|
|
5566
|
-
|
|
5567
|
-
static createChaintracksServiceClientOptions(): ChaintracksServiceClientOptions
|
|
5504
|
+
static createChaintracksServiceClientOptions(): ChaintracksServiceClientOptions
|
|
5568
5505
|
options: ChaintracksServiceClientOptions;
|
|
5569
|
-
constructor(public chain: Chain, serviceUrl: string, options?: ChaintracksServiceClientOptions)
|
|
5506
|
+
constructor(public chain: Chain, serviceUrl: string, options?: ChaintracksServiceClientOptions)
|
|
5570
5507
|
readonly serviceUrl: string;
|
|
5571
|
-
async subscribeHeaders(_listener: HeaderListener): Promise<string>
|
|
5572
|
-
async subscribeReorgs(_listener: ReorgListener): Promise<string>
|
|
5573
|
-
async unsubscribe(_subscriptionId: string): Promise<boolean>
|
|
5574
|
-
async currentHeight(): Promise<number>
|
|
5575
|
-
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
5576
|
-
async getJsonOrUndefined<T>(path: string): Promise<T | undefined>
|
|
5577
|
-
async getJson<T>(path: string): Promise<T>
|
|
5578
|
-
async postJsonVoid<T>(path: string, params: T): Promise<void>
|
|
5579
|
-
async addHeader(header: BaseBlockHeader): Promise<void>
|
|
5580
|
-
async startListening(): Promise<void>
|
|
5581
|
-
async listening(): Promise<void>
|
|
5582
|
-
async getChain(): Promise<Chain>
|
|
5583
|
-
async isListening(): Promise<boolean>
|
|
5584
|
-
async isSynchronized(): Promise<boolean>
|
|
5585
|
-
async getPresentHeight(): Promise<number>
|
|
5586
|
-
async getInfo(): Promise<ChaintracksInfoApi>
|
|
5587
|
-
async findChainTipHeader(): Promise<BlockHeader>
|
|
5588
|
-
async findChainTipHash(): Promise<string>
|
|
5589
|
-
async getHeaders(height: number, count: number): Promise<string>
|
|
5590
|
-
async findHeaderForHeight(height: number): Promise<BlockHeader | undefined>
|
|
5591
|
-
async findHeaderForBlockHash(hash: string): Promise<BlockHeader | undefined>
|
|
5508
|
+
async subscribeHeaders(_listener: HeaderListener): Promise<string>
|
|
5509
|
+
async subscribeReorgs(_listener: ReorgListener): Promise<string>
|
|
5510
|
+
async unsubscribe(_subscriptionId: string): Promise<boolean>
|
|
5511
|
+
async currentHeight(): Promise<number>
|
|
5512
|
+
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
5513
|
+
async getJsonOrUndefined<T>(path: string): Promise<T | undefined>
|
|
5514
|
+
async getJson<T>(path: string): Promise<T>
|
|
5515
|
+
async postJsonVoid<T>(path: string, params: T): Promise<void>
|
|
5516
|
+
async addHeader(header: BaseBlockHeader): Promise<void>
|
|
5517
|
+
async startListening(): Promise<void>
|
|
5518
|
+
async listening(): Promise<void>
|
|
5519
|
+
async getChain(): Promise<Chain>
|
|
5520
|
+
async isListening(): Promise<boolean>
|
|
5521
|
+
async isSynchronized(): Promise<boolean>
|
|
5522
|
+
async getPresentHeight(): Promise<number>
|
|
5523
|
+
async getInfo(): Promise<ChaintracksInfoApi>
|
|
5524
|
+
async findChainTipHeader(): Promise<BlockHeader>
|
|
5525
|
+
async findChainTipHash(): Promise<string>
|
|
5526
|
+
async getHeaders(height: number, count: number): Promise<string>
|
|
5527
|
+
async findHeaderForHeight(height: number): Promise<BlockHeader | undefined>
|
|
5528
|
+
async findHeaderForBlockHash(hash: string): Promise<BlockHeader | undefined>
|
|
5592
5529
|
}
|
|
5593
5530
|
```
|
|
5594
5531
|
|
|
5595
5532
|
See also: [BaseBlockHeader](./client.md#interface-baseblockheader), [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [ChaintracksClientApi](./services.md#interface-chaintracksclientapi), [ChaintracksInfoApi](./services.md#interface-chaintracksinfoapi), [ChaintracksServiceClientOptions](./services.md#interface-chaintracksserviceclientoptions), [HeaderListener](./services.md#type-headerlistener), [ReorgListener](./services.md#type-reorglistener)
|
|
5596
5533
|
|
|
5597
|
-
###### Property supportsReorgEvents
|
|
5598
|
-
|
|
5599
|
-
HTTP polling client; callback event methods are legacy unsupported stubs.
|
|
5600
|
-
|
|
5601
|
-
```ts
|
|
5602
|
-
readonly supportsReorgEvents = false
|
|
5603
|
-
```
|
|
5604
|
-
|
|
5605
5534
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5606
5535
|
|
|
5607
5536
|
---
|
|
@@ -5611,7 +5540,7 @@ Required interface methods of a Chaintracks Storage Engine implementation.
|
|
|
5611
5540
|
|
|
5612
5541
|
```ts
|
|
5613
5542
|
export abstract class ChaintracksStorageBase implements ChaintracksStorageQueryApi, ChaintracksStorageIngestApi {
|
|
5614
|
-
static createStorageBaseOptions(chain: Chain): ChaintracksStorageBaseOptions
|
|
5543
|
+
static createStorageBaseOptions(chain: Chain): ChaintracksStorageBaseOptions
|
|
5615
5544
|
log: (...args: any[]) => void = () => { };
|
|
5616
5545
|
chain: Chain;
|
|
5617
5546
|
liveHeightThreshold: number;
|
|
@@ -5621,19 +5550,19 @@ export abstract class ChaintracksStorageBase implements ChaintracksStorageQueryA
|
|
|
5621
5550
|
isAvailable: boolean = false;
|
|
5622
5551
|
hasMigrated: boolean = false;
|
|
5623
5552
|
bulkManager: BulkFileDataManager;
|
|
5624
|
-
constructor(options: ChaintracksStorageBaseOptions)
|
|
5625
|
-
protected validateIncomingHeader(header: BlockHeader): BlockHeader
|
|
5626
|
-
protected validateLiveHeaderRecord(header: LiveBlockHeader, allowUnassignedHeaderId = false): LiveBlockHeader
|
|
5627
|
-
protected validateHeight(height: number, name = "height"): void
|
|
5628
|
-
protected validateHeaderId(headerId: number, name = "headerId"): void
|
|
5629
|
-
protected validateHash(hash: string, name = "hash"): void
|
|
5630
|
-
protected validateRange(range: HeightRange, maximumLength = MAX_PUBLIC_HEADER_RANGE): void
|
|
5631
|
-
protected recordTraversalVisit(seen: Set<number>, header: LiveBlockHeader, operation: string): void
|
|
5632
|
-
protected validateStoredParentLink(child: LiveBlockHeader, parent: LiveBlockHeader): void
|
|
5633
|
-
async shutdown(): Promise<void>
|
|
5634
|
-
async makeAvailable(): Promise<void>
|
|
5635
|
-
async migrateLatest(): Promise<void>
|
|
5636
|
-
async dropAllData(): Promise<void>
|
|
5553
|
+
constructor(options: ChaintracksStorageBaseOptions)
|
|
5554
|
+
protected validateIncomingHeader(header: BlockHeader): BlockHeader
|
|
5555
|
+
protected validateLiveHeaderRecord(header: LiveBlockHeader, allowUnassignedHeaderId = false): LiveBlockHeader
|
|
5556
|
+
protected validateHeight(height: number, name = "height"): void
|
|
5557
|
+
protected validateHeaderId(headerId: number, name = "headerId"): void
|
|
5558
|
+
protected validateHash(hash: string, name = "hash"): void
|
|
5559
|
+
protected validateRange(range: HeightRange, maximumLength = MAX_PUBLIC_HEADER_RANGE): void
|
|
5560
|
+
protected recordTraversalVisit(seen: Set<number>, header: LiveBlockHeader, operation: string): void
|
|
5561
|
+
protected validateStoredParentLink(child: LiveBlockHeader, parent: LiveBlockHeader): void
|
|
5562
|
+
async shutdown(): Promise<void>
|
|
5563
|
+
async makeAvailable(): Promise<void>
|
|
5564
|
+
async migrateLatest(): Promise<void>
|
|
5565
|
+
async dropAllData(): Promise<void>
|
|
5637
5566
|
abstract deleteLiveBlockHeaders(): Promise<void>;
|
|
5638
5567
|
abstract deleteOlderLiveBlockHeaders(maxHeight: number): Promise<number>;
|
|
5639
5568
|
abstract findChainTipHeader(): Promise<LiveBlockHeader>;
|
|
@@ -5648,26 +5577,26 @@ export abstract class ChaintracksStorageBase implements ChaintracksStorageQueryA
|
|
|
5648
5577
|
abstract getLiveHeaders(range: HeightRange): Promise<LiveBlockHeader[]>;
|
|
5649
5578
|
abstract insertHeader(header: BlockHeader): Promise<InsertHeaderResult>;
|
|
5650
5579
|
abstract destroy(): Promise<void>;
|
|
5651
|
-
async getBulkHeaders(range: HeightRange): Promise<Uint8Array>
|
|
5652
|
-
async getHeadersUint8Array(height: number, count: number): Promise<Uint8Array>
|
|
5653
|
-
async getHeaders(height: number, count: number): Promise<BaseBlockHeader[]>
|
|
5654
|
-
async deleteBulkBlockHeaders(): Promise<void>
|
|
5580
|
+
async getBulkHeaders(range: HeightRange): Promise<Uint8Array>
|
|
5581
|
+
async getHeadersUint8Array(height: number, count: number): Promise<Uint8Array>
|
|
5582
|
+
async getHeaders(height: number, count: number): Promise<BaseBlockHeader[]>
|
|
5583
|
+
async deleteBulkBlockHeaders(): Promise<void>
|
|
5655
5584
|
async getAvailableHeightRanges(): Promise<{
|
|
5656
5585
|
bulk: HeightRange;
|
|
5657
5586
|
live: HeightRange;
|
|
5658
|
-
}>
|
|
5659
|
-
async pruneLiveBlockHeaders(activeTipHeight: number): Promise<void>
|
|
5660
|
-
async findChainTipHash(): Promise<string>
|
|
5661
|
-
async findChainTipWork(): Promise<string>
|
|
5662
|
-
async findChainWorkForBlockHash(hash: string): Promise<string>
|
|
5663
|
-
async findBulkFilesHeaderForHeightOrUndefined(height: number): Promise<BlockHeader | undefined>
|
|
5664
|
-
async findHeaderForHeightOrUndefined(height: number): Promise<LiveBlockHeader | BlockHeader | undefined>
|
|
5665
|
-
async findHeaderForHeight(height: number): Promise<LiveBlockHeader | BlockHeader>
|
|
5666
|
-
async isMerkleRootActive(merkleRoot: string): Promise<boolean>
|
|
5667
|
-
async findCommonAncestor(header1: LiveBlockHeader, header2: LiveBlockHeader): Promise<LiveBlockHeader>
|
|
5668
|
-
async findReorgDepth(header1: LiveBlockHeader, header2: LiveBlockHeader): Promise<number>
|
|
5669
|
-
async migrateLiveToBulk(count: number, ignoreLimits = false): Promise<void>
|
|
5670
|
-
async addBulkHeaders(headers: BlockHeader[], bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5587
|
+
}>
|
|
5588
|
+
async pruneLiveBlockHeaders(activeTipHeight: number): Promise<void>
|
|
5589
|
+
async findChainTipHash(): Promise<string>
|
|
5590
|
+
async findChainTipWork(): Promise<string>
|
|
5591
|
+
async findChainWorkForBlockHash(hash: string): Promise<string>
|
|
5592
|
+
async findBulkFilesHeaderForHeightOrUndefined(height: number): Promise<BlockHeader | undefined>
|
|
5593
|
+
async findHeaderForHeightOrUndefined(height: number): Promise<LiveBlockHeader | BlockHeader | undefined>
|
|
5594
|
+
async findHeaderForHeight(height: number): Promise<LiveBlockHeader | BlockHeader>
|
|
5595
|
+
async isMerkleRootActive(merkleRoot: string): Promise<boolean>
|
|
5596
|
+
async findCommonAncestor(header1: LiveBlockHeader, header2: LiveBlockHeader): Promise<LiveBlockHeader>
|
|
5597
|
+
async findReorgDepth(header1: LiveBlockHeader, header2: LiveBlockHeader): Promise<number>
|
|
5598
|
+
async migrateLiveToBulk(count: number, ignoreLimits = false): Promise<void>
|
|
5599
|
+
async addBulkHeaders(headers: BlockHeader[], bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5671
5600
|
}
|
|
5672
5601
|
```
|
|
5673
5602
|
|
|
@@ -5700,34 +5629,34 @@ export class ChaintracksStorageIdb extends ChaintracksStorageBase implements Cha
|
|
|
5700
5629
|
db?: IDBPDatabase<ChaintracksStorageIdbSchema>;
|
|
5701
5630
|
whenLastAccess?: Date;
|
|
5702
5631
|
allStores: string[] = ["live_headers", "bulk_headers"];
|
|
5703
|
-
constructor(options: ChaintracksStorageIdbOptions)
|
|
5704
|
-
override async makeAvailable(): Promise<void>
|
|
5705
|
-
override async migrateLatest(): Promise<void>
|
|
5706
|
-
override async destroy(): Promise<void>
|
|
5707
|
-
override async deleteLiveBlockHeaders(): Promise<void>
|
|
5708
|
-
override async deleteOlderLiveBlockHeaders(maxHeight: number): Promise<number>
|
|
5709
|
-
override async findChainTipHeader(): Promise<LiveBlockHeader>
|
|
5710
|
-
override async findChainTipHeaderOrUndefined(): Promise<LiveBlockHeader | undefined>
|
|
5711
|
-
override async findLiveHeaderForBlockHash(hash: string): Promise<LiveBlockHeader | null>
|
|
5712
|
-
override async findLiveHeaderForHeaderId(headerId: number): Promise<LiveBlockHeader>
|
|
5713
|
-
override async findLiveHeaderForHeight(height: number): Promise<LiveBlockHeader | null>
|
|
5714
|
-
override async findLiveHeaderForMerkleRoot(merkleRoot: string): Promise<LiveBlockHeader | null>
|
|
5715
|
-
override async findLiveHeightRange(): Promise<HeightRange>
|
|
5716
|
-
override async findMaxHeaderId(): Promise<number>
|
|
5717
|
-
override async liveHeadersForBulk(count: number): Promise<LiveBlockHeader[]>
|
|
5718
|
-
override async getLiveHeaders(range: HeightRange): Promise<LiveBlockHeader[]>
|
|
5719
|
-
override async insertHeader(header: BlockHeader): Promise<InsertHeaderResult>
|
|
5720
|
-
async deleteBulkFile(fileId: number): Promise<number>
|
|
5721
|
-
async insertBulkFile(file: BulkHeaderFileInfo): Promise<number>
|
|
5722
|
-
async updateBulkFile(fileId: number, file: BulkHeaderFileInfo): Promise<number>
|
|
5723
|
-
async replaceBulkFiles(files: BulkHeaderFileInfo[]): Promise<BulkHeaderFileInfo[]>
|
|
5724
|
-
async getBulkFiles(): Promise<BulkHeaderFileInfo[]>
|
|
5725
|
-
async getBulkFileData(fileId: number, offset?: number, length?: number): Promise<Uint8Array | undefined>
|
|
5726
|
-
protected repairStoredLiveHeader(header?: LiveBlockHeader): LiveBlockHeader | undefined
|
|
5727
|
-
async insertLiveHeader(header: LiveBlockHeader): Promise<LiveBlockHeader>
|
|
5728
|
-
async initDB(): Promise<IDBPDatabase<ChaintracksStorageIdbSchema>>
|
|
5729
|
-
toDbTrxReadOnly(stores: string[]): IDBPTransaction<ChaintracksStorageIdbSchema, string[], "readonly">
|
|
5730
|
-
toDbTrxReadWrite(stores: string[]): IDBPTransaction<ChaintracksStorageIdbSchema, string[], "readwrite">
|
|
5632
|
+
constructor(options: ChaintracksStorageIdbOptions)
|
|
5633
|
+
override async makeAvailable(): Promise<void>
|
|
5634
|
+
override async migrateLatest(): Promise<void>
|
|
5635
|
+
override async destroy(): Promise<void>
|
|
5636
|
+
override async deleteLiveBlockHeaders(): Promise<void>
|
|
5637
|
+
override async deleteOlderLiveBlockHeaders(maxHeight: number): Promise<number>
|
|
5638
|
+
override async findChainTipHeader(): Promise<LiveBlockHeader>
|
|
5639
|
+
override async findChainTipHeaderOrUndefined(): Promise<LiveBlockHeader | undefined>
|
|
5640
|
+
override async findLiveHeaderForBlockHash(hash: string): Promise<LiveBlockHeader | null>
|
|
5641
|
+
override async findLiveHeaderForHeaderId(headerId: number): Promise<LiveBlockHeader>
|
|
5642
|
+
override async findLiveHeaderForHeight(height: number): Promise<LiveBlockHeader | null>
|
|
5643
|
+
override async findLiveHeaderForMerkleRoot(merkleRoot: string): Promise<LiveBlockHeader | null>
|
|
5644
|
+
override async findLiveHeightRange(): Promise<HeightRange>
|
|
5645
|
+
override async findMaxHeaderId(): Promise<number>
|
|
5646
|
+
override async liveHeadersForBulk(count: number): Promise<LiveBlockHeader[]>
|
|
5647
|
+
override async getLiveHeaders(range: HeightRange): Promise<LiveBlockHeader[]>
|
|
5648
|
+
override async insertHeader(header: BlockHeader): Promise<InsertHeaderResult>
|
|
5649
|
+
async deleteBulkFile(fileId: number): Promise<number>
|
|
5650
|
+
async insertBulkFile(file: BulkHeaderFileInfo): Promise<number>
|
|
5651
|
+
async updateBulkFile(fileId: number, file: BulkHeaderFileInfo): Promise<number>
|
|
5652
|
+
async replaceBulkFiles(files: BulkHeaderFileInfo[]): Promise<BulkHeaderFileInfo[]>
|
|
5653
|
+
async getBulkFiles(): Promise<BulkHeaderFileInfo[]>
|
|
5654
|
+
async getBulkFileData(fileId: number, offset?: number, length?: number): Promise<Uint8Array | undefined>
|
|
5655
|
+
protected repairStoredLiveHeader(header?: LiveBlockHeader): LiveBlockHeader | undefined
|
|
5656
|
+
async insertLiveHeader(header: LiveBlockHeader): Promise<LiveBlockHeader>
|
|
5657
|
+
async initDB(): Promise<IDBPDatabase<ChaintracksStorageIdbSchema>>
|
|
5658
|
+
toDbTrxReadOnly(stores: string[]): IDBPTransaction<ChaintracksStorageIdbSchema, string[], "readonly">
|
|
5659
|
+
toDbTrxReadWrite(stores: string[]): IDBPTransaction<ChaintracksStorageIdbSchema, string[], "readwrite">
|
|
5731
5660
|
}
|
|
5732
5661
|
```
|
|
5733
5662
|
|
|
@@ -5741,7 +5670,7 @@ Set existing headers with previousHeaderId value set to the headerId value of
|
|
|
5741
5670
|
a header which is to be deleted to null.
|
|
5742
5671
|
|
|
5743
5672
|
```ts
|
|
5744
|
-
override async deleteOlderLiveBlockHeaders(maxHeight: number): Promise<number>
|
|
5673
|
+
override async deleteOlderLiveBlockHeaders(maxHeight: number): Promise<number>
|
|
5745
5674
|
```
|
|
5746
5675
|
|
|
5747
5676
|
Returns
|
|
@@ -5756,7 +5685,7 @@ Argument Details
|
|
|
5756
5685
|
###### Method findChainTipHeader
|
|
5757
5686
|
|
|
5758
5687
|
```ts
|
|
5759
|
-
override async findChainTipHeader(): Promise<LiveBlockHeader>
|
|
5688
|
+
override async findChainTipHeader(): Promise<LiveBlockHeader>
|
|
5760
5689
|
```
|
|
5761
5690
|
See also: [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
5762
5691
|
|
|
@@ -5771,7 +5700,7 @@ an error if there is no tip.
|
|
|
5771
5700
|
###### Method findChainTipHeaderOrUndefined
|
|
5772
5701
|
|
|
5773
5702
|
```ts
|
|
5774
|
-
override async findChainTipHeaderOrUndefined(): Promise<LiveBlockHeader | undefined>
|
|
5703
|
+
override async findChainTipHeaderOrUndefined(): Promise<LiveBlockHeader | undefined>
|
|
5775
5704
|
```
|
|
5776
5705
|
See also: [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
5777
5706
|
|
|
@@ -5791,7 +5720,7 @@ So true is stored as a 1, and false is stored as no property value (delete v['pr
|
|
|
5791
5720
|
This function restores these property values to true and false.
|
|
5792
5721
|
|
|
5793
5722
|
```ts
|
|
5794
|
-
protected repairStoredLiveHeader(header?: LiveBlockHeader): LiveBlockHeader | undefined
|
|
5723
|
+
protected repairStoredLiveHeader(header?: LiveBlockHeader): LiveBlockHeader | undefined
|
|
5795
5724
|
```
|
|
5796
5725
|
See also: [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
5797
5726
|
|
|
@@ -5809,40 +5738,40 @@ Also see `chaintracksStorageMemory` which leverages Knex support for an in memor
|
|
|
5809
5738
|
|
|
5810
5739
|
```ts
|
|
5811
5740
|
export class ChaintracksStorageKnex extends ChaintracksStorageBase implements ChaintracksStorageBulkFileApi {
|
|
5812
|
-
static createStorageKnexOptions(chain: Chain, knex?: Knex): ChaintracksStorageKnexOptions
|
|
5741
|
+
static createStorageKnexOptions(chain: Chain, knex?: Knex): ChaintracksStorageKnexOptions
|
|
5813
5742
|
knex: Knex;
|
|
5814
5743
|
_dbtype?: DBType;
|
|
5815
5744
|
bulkFilesTableName: string = "bulk_files";
|
|
5816
5745
|
headerTableName: string = "live_headers";
|
|
5817
5746
|
stateTableName: string = "chaintracks_state";
|
|
5818
|
-
constructor(options: ChaintracksStorageKnexOptions)
|
|
5819
|
-
get dbtype(): DBType
|
|
5820
|
-
override async shutdown(): Promise<void>
|
|
5821
|
-
override async makeAvailable(): Promise<void>
|
|
5822
|
-
override async migrateLatest(): Promise<void>
|
|
5823
|
-
override async dropAllData(): Promise<void>
|
|
5824
|
-
override async destroy(): Promise<void>
|
|
5825
|
-
override async findLiveHeightRange(): Promise<HeightRange>
|
|
5826
|
-
override async findLiveHeaderForHeaderId(headerId: number): Promise<LiveBlockHeader>
|
|
5827
|
-
override async findChainTipHeader(): Promise<LiveBlockHeader>
|
|
5828
|
-
override async findChainTipHeaderOrUndefined(): Promise<LiveBlockHeader | undefined>
|
|
5829
|
-
async findLiveHeaderForHeight(height: number): Promise<LiveBlockHeader | null>
|
|
5830
|
-
async findLiveHeaderForBlockHash(hash: string): Promise<LiveBlockHeader | null>
|
|
5831
|
-
async findLiveHeaderForMerkleRoot(merkleRoot: string): Promise<LiveBlockHeader | null>
|
|
5832
|
-
async deleteBulkFile(fileId: number): Promise<number>
|
|
5833
|
-
async insertBulkFile(file: BulkHeaderFileInfo): Promise<number>
|
|
5834
|
-
async updateBulkFile(fileId: number, file: BulkHeaderFileInfo): Promise<number>
|
|
5835
|
-
async replaceBulkFiles(files: BulkHeaderFileInfo[]): Promise<BulkHeaderFileInfo[]>
|
|
5836
|
-
async getBulkFiles(): Promise<BulkHeaderFileInfo[]>
|
|
5837
|
-
async getBulkFileData(fileId: number, offset?: number, length?: number): Promise<Uint8Array | undefined>
|
|
5838
|
-
async insertHeader(header: BlockHeader): Promise<InsertHeaderResult>
|
|
5839
|
-
async findMaxHeaderId(): Promise<number>
|
|
5840
|
-
override async deleteLiveBlockHeaders(): Promise<void>
|
|
5841
|
-
override async deleteBulkBlockHeaders(): Promise<void>
|
|
5842
|
-
async deleteOlderLiveBlockHeaders(maxHeight: number): Promise<number>
|
|
5843
|
-
async getLiveHeaders(range: HeightRange): Promise<LiveBlockHeader[]>
|
|
5844
|
-
concatSerializedHeaders(bufs: number[][]): number[]
|
|
5845
|
-
async liveHeadersForBulk(count: number): Promise<LiveBlockHeader[]>
|
|
5747
|
+
constructor(options: ChaintracksStorageKnexOptions)
|
|
5748
|
+
get dbtype(): DBType
|
|
5749
|
+
override async shutdown(): Promise<void>
|
|
5750
|
+
override async makeAvailable(): Promise<void>
|
|
5751
|
+
override async migrateLatest(): Promise<void>
|
|
5752
|
+
override async dropAllData(): Promise<void>
|
|
5753
|
+
override async destroy(): Promise<void>
|
|
5754
|
+
override async findLiveHeightRange(): Promise<HeightRange>
|
|
5755
|
+
override async findLiveHeaderForHeaderId(headerId: number): Promise<LiveBlockHeader>
|
|
5756
|
+
override async findChainTipHeader(): Promise<LiveBlockHeader>
|
|
5757
|
+
override async findChainTipHeaderOrUndefined(): Promise<LiveBlockHeader | undefined>
|
|
5758
|
+
async findLiveHeaderForHeight(height: number): Promise<LiveBlockHeader | null>
|
|
5759
|
+
async findLiveHeaderForBlockHash(hash: string): Promise<LiveBlockHeader | null>
|
|
5760
|
+
async findLiveHeaderForMerkleRoot(merkleRoot: string): Promise<LiveBlockHeader | null>
|
|
5761
|
+
async deleteBulkFile(fileId: number): Promise<number>
|
|
5762
|
+
async insertBulkFile(file: BulkHeaderFileInfo): Promise<number>
|
|
5763
|
+
async updateBulkFile(fileId: number, file: BulkHeaderFileInfo): Promise<number>
|
|
5764
|
+
async replaceBulkFiles(files: BulkHeaderFileInfo[]): Promise<BulkHeaderFileInfo[]>
|
|
5765
|
+
async getBulkFiles(): Promise<BulkHeaderFileInfo[]>
|
|
5766
|
+
async getBulkFileData(fileId: number, offset?: number, length?: number): Promise<Uint8Array | undefined>
|
|
5767
|
+
async insertHeader(header: BlockHeader): Promise<InsertHeaderResult>
|
|
5768
|
+
async findMaxHeaderId(): Promise<number>
|
|
5769
|
+
override async deleteLiveBlockHeaders(): Promise<void>
|
|
5770
|
+
override async deleteBulkBlockHeaders(): Promise<void>
|
|
5771
|
+
async deleteOlderLiveBlockHeaders(maxHeight: number): Promise<number>
|
|
5772
|
+
async getLiveHeaders(range: HeightRange): Promise<LiveBlockHeader[]>
|
|
5773
|
+
concatSerializedHeaders(bufs: number[][]): number[]
|
|
5774
|
+
async liveHeadersForBulk(count: number): Promise<LiveBlockHeader[]>
|
|
5846
5775
|
}
|
|
5847
5776
|
```
|
|
5848
5777
|
|
|
@@ -5890,22 +5819,29 @@ export class ChaintracksStorageNoDb extends ChaintracksStorageBase {
|
|
|
5890
5819
|
tipHeaderId: 0,
|
|
5891
5820
|
hashToHeaderId: new Map<string, number>()
|
|
5892
5821
|
};
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
override async
|
|
5902
|
-
|
|
5903
|
-
override async
|
|
5904
|
-
override async
|
|
5905
|
-
override async
|
|
5906
|
-
override async
|
|
5907
|
-
override async
|
|
5908
|
-
override async
|
|
5822
|
+
static readonly regtestData: ChaintracksNoDbData = {
|
|
5823
|
+
chain: "regtest",
|
|
5824
|
+
liveHeaders: new Map<number, LiveBlockHeader>(),
|
|
5825
|
+
maxHeaderId: 0,
|
|
5826
|
+
tipHeaderId: 0,
|
|
5827
|
+
hashToHeaderId: new Map<string, number>()
|
|
5828
|
+
};
|
|
5829
|
+
constructor(options: ChaintracksStorageNoDbOptions)
|
|
5830
|
+
override async destroy(): Promise<void>
|
|
5831
|
+
async getData(): Promise<ChaintracksNoDbData>
|
|
5832
|
+
override async deleteLiveBlockHeaders(): Promise<void>
|
|
5833
|
+
override async deleteOlderLiveBlockHeaders(maxHeight: number): Promise<number>
|
|
5834
|
+
override async findChainTipHeader(): Promise<LiveBlockHeader>
|
|
5835
|
+
override async findChainTipHeaderOrUndefined(): Promise<LiveBlockHeader | undefined>
|
|
5836
|
+
override async findLiveHeaderForBlockHash(hash: string): Promise<LiveBlockHeader | null>
|
|
5837
|
+
override async findLiveHeaderForHeaderId(headerId: number): Promise<LiveBlockHeader>
|
|
5838
|
+
override async findLiveHeaderForHeight(height: number): Promise<LiveBlockHeader | null>
|
|
5839
|
+
override async findLiveHeaderForMerkleRoot(merkleRoot: string): Promise<LiveBlockHeader | null>
|
|
5840
|
+
override async findLiveHeightRange(): Promise<HeightRange>
|
|
5841
|
+
override async findMaxHeaderId(): Promise<number>
|
|
5842
|
+
override async liveHeadersForBulk(count: number): Promise<LiveBlockHeader[]>
|
|
5843
|
+
override async getLiveHeaders(range: HeightRange): Promise<LiveBlockHeader[]>
|
|
5844
|
+
override async insertHeader(header: BlockHeader): Promise<InsertHeaderResult>
|
|
5909
5845
|
}
|
|
5910
5846
|
```
|
|
5911
5847
|
|
|
@@ -5916,7 +5852,7 @@ See also: [BlockHeader](./client.md#interface-blockheader), [ChaintracksStorageB
|
|
|
5916
5852
|
Returns an isolated diagnostic snapshot; mutating it never changes tracker state.
|
|
5917
5853
|
|
|
5918
5854
|
```ts
|
|
5919
|
-
async getData(): Promise<ChaintracksNoDbData>
|
|
5855
|
+
async getData(): Promise<ChaintracksNoDbData>
|
|
5920
5856
|
```
|
|
5921
5857
|
|
|
5922
5858
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -5926,8 +5862,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5926
5862
|
|
|
5927
5863
|
```ts
|
|
5928
5864
|
export class ChaintracksWritableFile extends ChaintracksFolderAwareFile implements ChaintracksWritableFileApi {
|
|
5929
|
-
static async openAsWritable(path: string): Promise<ChaintracksWritableFile>
|
|
5930
|
-
async append(data: Uint8Array): Promise<void>
|
|
5865
|
+
static async openAsWritable(path: string): Promise<ChaintracksWritableFile>
|
|
5866
|
+
async append(data: Uint8Array): Promise<void>
|
|
5931
5867
|
}
|
|
5932
5868
|
```
|
|
5933
5869
|
|
|
@@ -5946,10 +5882,10 @@ unrecorded request. Deployments must place `stateFile` on durable storage.
|
|
|
5946
5882
|
|
|
5947
5883
|
```ts
|
|
5948
5884
|
export class DurableFileBulkFileDownloadBudget implements BulkFileDownloadBudgetApi {
|
|
5949
|
-
constructor(options: DurableFileBulkFileDownloadBudgetOptions)
|
|
5950
|
-
async initialize(): Promise<void>
|
|
5951
|
-
async consume(byteCount: number): Promise<void>
|
|
5952
|
-
snapshot(): BulkFileDownloadBudgetSnapshot
|
|
5885
|
+
constructor(options: DurableFileBulkFileDownloadBudgetOptions)
|
|
5886
|
+
async initialize(): Promise<void>
|
|
5887
|
+
async consume(byteCount: number): Promise<void>
|
|
5888
|
+
snapshot(): BulkFileDownloadBudgetSnapshot
|
|
5953
5889
|
}
|
|
5954
5890
|
```
|
|
5955
5891
|
|
|
@@ -5963,7 +5899,7 @@ Load and validate the durable ledger before the service becomes ready.
|
|
|
5963
5899
|
readiness reports the persisted allowance and corrupt state fails startup.
|
|
5964
5900
|
|
|
5965
5901
|
```ts
|
|
5966
|
-
async initialize(): Promise<void>
|
|
5902
|
+
async initialize(): Promise<void>
|
|
5967
5903
|
```
|
|
5968
5904
|
|
|
5969
5905
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -5977,15 +5913,15 @@ fails, preventing a failing upstream from bypassing the bound.
|
|
|
5977
5913
|
|
|
5978
5914
|
```ts
|
|
5979
5915
|
export class FixedWindowBulkFileDownloadBudget implements BulkFileDownloadBudgetApi {
|
|
5980
|
-
constructor(options: FixedWindowBulkFileDownloadBudgetOptions)
|
|
5981
|
-
consume(byteCount: number): void
|
|
5916
|
+
constructor(options: FixedWindowBulkFileDownloadBudgetOptions)
|
|
5917
|
+
consume(byteCount: number): void
|
|
5982
5918
|
snapshot(): {
|
|
5983
5919
|
maxBytes: number;
|
|
5984
5920
|
consumedBytes: number;
|
|
5985
5921
|
remainingBytes: number;
|
|
5986
5922
|
windowStartedAt: number;
|
|
5987
5923
|
windowMsecs: number;
|
|
5988
|
-
}
|
|
5924
|
+
}
|
|
5989
5925
|
}
|
|
5990
5926
|
```
|
|
5991
5927
|
|
|
@@ -6003,39 +5939,30 @@ processing without a local WhatsOnChain polling ingestor.
|
|
|
6003
5939
|
|
|
6004
5940
|
```ts
|
|
6005
5941
|
export class GoChaintracksServiceClient implements ChaintracksClientApi {
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
async
|
|
6009
|
-
async
|
|
6010
|
-
async
|
|
6011
|
-
async
|
|
6012
|
-
async
|
|
6013
|
-
async
|
|
6014
|
-
async
|
|
6015
|
-
async
|
|
6016
|
-
async
|
|
6017
|
-
async
|
|
6018
|
-
async
|
|
6019
|
-
async
|
|
6020
|
-
async
|
|
6021
|
-
async
|
|
6022
|
-
async
|
|
6023
|
-
async
|
|
6024
|
-
async
|
|
6025
|
-
async unsubscribe(subscriptionId: string): Promise<boolean>
|
|
5942
|
+
constructor(public chain: Chain, serviceUrl: string, options: GoChaintracksServiceClientOptions = {})
|
|
5943
|
+
async currentHeight(): Promise<number>
|
|
5944
|
+
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
5945
|
+
async getChain(): Promise<Chain>
|
|
5946
|
+
async getInfo(): Promise<ChaintracksInfoApi>
|
|
5947
|
+
async getPresentHeight(): Promise<number>
|
|
5948
|
+
async getHeaders(height: number, count: number): Promise<string>
|
|
5949
|
+
async findChainTipHeader(): Promise<BlockHeader>
|
|
5950
|
+
async findChainTipHash(): Promise<string>
|
|
5951
|
+
async findHeaderForHeight(height: number): Promise<BlockHeader | undefined>
|
|
5952
|
+
async findHeaderForBlockHash(hash: string): Promise<BlockHeader | undefined>
|
|
5953
|
+
async addHeader(_header: BaseBlockHeader): Promise<void>
|
|
5954
|
+
async startListening(): Promise<void>
|
|
5955
|
+
async listening(): Promise<void>
|
|
5956
|
+
async isListening(): Promise<boolean>
|
|
5957
|
+
async isSynchronized(): Promise<boolean>
|
|
5958
|
+
async subscribeHeaders(listener: HeaderListener): Promise<string>
|
|
5959
|
+
async subscribeReorgs(listener: ReorgListener): Promise<string>
|
|
5960
|
+
async unsubscribe(subscriptionId: string): Promise<boolean>
|
|
6026
5961
|
}
|
|
6027
5962
|
```
|
|
6028
5963
|
|
|
6029
5964
|
See also: [BaseBlockHeader](./client.md#interface-baseblockheader), [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [ChaintracksClientApi](./services.md#interface-chaintracksclientapi), [ChaintracksInfoApi](./services.md#interface-chaintracksinfoapi), [GoChaintracksServiceClientOptions](./services.md#interface-gochaintracksserviceclientoptions), [HeaderListener](./services.md#type-headerlistener), [ReorgListener](./services.md#type-reorglistener)
|
|
6030
5965
|
|
|
6031
|
-
###### Property supportsReorgEvents
|
|
6032
|
-
|
|
6033
|
-
SSE client; reorg registration is a supported additive capability.
|
|
6034
|
-
|
|
6035
|
-
```ts
|
|
6036
|
-
readonly supportsReorgEvents = true
|
|
6037
|
-
```
|
|
6038
|
-
|
|
6039
5966
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6040
5967
|
|
|
6041
5968
|
---
|
|
@@ -6047,18 +5974,18 @@ Operations support integrating contiguous batches of headers,
|
|
|
6047
5974
|
|
|
6048
5975
|
```ts
|
|
6049
5976
|
export class HeightRange implements HeightRangeApi {
|
|
6050
|
-
constructor(public minHeight: number, public maxHeight: number)
|
|
5977
|
+
constructor(public minHeight: number, public maxHeight: number)
|
|
6051
5978
|
static readonly empty = new HeightRange(0, -1);
|
|
6052
|
-
get isEmpty()
|
|
6053
|
-
static from(headers: BlockHeader[]): HeightRange
|
|
6054
|
-
get length()
|
|
6055
|
-
toString(): string
|
|
6056
|
-
contains(range: HeightRange | number)
|
|
6057
|
-
intersect(range: HeightRange)
|
|
6058
|
-
union(range: HeightRange)
|
|
6059
|
-
subtract(range: HeightRange)
|
|
6060
|
-
above(range: HeightRange)
|
|
6061
|
-
copy(): HeightRange
|
|
5979
|
+
get isEmpty()
|
|
5980
|
+
static from(headers: BlockHeader[]): HeightRange
|
|
5981
|
+
get length()
|
|
5982
|
+
toString(): string
|
|
5983
|
+
contains(range: HeightRange | number)
|
|
5984
|
+
intersect(range: HeightRange)
|
|
5985
|
+
union(range: HeightRange)
|
|
5986
|
+
subtract(range: HeightRange)
|
|
5987
|
+
above(range: HeightRange)
|
|
5988
|
+
copy(): HeightRange
|
|
6062
5989
|
}
|
|
6063
5990
|
```
|
|
6064
5991
|
|
|
@@ -6084,14 +6011,14 @@ Otherwise returns a copy of this range.
|
|
|
6084
6011
|
This returns the portion of this range that is strictly above `range`.
|
|
6085
6012
|
|
|
6086
6013
|
```ts
|
|
6087
|
-
above(range: HeightRange)
|
|
6014
|
+
above(range: HeightRange)
|
|
6088
6015
|
```
|
|
6089
6016
|
See also: [HeightRange](./services.md#class-heightrange)
|
|
6090
6017
|
|
|
6091
6018
|
###### Method contains
|
|
6092
6019
|
|
|
6093
6020
|
```ts
|
|
6094
|
-
contains(range: HeightRange | number)
|
|
6021
|
+
contains(range: HeightRange | number)
|
|
6095
6022
|
```
|
|
6096
6023
|
See also: [HeightRange](./services.md#class-heightrange)
|
|
6097
6024
|
|
|
@@ -6109,14 +6036,14 @@ Argument Details
|
|
|
6109
6036
|
Return a copy of this range.
|
|
6110
6037
|
|
|
6111
6038
|
```ts
|
|
6112
|
-
copy(): HeightRange
|
|
6039
|
+
copy(): HeightRange
|
|
6113
6040
|
```
|
|
6114
6041
|
See also: [HeightRange](./services.md#class-heightrange)
|
|
6115
6042
|
|
|
6116
6043
|
###### Method from
|
|
6117
6044
|
|
|
6118
6045
|
```ts
|
|
6119
|
-
static from(headers: BlockHeader[]): HeightRange
|
|
6046
|
+
static from(headers: BlockHeader[]): HeightRange
|
|
6120
6047
|
```
|
|
6121
6048
|
See also: [BlockHeader](./client.md#interface-blockheader), [HeightRange](./services.md#class-heightrange)
|
|
6122
6049
|
|
|
@@ -6138,7 +6065,7 @@ Intersection with an empty range is always empty.
|
|
|
6138
6065
|
The result is always a single, possibly empty, range.
|
|
6139
6066
|
|
|
6140
6067
|
```ts
|
|
6141
|
-
intersect(range: HeightRange)
|
|
6068
|
+
intersect(range: HeightRange)
|
|
6142
6069
|
```
|
|
6143
6070
|
See also: [HeightRange](./services.md#class-heightrange)
|
|
6144
6071
|
|
|
@@ -6149,7 +6076,7 @@ Returns `range` subtracted from this range.
|
|
|
6149
6076
|
Throws an error if the subtraction would create two disjoint ranges.
|
|
6150
6077
|
|
|
6151
6078
|
```ts
|
|
6152
|
-
subtract(range: HeightRange)
|
|
6079
|
+
subtract(range: HeightRange)
|
|
6153
6080
|
```
|
|
6154
6081
|
See also: [HeightRange](./services.md#class-heightrange)
|
|
6155
6082
|
|
|
@@ -6158,7 +6085,7 @@ See also: [HeightRange](./services.md#class-heightrange)
|
|
|
6158
6085
|
function toString() { [native code] }
|
|
6159
6086
|
|
|
6160
6087
|
```ts
|
|
6161
|
-
toString(): string
|
|
6088
|
+
toString(): string
|
|
6162
6089
|
```
|
|
6163
6090
|
|
|
6164
6091
|
Returns
|
|
@@ -6174,7 +6101,7 @@ Only valid if the two ranges overlap or touch, or one is empty.
|
|
|
6174
6101
|
Throws an error if the union would create two disjoint ranges.
|
|
6175
6102
|
|
|
6176
6103
|
```ts
|
|
6177
|
-
union(range: HeightRange)
|
|
6104
|
+
union(range: HeightRange)
|
|
6178
6105
|
```
|
|
6179
6106
|
See also: [HeightRange](./services.md#class-heightrange)
|
|
6180
6107
|
|
|
@@ -6189,7 +6116,7 @@ dependency-free fallback.
|
|
|
6189
6116
|
|
|
6190
6117
|
```ts
|
|
6191
6118
|
export class InlineBulkFileDataValidator implements BulkFileDataValidatorApi {
|
|
6192
|
-
async validate(request: BulkFileDataValidationRequest): Promise<BulkFileDataValidationResult>
|
|
6119
|
+
async validate(request: BulkFileDataValidationRequest): Promise<BulkFileDataValidationResult>
|
|
6193
6120
|
}
|
|
6194
6121
|
```
|
|
6195
6122
|
|
|
@@ -6202,13 +6129,13 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6202
6129
|
|
|
6203
6130
|
```ts
|
|
6204
6131
|
export abstract class LiveIngestorBase implements LiveIngestorApi {
|
|
6205
|
-
static createLiveIngestorBaseOptions(chain: Chain)
|
|
6132
|
+
static createLiveIngestorBaseOptions(chain: Chain)
|
|
6206
6133
|
chain: Chain;
|
|
6207
6134
|
log: (...args: any[]) => void = () => ;
|
|
6208
|
-
constructor(options: LiveIngestorBaseOptions)
|
|
6135
|
+
constructor(options: LiveIngestorBaseOptions)
|
|
6209
6136
|
async shutdown(): Promise<void> { }
|
|
6210
|
-
async setStorage(storage: ChaintracksStorageApi, log: (...args: any[]) => void): Promise<void>
|
|
6211
|
-
storage(): ChaintracksStorageApi
|
|
6137
|
+
async setStorage(storage: ChaintracksStorageApi, log: (...args: any[]) => void): Promise<void>
|
|
6138
|
+
storage(): ChaintracksStorageApi
|
|
6212
6139
|
abstract getHeaderByHash(hash: string): Promise<BlockHeader | undefined>;
|
|
6213
6140
|
abstract startListening(liveHeaders: BlockHeader[]): Promise<void>;
|
|
6214
6141
|
abstract stopListening(): void;
|
|
@@ -6237,7 +6164,7 @@ Argument Details
|
|
|
6237
6164
|
Allocate resources.
|
|
6238
6165
|
|
|
6239
6166
|
```ts
|
|
6240
|
-
async setStorage(storage: ChaintracksStorageApi, log: (...args: any[]) => void): Promise<void>
|
|
6167
|
+
async setStorage(storage: ChaintracksStorageApi, log: (...args: any[]) => void): Promise<void>
|
|
6241
6168
|
```
|
|
6242
6169
|
See also: [ChaintracksStorageApi](./services.md#interface-chaintracksstorageapi)
|
|
6243
6170
|
|
|
@@ -6252,7 +6179,7 @@ Release resources.
|
|
|
6252
6179
|
Override if required.
|
|
6253
6180
|
|
|
6254
6181
|
```ts
|
|
6255
|
-
async shutdown(): Promise<void>
|
|
6182
|
+
async shutdown(): Promise<void>
|
|
6256
6183
|
```
|
|
6257
6184
|
|
|
6258
6185
|
###### Method startListening
|
|
@@ -6284,7 +6211,7 @@ abstract stopListening(): void
|
|
|
6284
6211
|
###### Method storage
|
|
6285
6212
|
|
|
6286
6213
|
```ts
|
|
6287
|
-
storage(): ChaintracksStorageApi
|
|
6214
|
+
storage(): ChaintracksStorageApi
|
|
6288
6215
|
```
|
|
6289
6216
|
See also: [ChaintracksStorageApi](./services.md#interface-chaintracksstorageapi)
|
|
6290
6217
|
|
|
@@ -6302,12 +6229,12 @@ Adapts a remote Chaintracks event stream, such as Arcade/go-chaintracks
|
|
|
6302
6229
|
|
|
6303
6230
|
```ts
|
|
6304
6231
|
export class LiveIngestorChaintracksSSE extends LiveIngestorBase {
|
|
6305
|
-
static createLiveIngestorChaintracksSSEOptions(chain: Chain, chaintracks: ChaintracksClientApi): LiveIngestorChaintracksSSEOptions
|
|
6306
|
-
constructor(private readonly options: LiveIngestorChaintracksSSEOptions)
|
|
6307
|
-
async getHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6308
|
-
async startListening(liveHeaders: BlockHeader[]): Promise<void>
|
|
6309
|
-
stopListening(): void
|
|
6310
|
-
override async shutdown(): Promise<void>
|
|
6232
|
+
static createLiveIngestorChaintracksSSEOptions(chain: Chain, chaintracks: ChaintracksClientApi): LiveIngestorChaintracksSSEOptions
|
|
6233
|
+
constructor(private readonly options: LiveIngestorChaintracksSSEOptions)
|
|
6234
|
+
async getHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6235
|
+
async startListening(liveHeaders: BlockHeader[]): Promise<void>
|
|
6236
|
+
stopListening(): void
|
|
6237
|
+
override async shutdown(): Promise<void>
|
|
6311
6238
|
}
|
|
6312
6239
|
```
|
|
6313
6240
|
|
|
@@ -6322,18 +6249,18 @@ Reports new headers by polling periodically.
|
|
|
6322
6249
|
|
|
6323
6250
|
```ts
|
|
6324
6251
|
export class LiveIngestorWhatsOnChainPoll extends LiveIngestorBase {
|
|
6325
|
-
static createLiveIngestorWhatsOnChainOptions(chain: Chain): LiveIngestorWhatsOnChainOptions
|
|
6252
|
+
static createLiveIngestorWhatsOnChainOptions(chain: Chain): LiveIngestorWhatsOnChainOptions
|
|
6326
6253
|
idleWait: number;
|
|
6327
6254
|
retryWait: number;
|
|
6328
6255
|
retryWaitMax: number;
|
|
6329
6256
|
maxQueuedHeaders: number;
|
|
6330
6257
|
woc: WhatsOnChainServices;
|
|
6331
6258
|
done: boolean = false;
|
|
6332
|
-
constructor(options: LiveIngestorWhatsOnChainOptions)
|
|
6333
|
-
async getHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6334
|
-
async startListening(liveHeaders: BlockHeader[]): Promise<void>
|
|
6335
|
-
stopListening(): void
|
|
6336
|
-
override async shutdown(): Promise<void>
|
|
6259
|
+
constructor(options: LiveIngestorWhatsOnChainOptions)
|
|
6260
|
+
async getHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6261
|
+
async startListening(liveHeaders: BlockHeader[]): Promise<void>
|
|
6262
|
+
stopListening(): void
|
|
6263
|
+
override async shutdown(): Promise<void>
|
|
6337
6264
|
}
|
|
6338
6265
|
```
|
|
6339
6266
|
|
|
@@ -6346,7 +6273,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6346
6273
|
|
|
6347
6274
|
```ts
|
|
6348
6275
|
export class LiveIngestorWhatsOnChainWs extends LiveIngestorBase {
|
|
6349
|
-
static createLiveIngestorWhatsOnChainOptions(chain: Chain): LiveIngestorWhatsOnChainOptions
|
|
6276
|
+
static createLiveIngestorWhatsOnChainOptions(chain: Chain): LiveIngestorWhatsOnChainOptions
|
|
6350
6277
|
idleWait: number;
|
|
6351
6278
|
retryWait: number;
|
|
6352
6279
|
retryWaitMax: number;
|
|
@@ -6354,11 +6281,11 @@ export class LiveIngestorWhatsOnChainWs extends LiveIngestorBase {
|
|
|
6354
6281
|
woc: WhatsOnChainServices;
|
|
6355
6282
|
stopNewListenersToken: StopListenerToken = { stop: undefined };
|
|
6356
6283
|
done = false;
|
|
6357
|
-
constructor(options: LiveIngestorWhatsOnChainOptions)
|
|
6358
|
-
async getHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6359
|
-
async startListening(liveHeaders: BlockHeader[]): Promise<void>
|
|
6360
|
-
stopListening(): void
|
|
6361
|
-
override async shutdown(): Promise<void>
|
|
6284
|
+
constructor(options: LiveIngestorWhatsOnChainOptions)
|
|
6285
|
+
async getHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6286
|
+
async startListening(liveHeaders: BlockHeader[]): Promise<void>
|
|
6287
|
+
stopListening(): void
|
|
6288
|
+
override async shutdown(): Promise<void>
|
|
6362
6289
|
}
|
|
6363
6290
|
```
|
|
6364
6291
|
|
|
@@ -6378,43 +6305,21 @@ references before accepting a fallback result.
|
|
|
6378
6305
|
|
|
6379
6306
|
```ts
|
|
6380
6307
|
export class LocalChainTracker implements ChainTracker {
|
|
6381
|
-
constructor(options: LocalChainTrackerOptions)
|
|
6382
|
-
getMode(): LocalChainTrackerMode
|
|
6383
|
-
setMode(mode: LocalChainTrackerMode): void
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
async
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
async
|
|
6390
|
-
async
|
|
6391
|
-
async synchronize(): Promise<LocalChainTrackerStatus>
|
|
6392
|
-
async clearLocalData(): Promise<LocalChainTrackerStatus>
|
|
6393
|
-
async checkConsistency(): Promise<LocalChainTrackerStatus>
|
|
6308
|
+
constructor(options: LocalChainTrackerOptions)
|
|
6309
|
+
getMode(): LocalChainTrackerMode
|
|
6310
|
+
setMode(mode: LocalChainTrackerMode): void
|
|
6311
|
+
getStatus(): LocalChainTrackerStatus
|
|
6312
|
+
getLocalClient(): ChaintracksClientApi
|
|
6313
|
+
async currentHeight(): Promise<number>
|
|
6314
|
+
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
6315
|
+
async synchronize(): Promise<LocalChainTrackerStatus>
|
|
6316
|
+
async clearLocalData(): Promise<LocalChainTrackerStatus>
|
|
6317
|
+
async checkConsistency(): Promise<LocalChainTrackerStatus>
|
|
6394
6318
|
}
|
|
6395
6319
|
```
|
|
6396
6320
|
|
|
6397
6321
|
See also: [ChaintracksClientApi](./services.md#interface-chaintracksclientapi), [LocalChainTrackerMode](./services.md#type-localchaintrackermode), [LocalChainTrackerOptions](./services.md#interface-localchaintrackeroptions), [LocalChainTrackerStatus](./services.md#interface-localchaintrackerstatus)
|
|
6398
6322
|
|
|
6399
|
-
###### Method getVerificationContext
|
|
6400
|
-
|
|
6401
|
-
Local mode/source generation marker for consumers that invalidate derived verdicts.
|
|
6402
|
-
|
|
6403
|
-
```ts
|
|
6404
|
-
getVerificationContext(): string
|
|
6405
|
-
```
|
|
6406
|
-
|
|
6407
|
-
###### Method getVerificationContextToken
|
|
6408
|
-
|
|
6409
|
-
Fresh token for providers participating in this attempt's canonical authority.
|
|
6410
|
-
Remote-only uses fallbacks only; local-primary uses the local client only.
|
|
6411
|
-
A missing participating identity fails closed. Unused providers are omitted
|
|
6412
|
-
and cannot stand in. This is not an atomic multi-source snapshot.
|
|
6413
|
-
|
|
6414
|
-
```ts
|
|
6415
|
-
async getVerificationContextToken(signal?: AbortSignal): Promise<string>
|
|
6416
|
-
```
|
|
6417
|
-
|
|
6418
6323
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6419
6324
|
|
|
6420
6325
|
---
|
|
@@ -6428,10 +6333,10 @@ queue bounds prevent validation copies from consuming unbounded memory.
|
|
|
6428
6333
|
|
|
6429
6334
|
```ts
|
|
6430
6335
|
export class NodeBulkFileDataValidator implements BulkFileDataValidatorApi {
|
|
6431
|
-
constructor(options: NodeBulkFileDataValidatorOptions = {})
|
|
6432
|
-
async validate(request: BulkFileDataValidationRequest): Promise<BulkFileDataValidationResult>
|
|
6433
|
-
getStats(): BulkFileDataValidatorStats
|
|
6434
|
-
async destroy(): Promise<void>
|
|
6336
|
+
constructor(options: NodeBulkFileDataValidatorOptions = {})
|
|
6337
|
+
async validate(request: BulkFileDataValidationRequest): Promise<BulkFileDataValidationResult>
|
|
6338
|
+
getStats(): BulkFileDataValidatorStats
|
|
6339
|
+
async destroy(): Promise<void>
|
|
6435
6340
|
}
|
|
6436
6341
|
```
|
|
6437
6342
|
|
|
@@ -6451,20 +6356,22 @@ export default class SdkWhatsOnChain implements ChainTracker {
|
|
|
6451
6356
|
protected readonly URL: string;
|
|
6452
6357
|
protected readonly httpClient: HttpClient;
|
|
6453
6358
|
protected readonly requestTimeoutMsecs: number;
|
|
6454
|
-
constructor(network: "main" | "test" | "stn" | "ttn" | "tstn" = "main", config: LocalWhatsOnChainConfig = {})
|
|
6455
|
-
|
|
6456
|
-
async
|
|
6457
|
-
async
|
|
6458
|
-
|
|
6359
|
+
constructor(network: "main" | "test" | "stn" | "ttn" | "tstn" | "regtest" = "main", config: LocalWhatsOnChainConfig = {})
|
|
6360
|
+
get isAvailable(): boolean
|
|
6361
|
+
protected async request<T, Data = unknown>(url: string, options: HttpClientRequestOptions<Data>): Promise<HttpClientResponse<T>>
|
|
6362
|
+
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
6363
|
+
async currentHeight(): Promise<number>
|
|
6364
|
+
protected getHttpHeaders(): Record<string, string>
|
|
6459
6365
|
}
|
|
6460
6366
|
```
|
|
6461
6367
|
|
|
6462
6368
|
###### Constructor
|
|
6463
6369
|
|
|
6464
6370
|
Constructs an instance of the WhatsOnChain ChainTracker.
|
|
6371
|
+
`tstn` and `regtest` have no WhatsOnChain service, so every request made for them is refused.
|
|
6465
6372
|
|
|
6466
6373
|
```ts
|
|
6467
|
-
constructor(network: "main" | "test" | "stn" | "ttn" | "tstn" = "main", config: LocalWhatsOnChainConfig = {})
|
|
6374
|
+
constructor(network: "main" | "test" | "stn" | "ttn" | "tstn" | "regtest" = "main", config: LocalWhatsOnChainConfig = {})
|
|
6468
6375
|
```
|
|
6469
6376
|
|
|
6470
6377
|
Argument Details
|
|
@@ -6491,30 +6398,30 @@ export class ServiceCollection<T> {
|
|
|
6491
6398
|
constructor(public serviceName: string, services?: Array<{
|
|
6492
6399
|
name: string;
|
|
6493
6400
|
service: T;
|
|
6494
|
-
}>)
|
|
6401
|
+
}>)
|
|
6495
6402
|
add(s: {
|
|
6496
6403
|
name: string;
|
|
6497
6404
|
service: T;
|
|
6498
|
-
}): this
|
|
6499
|
-
remove(name: string): void
|
|
6500
|
-
get name(): string
|
|
6501
|
-
get service(): T
|
|
6502
|
-
getServiceToCall(i: number): ServiceToCall<T>
|
|
6503
|
-
get serviceToCall(): ServiceToCall<T>
|
|
6504
|
-
get allServicesToCall(): Array<ServiceToCall<T>>
|
|
6505
|
-
moveServiceToLast(stc: ServiceToCall<T>): void
|
|
6506
|
-
get allServices(): T[]
|
|
6507
|
-
get count(): number
|
|
6508
|
-
get index(): number
|
|
6509
|
-
reset(): void
|
|
6510
|
-
next(): number
|
|
6511
|
-
clone(): ServiceCollection<T>
|
|
6512
|
-
_addServiceCall(providerName: string, call: ServiceCall): ProviderCallHistory
|
|
6513
|
-
getDuration(since: Date | string): number
|
|
6514
|
-
addServiceCallSuccess(stc: ServiceToCall<T>, result?: string): void
|
|
6515
|
-
addServiceCallFailure(stc: ServiceToCall<T>, result?: string): void
|
|
6516
|
-
addServiceCallError(stc: ServiceToCall<T>, error: WalletError): void
|
|
6517
|
-
getServiceCallHistory(reset?: boolean): ServiceCallHistory
|
|
6405
|
+
}): this
|
|
6406
|
+
remove(name: string): void
|
|
6407
|
+
get name(): string
|
|
6408
|
+
get service(): T
|
|
6409
|
+
getServiceToCall(i: number): ServiceToCall<T>
|
|
6410
|
+
get serviceToCall(): ServiceToCall<T>
|
|
6411
|
+
get allServicesToCall(): Array<ServiceToCall<T>>
|
|
6412
|
+
moveServiceToLast(stc: ServiceToCall<T>): void
|
|
6413
|
+
get allServices(): T[]
|
|
6414
|
+
get count(): number
|
|
6415
|
+
get index(): number
|
|
6416
|
+
reset(): void
|
|
6417
|
+
next(): number
|
|
6418
|
+
clone(): ServiceCollection<T>
|
|
6419
|
+
_addServiceCall(providerName: string, call: ServiceCall): ProviderCallHistory
|
|
6420
|
+
getDuration(since: Date | string): number
|
|
6421
|
+
addServiceCallSuccess(stc: ServiceToCall<T>, result?: string): void
|
|
6422
|
+
addServiceCallFailure(stc: ServiceToCall<T>, result?: string): void
|
|
6423
|
+
addServiceCallError(stc: ServiceToCall<T>, error: WalletError): void
|
|
6424
|
+
getServiceCallHistory(reset?: boolean): ServiceCallHistory
|
|
6518
6425
|
}
|
|
6519
6426
|
```
|
|
6520
6427
|
|
|
@@ -6531,7 +6438,7 @@ readonly since: Date
|
|
|
6531
6438
|
###### Method getServiceCallHistory
|
|
6532
6439
|
|
|
6533
6440
|
```ts
|
|
6534
|
-
getServiceCallHistory(reset?: boolean): ServiceCallHistory
|
|
6441
|
+
getServiceCallHistory(reset?: boolean): ServiceCallHistory
|
|
6535
6442
|
```
|
|
6536
6443
|
See also: [ServiceCallHistory](./client.md#interface-servicecallhistory)
|
|
6537
6444
|
|
|
@@ -6544,7 +6451,7 @@ A copy of current service call history
|
|
|
6544
6451
|
Used to de-prioritize a service call by moving it to the end of the list.
|
|
6545
6452
|
|
|
6546
6453
|
```ts
|
|
6547
|
-
moveServiceToLast(stc: ServiceToCall<T>): void
|
|
6454
|
+
moveServiceToLast(stc: ServiceToCall<T>): void
|
|
6548
6455
|
```
|
|
6549
6456
|
See also: [ServiceToCall](./services.md#interface-servicetocall)
|
|
6550
6457
|
|
|
@@ -6556,7 +6463,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6556
6463
|
```ts
|
|
6557
6464
|
export class Services implements WalletServices {
|
|
6558
6465
|
static readonly getStatusForTxidsBatchLimit = 20;
|
|
6559
|
-
static createDefaultOptions(chain: Chain): WalletServicesOptions
|
|
6466
|
+
static createDefaultOptions(chain: Chain): WalletServicesOptions
|
|
6560
6467
|
options: WalletServicesOptions;
|
|
6561
6468
|
whatsonchain: WhatsOnChain;
|
|
6562
6469
|
arcTaal: ARC;
|
|
@@ -6572,36 +6479,36 @@ export class Services implements WalletServices {
|
|
|
6572
6479
|
updateFiatExchangeRateServices!: ServiceCollection<UpdateFiatExchangeRateService>;
|
|
6573
6480
|
chain: Chain;
|
|
6574
6481
|
readonly telemetry: Telemetry;
|
|
6575
|
-
constructor(optionsOrChain: Chain | WalletServicesOptions)
|
|
6576
|
-
getServicesCallHistory(reset?: boolean): ServicesCallHistory
|
|
6577
|
-
async getChainTracker(): Promise<ChainTracker>
|
|
6578
|
-
async getBsvExchangeRate(): Promise<number>
|
|
6579
|
-
async getFiatExchangeRate(currency: FiatCurrencyCode, base?: FiatCurrencyCode): Promise<number>
|
|
6580
|
-
async getFiatExchangeRates(targetCurrencies: FiatCurrencyCode[]): Promise<FiatExchangeRates>
|
|
6581
|
-
get getProofsCount(): number
|
|
6582
|
-
get getRawTxsCount(): number
|
|
6583
|
-
get postBeefServicesCount(): number
|
|
6584
|
-
get getUtxoStatsCount(): number
|
|
6585
|
-
async getStatusForTxids(txids: string[], useNext?: boolean): Promise<GetStatusForTxidsResult>
|
|
6586
|
-
hashOutputScript(script: string): string
|
|
6587
|
-
async isUtxo(output: TableOutput): Promise<boolean>
|
|
6588
|
-
async getUtxoStatus(output: string, outputFormat?: GetUtxoStatusOutputFormat, outpoint?: string, useNext?: boolean, logger?: WalletLoggerInterface): Promise<GetUtxoStatusResult>
|
|
6589
|
-
async getScriptHashHistory(hash: string, useNext?: boolean, logger?: WalletLoggerInterface): Promise<GetScriptHashHistoryResult>
|
|
6482
|
+
constructor(optionsOrChain: Chain | WalletServicesOptions)
|
|
6483
|
+
getServicesCallHistory(reset?: boolean): ServicesCallHistory
|
|
6484
|
+
async getChainTracker(): Promise<ChainTracker>
|
|
6485
|
+
async getBsvExchangeRate(): Promise<number>
|
|
6486
|
+
async getFiatExchangeRate(currency: FiatCurrencyCode, base?: FiatCurrencyCode): Promise<number>
|
|
6487
|
+
async getFiatExchangeRates(targetCurrencies: FiatCurrencyCode[]): Promise<FiatExchangeRates>
|
|
6488
|
+
get getProofsCount(): number
|
|
6489
|
+
get getRawTxsCount(): number
|
|
6490
|
+
get postBeefServicesCount(): number
|
|
6491
|
+
get getUtxoStatsCount(): number
|
|
6492
|
+
async getStatusForTxids(txids: string[], useNext?: boolean): Promise<GetStatusForTxidsResult>
|
|
6493
|
+
hashOutputScript(script: string): string
|
|
6494
|
+
async isUtxo(output: TableOutput): Promise<boolean>
|
|
6495
|
+
async getUtxoStatus(output: string, outputFormat?: GetUtxoStatusOutputFormat, outpoint?: string, useNext?: boolean, logger?: WalletLoggerInterface): Promise<GetUtxoStatusResult>
|
|
6496
|
+
async getScriptHashHistory(hash: string, useNext?: boolean, logger?: WalletLoggerInterface): Promise<GetScriptHashHistoryResult>
|
|
6590
6497
|
postBeefMode: "PromiseAll" | "UntilSuccess" = "UntilSuccess";
|
|
6591
6498
|
postBeefUntilSuccessSoftTimeoutMs = 5000;
|
|
6592
6499
|
postBeefUntilSuccessSoftTimeoutPerKbMs = 50;
|
|
6593
6500
|
postBeefUntilSuccessSoftTimeoutMaxMs = 30000;
|
|
6594
|
-
async postBeef(beef: Beef, txids: string[], logger?: WalletLoggerInterface): Promise<PostBeefResult[]>
|
|
6595
|
-
async getRawTx(txid: string, useNext?: boolean): Promise<GetRawTxResult>
|
|
6596
|
-
async invokeChaintracksWithRetry<R>(method: () => Promise<R>, operation: string = "unknown"): Promise<R>
|
|
6597
|
-
async getHeaderForHeight(height: number): Promise<number[]>
|
|
6598
|
-
async getHeight(): Promise<number>
|
|
6599
|
-
async hashToHeader(hash: string): Promise<BlockHeader>
|
|
6600
|
-
async getMerklePath(txid: string, useNext?: boolean, logger?: WalletLoggerInterface): Promise<GetMerklePathResult>
|
|
6601
|
-
async getValidatedMerklePath(txid: string, validate: (result: GetMerklePathResult) => Promise<void>): Promise<GetMerklePathResult>
|
|
6602
|
-
async updateFiatExchangeRates(targetCurrencies: FiatCurrencyCode[], updateMsecs?: number): Promise<FiatExchangeRates>
|
|
6603
|
-
async nLockTimeIsFinal(tx: string | number[] | BsvTransaction | number): Promise<boolean>
|
|
6604
|
-
async getBeefForTxid(txid: string): Promise<Beef>
|
|
6501
|
+
async postBeef(beef: Beef, txids: string[], logger?: WalletLoggerInterface): Promise<PostBeefResult[]>
|
|
6502
|
+
async getRawTx(txid: string, useNext?: boolean): Promise<GetRawTxResult>
|
|
6503
|
+
async invokeChaintracksWithRetry<R>(method: () => Promise<R>, operation: string = "unknown"): Promise<R>
|
|
6504
|
+
async getHeaderForHeight(height: number): Promise<number[]>
|
|
6505
|
+
async getHeight(): Promise<number>
|
|
6506
|
+
async hashToHeader(hash: string): Promise<BlockHeader>
|
|
6507
|
+
async getMerklePath(txid: string, useNext?: boolean, logger?: WalletLoggerInterface): Promise<GetMerklePathResult>
|
|
6508
|
+
async getValidatedMerklePath(txid: string, validate: (result: GetMerklePathResult) => Promise<void>): Promise<GetMerklePathResult>
|
|
6509
|
+
async updateFiatExchangeRates(targetCurrencies: FiatCurrencyCode[], updateMsecs?: number): Promise<FiatExchangeRates>
|
|
6510
|
+
async nLockTimeIsFinal(tx: string | number[] | BsvTransaction | number): Promise<boolean>
|
|
6511
|
+
async getBeefForTxid(txid: string): Promise<Beef>
|
|
6605
6512
|
}
|
|
6606
6513
|
```
|
|
6607
6514
|
|
|
@@ -6645,7 +6552,7 @@ postBeefUntilSuccessSoftTimeoutPerKbMs = 50
|
|
|
6645
6552
|
###### Method hashOutputScript
|
|
6646
6553
|
|
|
6647
6554
|
```ts
|
|
6648
|
-
hashOutputScript(script: string): string
|
|
6555
|
+
hashOutputScript(script: string): string
|
|
6649
6556
|
```
|
|
6650
6557
|
|
|
6651
6558
|
Returns
|
|
@@ -6667,9 +6574,9 @@ Allows multiple readers or one writer at a time.
|
|
|
6667
6574
|
|
|
6668
6575
|
```ts
|
|
6669
6576
|
export class SingleWriterMultiReaderLock {
|
|
6670
|
-
constructor(private readonly maxQueued = 4096)
|
|
6671
|
-
async withReadLock<T>(fn: () => Promise<T>): Promise<T>
|
|
6672
|
-
async withWriteLock<T>(fn: () => Promise<T>): Promise<T>
|
|
6577
|
+
constructor(private readonly maxQueued = 4096)
|
|
6578
|
+
async withReadLock<T>(fn: () => Promise<T>): Promise<T>
|
|
6579
|
+
async withWriteLock<T>(fn: () => Promise<T>): Promise<T>
|
|
6673
6580
|
}
|
|
6674
6581
|
```
|
|
6675
6582
|
|
|
@@ -6681,8 +6588,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6681
6588
|
```ts
|
|
6682
6589
|
export class WhatsOnChain extends WhatsOnChainNoServices {
|
|
6683
6590
|
services: Services;
|
|
6684
|
-
constructor(chain: Chain = "main", config: WalletToolboxWhatsOnChainConfig = {}, services?: Services)
|
|
6685
|
-
async getMerklePath(txid: string, services: WalletServices): Promise<GetMerklePathResult>
|
|
6591
|
+
constructor(chain: Chain = "main", config: WalletToolboxWhatsOnChainConfig = {}, services?: Services)
|
|
6592
|
+
async getMerklePath(txid: string, services: WalletServices): Promise<GetMerklePathResult>
|
|
6686
6593
|
}
|
|
6687
6594
|
```
|
|
6688
6595
|
|
|
@@ -6695,20 +6602,20 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6695
6602
|
|
|
6696
6603
|
```ts
|
|
6697
6604
|
export class WhatsOnChainNoServices extends SdkWhatsOnChain {
|
|
6698
|
-
constructor(chain: Chain = "main", config: WalletToolboxWhatsOnChainConfig = {})
|
|
6699
|
-
async getStatusForTxids(txids: string[]): Promise<GetStatusForTxidsResult>
|
|
6700
|
-
async getTxPropagation(txid: string): Promise<number>
|
|
6701
|
-
async getRawTx(txid: string): Promise<string | undefined>
|
|
6702
|
-
async getRawTxResult(txid: string): Promise<GetRawTxResult>
|
|
6703
|
-
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
6704
|
-
async postRawTx(rawTx: HexString): Promise<PostTxResultForTxid>
|
|
6705
|
-
async updateBsvExchangeRate(rate?: BsvExchangeRate, updateMsecs?: number): Promise<BsvExchangeRate>
|
|
6706
|
-
async getUtxoStatus(output: string, outputFormat?: GetUtxoStatusOutputFormat, outpoint?: string): Promise<GetUtxoStatusResult>
|
|
6707
|
-
async getScriptHashConfirmedHistory(hash: string): Promise<GetScriptHashHistoryResult>
|
|
6708
|
-
async getScriptHashUnconfirmedHistory(hash: string): Promise<GetScriptHashHistoryResult>
|
|
6709
|
-
async getScriptHashHistory(hash: string): Promise<GetScriptHashHistoryResult>
|
|
6710
|
-
async getBlockHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6711
|
-
async getChainInfo(): Promise<WocChainInfo>
|
|
6605
|
+
constructor(chain: Chain = "main", config: WalletToolboxWhatsOnChainConfig = {})
|
|
6606
|
+
async getStatusForTxids(txids: string[]): Promise<GetStatusForTxidsResult>
|
|
6607
|
+
async getTxPropagation(txid: string): Promise<number>
|
|
6608
|
+
async getRawTx(txid: string): Promise<string | undefined>
|
|
6609
|
+
async getRawTxResult(txid: string): Promise<GetRawTxResult>
|
|
6610
|
+
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
6611
|
+
async postRawTx(rawTx: HexString): Promise<PostTxResultForTxid>
|
|
6612
|
+
async updateBsvExchangeRate(rate?: BsvExchangeRate, updateMsecs?: number): Promise<BsvExchangeRate>
|
|
6613
|
+
async getUtxoStatus(output: string, outputFormat?: GetUtxoStatusOutputFormat, outpoint?: string): Promise<GetUtxoStatusResult>
|
|
6614
|
+
async getScriptHashConfirmedHistory(hash: string): Promise<GetScriptHashHistoryResult>
|
|
6615
|
+
async getScriptHashUnconfirmedHistory(hash: string): Promise<GetScriptHashHistoryResult>
|
|
6616
|
+
async getScriptHashHistory(hash: string): Promise<GetScriptHashHistoryResult>
|
|
6617
|
+
async getBlockHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6618
|
+
async getChainInfo(): Promise<WocChainInfo>
|
|
6712
6619
|
}
|
|
6713
6620
|
```
|
|
6714
6621
|
|
|
@@ -6737,7 +6644,7 @@ See also: [BlockHeader](./client.md#interface-blockheader), [BsvExchangeRate](./
|
|
|
6737
6644
|
}
|
|
6738
6645
|
|
|
6739
6646
|
```ts
|
|
6740
|
-
async getBlockHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6647
|
+
async getBlockHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6741
6648
|
```
|
|
6742
6649
|
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
6743
6650
|
|
|
@@ -6746,7 +6653,7 @@ See also: [BlockHeader](./client.md#interface-blockheader)
|
|
|
6746
6653
|
May return undefined for unmined transactions that are in the mempool.
|
|
6747
6654
|
|
|
6748
6655
|
```ts
|
|
6749
|
-
async getRawTx(txid: string): Promise<string | undefined>
|
|
6656
|
+
async getRawTx(txid: string): Promise<string | undefined>
|
|
6750
6657
|
```
|
|
6751
6658
|
|
|
6752
6659
|
Returns
|
|
@@ -6776,7 +6683,7 @@ result for an unknown txid:
|
|
|
6776
6683
|
[{"txid":"6815f8014db74eab8b7f75925c68929597f1d97efa970109d990824c25e5e62c","error":"unknown"}]
|
|
6777
6684
|
|
|
6778
6685
|
```ts
|
|
6779
|
-
async getStatusForTxids(txids: string[]): Promise<GetStatusForTxidsResult>
|
|
6686
|
+
async getStatusForTxids(txids: string[]): Promise<GetStatusForTxidsResult>
|
|
6780
6687
|
```
|
|
6781
6688
|
See also: [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresult)
|
|
6782
6689
|
|
|
@@ -6785,7 +6692,7 @@ See also: [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresul
|
|
|
6785
6692
|
2025-02-16 throwing internal server error 500.
|
|
6786
6693
|
|
|
6787
6694
|
```ts
|
|
6788
|
-
async getTxPropagation(txid: string): Promise<number>
|
|
6695
|
+
async getTxPropagation(txid: string): Promise<number>
|
|
6789
6696
|
```
|
|
6790
6697
|
|
|
6791
6698
|
###### Method postBeef
|
|
@@ -6795,14 +6702,14 @@ WhatsOnChain does not natively support a postBeef end-point aware of multiple tx
|
|
|
6795
6702
|
Send rawTx in `txids` order from beef.
|
|
6796
6703
|
|
|
6797
6704
|
```ts
|
|
6798
|
-
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
6705
|
+
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
6799
6706
|
```
|
|
6800
6707
|
See also: [PostBeefResult](./client.md#interface-postbeefresult)
|
|
6801
6708
|
|
|
6802
6709
|
###### Method postRawTx
|
|
6803
6710
|
|
|
6804
6711
|
```ts
|
|
6805
|
-
async postRawTx(rawTx: HexString): Promise<PostTxResultForTxid>
|
|
6712
|
+
async postRawTx(rawTx: HexString): Promise<PostTxResultForTxid>
|
|
6806
6713
|
```
|
|
6807
6714
|
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
6808
6715
|
|
|
@@ -6822,7 +6729,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6822
6729
|
|
|
6823
6730
|
```ts
|
|
6824
6731
|
export class WhatsOnChainServices {
|
|
6825
|
-
static createWhatsOnChainServicesOptions(chain: Chain): WhatsOnChainServicesOptions
|
|
6732
|
+
static createWhatsOnChainServicesOptions(chain: Chain): WhatsOnChainServicesOptions
|
|
6826
6733
|
static readonly chainInfo: Array<WocChainInfo | undefined> = [];
|
|
6827
6734
|
static readonly chainInfoTime: Array<Date | undefined> = [];
|
|
6828
6735
|
static readonly chainInfoMsecs: number[] = [];
|
|
@@ -6830,13 +6737,13 @@ export class WhatsOnChainServices {
|
|
|
6830
6737
|
chain: Chain;
|
|
6831
6738
|
woc: WhatsOnChain;
|
|
6832
6739
|
public readonly options: WhatsOnChainServicesOptions;
|
|
6833
|
-
constructor(options: WhatsOnChainServicesOptions)
|
|
6834
|
-
async getHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6835
|
-
async getChainInfo(): Promise<WocChainInfo>
|
|
6836
|
-
async getChainTipHeight(): Promise<number>
|
|
6837
|
-
async getChainTipHash(): Promise<string>
|
|
6838
|
-
async getHeaders(fetch?: ChaintracksFetchApi): Promise<WocGetHeadersHeader[]>
|
|
6839
|
-
async getHeaderByteFileLinks(neededRange: HeightRange, fetch?: ChaintracksFetchApi): Promise<GetHeaderByteFileLinksResult[]>
|
|
6740
|
+
constructor(options: WhatsOnChainServicesOptions)
|
|
6741
|
+
async getHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6742
|
+
async getChainInfo(): Promise<WocChainInfo>
|
|
6743
|
+
async getChainTipHeight(): Promise<number>
|
|
6744
|
+
async getChainTipHash(): Promise<string>
|
|
6745
|
+
async getHeaders(fetch?: ChaintracksFetchApi): Promise<WocGetHeadersHeader[]>
|
|
6746
|
+
async getHeaderByteFileLinks(neededRange: HeightRange, fetch?: ChaintracksFetchApi): Promise<GetHeaderByteFileLinksResult[]>
|
|
6840
6747
|
}
|
|
6841
6748
|
```
|
|
6842
6749
|
|
|
@@ -6845,7 +6752,7 @@ See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#
|
|
|
6845
6752
|
###### Method getHeaders
|
|
6846
6753
|
|
|
6847
6754
|
```ts
|
|
6848
|
-
async getHeaders(fetch?: ChaintracksFetchApi): Promise<WocGetHeadersHeader[]>
|
|
6755
|
+
async getHeaders(fetch?: ChaintracksFetchApi): Promise<WocGetHeadersHeader[]>
|
|
6849
6756
|
```
|
|
6850
6757
|
See also: [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi), [WocGetHeadersHeader](./services.md#interface-wocgetheadersheader)
|
|
6851
6758
|
|
|
@@ -6860,51 +6767,51 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6860
6767
|
|
|
6861
6768
|
| | | |
|
|
6862
6769
|
| --- | --- | --- |
|
|
6863
|
-
| [WocHeadersBulkListener](#function-wocheadersbulklistener) | [
|
|
6864
|
-
| [WocHeadersBulkListener_test](#function-wocheadersbulklistener_test) | [
|
|
6865
|
-
| [WocHeadersLiveListener](#function-wocheaderslivelistener) | [
|
|
6866
|
-
| [WocHeadersLiveListener_test](#function-wocheaderslivelistener_test) | [
|
|
6867
|
-
| [addWork](#function-addwork) | [
|
|
6868
|
-
| [arcDefaultUrl](#function-arcdefaulturl) | [
|
|
6869
|
-
| [arcGorillaPoolUrl](#function-arcgorillapoolurl) | [
|
|
6870
|
-
| [arcadeDefaultUrl](#function-arcadedefaulturl) | [
|
|
6871
|
-
| [authenticateMerklePathResult](#function-authenticatemerklepathresult) | [
|
|
6872
|
-
| [blockHash](#function-blockhash) | [
|
|
6873
|
-
| [buildChaintracksOptionsWithIngestors](#function-buildchaintracksoptionswithingestors) | [
|
|
6874
|
-
| [classifyArcadeRejection](#function-classifyarcaderejection) | [
|
|
6875
|
-
| [classifyMerklePathResponse](#function-classifymerklepathresponse) | [
|
|
6876
|
-
| [classifyOutputUtxo](#function-classifyoutpututxo) | [
|
|
6877
|
-
| [containsControlCharacter](#function-containscontrolcharacter) | [
|
|
6878
|
-
| [convertBitsToTarget](#function-convertbitstotarget) | [
|
|
6879
|
-
| [convertBitsToWork](#function-convertbitstowork) | [
|
|
6880
|
-
| [convertBufferToUint32](#function-convertbuffertouint32) | [
|
|
6881
|
-
| [convertUint32ToBuffer](#function-convertuint32tobuffer) | [
|
|
6882
|
-
| [convertWocToBlockHeaderHex](#function-convertwoctoblockheaderhex) | [
|
|
6883
|
-
| [
|
|
6884
|
-
| [
|
|
6885
|
-
| [
|
|
6886
|
-
| [
|
|
6887
|
-
| [
|
|
6888
|
-
| [
|
|
6889
|
-
| [
|
|
6890
|
-
| [
|
|
6891
|
-
| [
|
|
6892
|
-
| [
|
|
6893
|
-
| [
|
|
6894
|
-
| [
|
|
6895
|
-
| [
|
|
6896
|
-
| [
|
|
6897
|
-
| [
|
|
6898
|
-
| [
|
|
6899
|
-
| [
|
|
6900
|
-
| [
|
|
6901
|
-
| [
|
|
6902
|
-
| [
|
|
6903
|
-
| [
|
|
6904
|
-
| [
|
|
6905
|
-
| [
|
|
6906
|
-
| [
|
|
6907
|
-
| [
|
|
6770
|
+
| [WocHeadersBulkListener](#function-wocheadersbulklistener) | [handlePostRawTxErrorResponse](#function-handlepostrawtxerrorresponse) | [selectBulkHeaderFiles](#function-selectbulkheaderfiles) |
|
|
6771
|
+
| [WocHeadersBulkListener_test](#function-wocheadersbulklistener_test) | [handleScriptHashHistoryCatch](#function-handlescripthashhistorycatch) | [serializeBaseBlockHeader](#function-serializebaseblockheader) |
|
|
6772
|
+
| [WocHeadersLiveListener](#function-wocheaderslivelistener) | [handleScriptHashHistoryResponse](#function-handlescripthashhistoryresponse) | [serializeBaseBlockHeaders](#function-serializebaseblockheaders) |
|
|
6773
|
+
| [WocHeadersLiveListener_test](#function-wocheaderslivelistener_test) | [handleUtxoConnReset](#function-handleutxoconnreset) | [sha256HashOfBinaryFile](#function-sha256hashofbinaryfile) |
|
|
6774
|
+
| [addWork](#function-addwork) | [isArcAcceptedTxStatus](#function-isarcacceptedtxstatus) | [snapshotMerklePathResult](#function-snapshotmerklepathresult) |
|
|
6775
|
+
| [arcDefaultUrl](#function-arcdefaulturl) | [isArcDoubleSpendTxStatus](#function-isarcdoublespendtxstatus) | [snapshotPostBeefRequest](#function-snapshotpostbeefrequest) |
|
|
6776
|
+
| [arcGorillaPoolUrl](#function-arcgorillapoolurl) | [isArcInvalidTxStatus](#function-isarcinvalidtxstatus) | [startChaintracks](#function-startchaintracks) |
|
|
6777
|
+
| [arcadeDefaultUrl](#function-arcadedefaulturl) | [isArcServiceErrorStatus](#function-isarcserviceerrorstatus) | [stnArcadeUrl](#function-stnarcadeurl) |
|
|
6778
|
+
| [authenticateMerklePathResult](#function-authenticatemerklepathresult) | [isBaseBlockHeader](#function-isbaseblockheader) | [stnChaintracksUrl](#function-stnchaintracksurl) |
|
|
6779
|
+
| [blockHash](#function-blockhash) | [isBlockHeader](#function-isblockheader) | [subWork](#function-subwork) |
|
|
6780
|
+
| [buildChaintracksOptionsWithIngestors](#function-buildchaintracksoptionswithingestors) | [isKnownValidBulkHeaderFile](#function-isknownvalidbulkheaderfile) | [swapByteOrder](#function-swapbyteorder) |
|
|
6781
|
+
| [classifyArcadeRejection](#function-classifyarcaderejection) | [isLive](#function-islive) | [toBinaryBaseBlockHeader](#function-tobinarybaseblockheader) |
|
|
6782
|
+
| [classifyMerklePathResponse](#function-classifymerklepathresponse) | [isLiveBlockHeader](#function-isliveblockheader) | [toDefaultChaintracksArguments](#function-todefaultchaintracksarguments) |
|
|
6783
|
+
| [classifyOutputUtxo](#function-classifyoutpututxo) | [isMoreWork](#function-ismorework) | [toDefaultKnexChaintracksArguments](#function-todefaultknexchaintracksarguments) |
|
|
6784
|
+
| [containsControlCharacter](#function-containscontrolcharacter) | [isValidFiatRate](#function-isvalidfiatrate) | [tstnArcadeUrl](#function-tstnarcadeurl) |
|
|
6785
|
+
| [convertBitsToTarget](#function-convertbitstotarget) | [makeMerklePathNote](#function-makemerklepathnote) | [tstnChaintracksUrl](#function-tstnchaintracksurl) |
|
|
6786
|
+
| [convertBitsToWork](#function-convertbitstowork) | [makePostBeefServiceError](#function-makepostbeefserviceerror) | [updateChaintracksFiatExchangeRates](#function-updatechaintracksfiatexchangerates) |
|
|
6787
|
+
| [convertBufferToUint32](#function-convertbuffertouint32) | [mapWithConcurrency](#function-mapwithconcurrency) | [updateExchangeratesapi](#function-updateexchangeratesapi) |
|
|
6788
|
+
| [convertUint32ToBuffer](#function-convertuint32tobuffer) | [normalizeArcProviderConfig](#function-normalizearcproviderconfig) | [validBulkHeaderFilesByFileHash](#function-validbulkheaderfilesbyfilehash) |
|
|
6789
|
+
| [convertWocToBlockHeaderHex](#function-convertwoctoblockheaderhex) | [normalizeBulkFileDataValidationRequest](#function-normalizebulkfiledatavalidationrequest) | [validateAgainstDirtyHashes](#function-validateagainstdirtyhashes) |
|
|
6790
|
+
| [copyRawTransactionBytes](#function-copyrawtransactionbytes) | [normalizeBulkHeaderFileInfo](#function-normalizebulkheaderfileinfo) | [validateArcadeTxData](#function-validatearcadetxdata) |
|
|
6791
|
+
| [copyValidatedBlockHeader](#function-copyvalidatedblockheader) | [normalizeBulkHeaderFileSequence](#function-normalizebulkheaderfilesequence) | [validateBaseBlockHeaderFormat](#function-validatebaseblockheaderformat) |
|
|
6792
|
+
| [createAndStartDefaultChaintracks](#function-createandstartdefaultchaintracks) | [normalizeBulkHeaderFilesInfo](#function-normalizebulkheaderfilesinfo) | [validateBufferOfHeaders](#function-validatebufferofheaders) |
|
|
6793
|
+
| [createAndStartDefaultKnexChaintracks](#function-createandstartdefaultknexchaintracks) | [normalizeFiatCurrencies](#function-normalizefiatcurrencies) | [validateBulkFileData](#function-validatebulkfiledata) |
|
|
6794
|
+
| [createChaintracksInitialSchema](#function-createchaintracksinitialschema) | [normalizeFiatCurrency](#function-normalizefiatcurrency) | [validateGenesisHeader](#function-validategenesisheader) |
|
|
6795
|
+
| [createDefaultBulkFileDataManager](#function-createdefaultbulkfiledatamanager) | [normalizeFiatExchangeRates](#function-normalizefiatexchangerates) | [validateHeaderDifficulty](#function-validateheaderdifficulty) |
|
|
6796
|
+
| [createDefaultChaintracksClient](#function-createdefaultchaintracksclient) | [normalizeFiatRate](#function-normalizefiatrate) | [validateHeaderFormat](#function-validateheaderformat) |
|
|
6797
|
+
| [createDefaultChaintracksStorageOptions](#function-createdefaultchaintracksstorageoptions) | [normalizeFiatRateTimestamps](#function-normalizefiatratetimestamps) | [validateHeaderProofOfWork](#function-validateheaderproofofwork) |
|
|
6798
|
+
| [createDefaultIdbChaintracksOptions](#function-createdefaultidbchaintracksoptions) | [normalizeFiatTimestamp](#function-normalizefiattimestamp) | [validateMerklePathResult](#function-validatemerklepathresult) |
|
|
6799
|
+
| [createDefaultKnexChaintracksOptions](#function-createdefaultknexchaintracksoptions) | [normalizePostRawHex](#function-normalizepostrawhex) | [validatePostBeefResult](#function-validatepostbeefresult) |
|
|
6800
|
+
| [createDefaultNoDbChaintracksOptions](#function-createdefaultnodbchaintracksoptions) | [normalizePostTxids](#function-normalizeposttxids) | [validatePostBeefResultOrServiceError](#function-validatepostbeefresultorserviceerror) |
|
|
6801
|
+
| [createDefaultWalletServicesOptions](#function-createdefaultwalletservicesoptions) | [normalizeTxid](#function-normalizetxid) | [validatePostTxResult](#function-validateposttxresult) |
|
|
6802
|
+
| [createIdbChaintracks](#function-createidbchaintracks) | [normalizeWalletOutpoint](#function-normalizewalletoutpoint) | [validatePostTxResultOrServiceError](#function-validateposttxresultorserviceerror) |
|
|
6803
|
+
| [createKnexChaintracks](#function-createknexchaintracks) | [parseFileLink](#function-parsefilelink) | [validateRawTxResult](#function-validaterawtxresult) |
|
|
6804
|
+
| [createNoDbChaintracks](#function-createnodbchaintracks) | [populateUtxoDetails](#function-populateutxodetails) | [validateScriptHash](#function-validatescripthash) |
|
|
6805
|
+
| [createStopHandler](#function-createstophandler) | [proofOfWorkLimitBits](#function-proofofworklimitbits) | [validateScriptHashHistoryResult](#function-validatescripthashhistoryresult) |
|
|
6806
|
+
| [deserializeBaseBlockHeader](#function-deserializebaseblockheader) | [publicArcadeUrl](#function-publicarcadeurl) | [validateStatusForTxidsResult](#function-validatestatusfortxidsresult) |
|
|
6807
|
+
| [deserializeBaseBlockHeaders](#function-deserializebaseblockheaders) | [readUInt32BE](#function-readuint32be) | [validateUtxoStatusResult](#function-validateutxostatusresult) |
|
|
6808
|
+
| [deserializeBlockHeader](#function-deserializeblockheader) | [readUInt32LE](#function-readuint32le) | [validateWocChainInfo](#function-validatewocchaininfo) |
|
|
6809
|
+
| [deserializeBlockHeaders](#function-deserializeblockheaders) | [regtestArcadeUrl](#function-regtestarcadeurl) | [wocGetHeadersHeaderToBlockHeader](#function-wocgetheadersheadertoblockheader) |
|
|
6810
|
+
| [genesisBuffer](#function-genesisbuffer) | [regtestChaintracksUrl](#function-regtestchaintracksurl) | [workBNtoBuffer](#function-workbntobuffer) |
|
|
6811
|
+
| [genesisHeader](#function-genesisheader) | [requireConclusiveUtxo](#function-requireconclusiveutxo) | [writeUInt32BE](#function-writeuint32be) |
|
|
6812
|
+
| [getBeefForTxid](#function-getbeeffortxid) | [resolveDefaultChaintracksArguments](#function-resolvedefaultchaintracksarguments) | [writeUInt32LE](#function-writeuint32le) |
|
|
6813
|
+
| [getExchangeRatesIo](#function-getexchangeratesio) | [resolveDefaultKnexChaintracksArguments](#function-resolvedefaultknexchaintracksarguments) | |
|
|
6814
|
+
| [getWhatsOnChainBlockHeaderByHash](#function-getwhatsonchainblockheaderbyhash) | [safeDiagnostic](#function-safediagnostic) | |
|
|
6908
6815
|
|
|
6909
6816
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6910
6817
|
|
|
@@ -6924,7 +6831,7 @@ export async function WocHeadersBulkListener(...[fromHeight, toHeight, enqueue,
|
|
|
6924
6831
|
chain: Chain,
|
|
6925
6832
|
logger?: (...args: any[]) => void,
|
|
6926
6833
|
idleWait?: number
|
|
6927
|
-
]): Promise<boolean>
|
|
6834
|
+
]): Promise<boolean>
|
|
6928
6835
|
```
|
|
6929
6836
|
|
|
6930
6837
|
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [StopListenerToken](./services.md#interface-stoplistenertoken), [logger](./client.md#variable-logger)
|
|
@@ -6968,7 +6875,7 @@ v2
|
|
|
6968
6875
|
}
|
|
6969
6876
|
|
|
6970
6877
|
```ts
|
|
6971
|
-
export async function WocHeadersBulkListener_test(): Promise<void>
|
|
6878
|
+
export async function WocHeadersBulkListener_test(): Promise<void>
|
|
6972
6879
|
```
|
|
6973
6880
|
|
|
6974
6881
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -6979,7 +6886,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6979
6886
|
High speed WebSocket based based new block header listener
|
|
6980
6887
|
|
|
6981
6888
|
```ts
|
|
6982
|
-
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>
|
|
6889
|
+
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>
|
|
6983
6890
|
```
|
|
6984
6891
|
|
|
6985
6892
|
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [StopListenerToken](./services.md#interface-stoplistenertoken)
|
|
@@ -7007,7 +6914,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7007
6914
|
##### Function: WocHeadersLiveListener_test
|
|
7008
6915
|
|
|
7009
6916
|
```ts
|
|
7010
|
-
export async function WocHeadersLiveListener_test(): Promise<void>
|
|
6917
|
+
export async function WocHeadersLiveListener_test(): Promise<void>
|
|
7011
6918
|
```
|
|
7012
6919
|
|
|
7013
6920
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7018,7 +6925,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7018
6925
|
Add two Buffer encoded chainwork values
|
|
7019
6926
|
|
|
7020
6927
|
```ts
|
|
7021
|
-
export function addWork(work1: string, work2: string): string
|
|
6928
|
+
export function addWork(work1: string, work2: string): string
|
|
7022
6929
|
```
|
|
7023
6930
|
|
|
7024
6931
|
Returns
|
|
@@ -7031,7 +6938,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7031
6938
|
##### Function: arcDefaultUrl
|
|
7032
6939
|
|
|
7033
6940
|
```ts
|
|
7034
|
-
export function arcDefaultUrl(chain: Chain): string
|
|
6941
|
+
export function arcDefaultUrl(chain: Chain): string
|
|
7035
6942
|
```
|
|
7036
6943
|
|
|
7037
6944
|
See also: [Chain](./client.md#type-chain)
|
|
@@ -7042,7 +6949,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7042
6949
|
##### Function: arcGorillaPoolUrl
|
|
7043
6950
|
|
|
7044
6951
|
```ts
|
|
7045
|
-
export function arcGorillaPoolUrl(chain: Chain): string | undefined
|
|
6952
|
+
export function arcGorillaPoolUrl(chain: Chain): string | undefined
|
|
7046
6953
|
```
|
|
7047
6954
|
|
|
7048
6955
|
See also: [Chain](./client.md#type-chain)
|
|
@@ -7056,7 +6963,7 @@ Default Arcade (bsv-blockchain/arcade) endpoint per chain.
|
|
|
7056
6963
|
Returns undefined when no public default is known for the chain.
|
|
7057
6964
|
|
|
7058
6965
|
```ts
|
|
7059
|
-
export function arcadeDefaultUrl(chain: Chain): string | undefined
|
|
6966
|
+
export function arcadeDefaultUrl(chain: Chain): string | undefined
|
|
7060
6967
|
```
|
|
7061
6968
|
|
|
7062
6969
|
See also: [Chain](./client.md#type-chain)
|
|
@@ -7067,10 +6974,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7067
6974
|
##### Function: authenticateMerklePathResult
|
|
7068
6975
|
|
|
7069
6976
|
```ts
|
|
7070
|
-
export async function authenticateMerklePathResult(requestedTxid: unknown, result: GetMerklePathResult, validator: MerkleRootValidator, requireProofOfWork = false, requireHeaderFormat = true): Promise<ValidatedMerklePathResult>
|
|
6977
|
+
export async function authenticateMerklePathResult(requestedTxid: unknown, result: GetMerklePathResult, validator: MerkleRootValidator, requireProofOfWork = false, requireHeaderFormat = true, chain?: Chain): Promise<ValidatedMerklePathResult>
|
|
7071
6978
|
```
|
|
7072
6979
|
|
|
7073
|
-
See also: [GetMerklePathResult](./client.md#interface-getmerklepathresult), [MerkleRootValidator](./services.md#interface-merklerootvalidator), [ValidatedMerklePathResult](./services.md#interface-validatedmerklepathresult)
|
|
6980
|
+
See also: [Chain](./client.md#type-chain), [GetMerklePathResult](./client.md#interface-getmerklepathresult), [MerkleRootValidator](./services.md#interface-merklerootvalidator), [ValidatedMerklePathResult](./services.md#interface-validatedmerklepathresult)
|
|
7074
6981
|
|
|
7075
6982
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7076
6983
|
|
|
@@ -7109,7 +7016,7 @@ Builds the shared portion of ChaintracksOptions that all storage backends
|
|
|
7109
7016
|
The caller is responsible for providing the storage implementation.
|
|
7110
7017
|
|
|
7111
7018
|
```ts
|
|
7112
|
-
export function buildChaintracksOptionsWithIngestors(params: ChaintracksIngestorParams, storage: ChaintracksOptions["storage"]): ChaintracksOptions
|
|
7019
|
+
export function buildChaintracksOptionsWithIngestors(params: ChaintracksIngestorParams, storage: ChaintracksOptions["storage"]): ChaintracksOptions
|
|
7113
7020
|
```
|
|
7114
7021
|
|
|
7115
7022
|
See also: [ChaintracksIngestorParams](./services.md#interface-chaintracksingestorparams), [ChaintracksOptions](./services.md#interface-chaintracksoptions)
|
|
@@ -7124,7 +7031,7 @@ one place prevents a provider from calling a rejection "unknown" while the
|
|
|
7124
7031
|
monitor's event path calls the same status terminal.
|
|
7125
7032
|
|
|
7126
7033
|
```ts
|
|
7127
|
-
export function classifyArcadeRejection(event: ArcadeLifecycleStatus): ArcadeRejectionClassification
|
|
7034
|
+
export function classifyArcadeRejection(event: ArcadeLifecycleStatus): ArcadeRejectionClassification
|
|
7128
7035
|
```
|
|
7129
7036
|
|
|
7130
7037
|
See also: [ArcadeLifecycleStatus](./services.md#interface-arcadelifecyclestatus), [ArcadeRejectionClassification](./services.md#interface-arcaderejectionclassification)
|
|
@@ -7140,7 +7047,7 @@ Returns `'retry'` when the request was rate-limited and the caller should retry,
|
|
|
7140
7047
|
`'notFound'` for 404, `'badStatus'` for other non-200 codes.
|
|
7141
7048
|
|
|
7142
7049
|
```ts
|
|
7143
|
-
export function classifyMerklePathResponse(status: number, statusText: string, retry: number): "retry" | "notFound" | "badStatus" | "ok"
|
|
7050
|
+
export function classifyMerklePathResponse(status: number, statusText: string, retry: number): "retry" | "notFound" | "badStatus" | "ok"
|
|
7144
7051
|
```
|
|
7145
7052
|
|
|
7146
7053
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7154,7 +7061,7 @@ batch callers can finish classifying every candidate before deciding whether
|
|
|
7154
7061
|
a destructive operation is safe.
|
|
7155
7062
|
|
|
7156
7063
|
```ts
|
|
7157
|
-
export async function classifyOutputUtxo(services: UtxoServices, output: TableOutput): Promise<OutputUtxoClassification>
|
|
7064
|
+
export async function classifyOutputUtxo(services: UtxoServices, output: TableOutput): Promise<OutputUtxoClassification>
|
|
7158
7065
|
```
|
|
7159
7066
|
|
|
7160
7067
|
See also: [OutputUtxoClassification](./services.md#interface-outpututxoclassification), [TableOutput](./storage.md#interface-tableoutput)
|
|
@@ -7165,7 +7072,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7165
7072
|
##### Function: containsControlCharacter
|
|
7166
7073
|
|
|
7167
7074
|
```ts
|
|
7168
|
-
export function containsControlCharacter(value: string): boolean
|
|
7075
|
+
export function containsControlCharacter(value: string): boolean
|
|
7169
7076
|
```
|
|
7170
7077
|
|
|
7171
7078
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7176,7 +7083,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7176
7083
|
Computes "target" value for 4 byte Bitcoin block header "bits" value.
|
|
7177
7084
|
|
|
7178
7085
|
```ts
|
|
7179
|
-
export function convertBitsToTarget(bits: number | number[]): BigNumber
|
|
7086
|
+
export function convertBitsToTarget(bits: number | number[]): BigNumber
|
|
7180
7087
|
```
|
|
7181
7088
|
|
|
7182
7089
|
Returns
|
|
@@ -7196,9 +7103,11 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7196
7103
|
Computes "chainWork" value for 4 byte Bitcoin block header "bits" value.
|
|
7197
7104
|
|
|
7198
7105
|
```ts
|
|
7199
|
-
export function convertBitsToWork(bits: number | number[]): string
|
|
7106
|
+
export function convertBitsToWork(bits: number | number[], chain?: Chain): string
|
|
7200
7107
|
```
|
|
7201
7108
|
|
|
7109
|
+
See also: [Chain](./client.md#type-chain)
|
|
7110
|
+
|
|
7202
7111
|
Returns
|
|
7203
7112
|
|
|
7204
7113
|
32 byte Buffer with "chainWork" value
|
|
@@ -7207,6 +7116,9 @@ Argument Details
|
|
|
7207
7116
|
|
|
7208
7117
|
+ **bits**
|
|
7209
7118
|
+ number or converted from Buffer using `readUint32LE`
|
|
7119
|
+
+ **chain**
|
|
7120
|
+
+ Optional chain the header belongs to. Selects its proof-of-work limit
|
|
7121
|
+
(see `proofOfWorkLimitBits`); omitted means the mainnet limit.
|
|
7210
7122
|
|
|
7211
7123
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7212
7124
|
|
|
@@ -7278,31 +7190,18 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7278
7190
|
##### Function: convertWocToBlockHeaderHex
|
|
7279
7191
|
|
|
7280
7192
|
```ts
|
|
7281
|
-
export function convertWocToBlockHeaderHex(woc: WocHeader): BlockHeader
|
|
7193
|
+
export function convertWocToBlockHeaderHex(woc: WocHeader): BlockHeader
|
|
7282
7194
|
```
|
|
7283
7195
|
|
|
7284
7196
|
See also: [BlockHeader](./client.md#interface-blockheader), [WocHeader](./services.md#interface-wocheader)
|
|
7285
7197
|
|
|
7286
7198
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7287
7199
|
|
|
7288
|
-
---
|
|
7289
|
-
##### Function: copyMerklePath
|
|
7290
|
-
|
|
7291
|
-
```ts
|
|
7292
|
-
export function copyMerklePath(txid: string, value: unknown): {
|
|
7293
|
-
merklePath: MerklePath;
|
|
7294
|
-
root: string;
|
|
7295
|
-
index: number;
|
|
7296
|
-
}
|
|
7297
|
-
```
|
|
7298
|
-
|
|
7299
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7300
|
-
|
|
7301
7200
|
---
|
|
7302
7201
|
##### Function: copyRawTransactionBytes
|
|
7303
7202
|
|
|
7304
7203
|
```ts
|
|
7305
|
-
export function copyRawTransactionBytes(value: unknown, name = "rawTx"): number[]
|
|
7204
|
+
export function copyRawTransactionBytes(value: unknown, name = "rawTx"): number[]
|
|
7306
7205
|
```
|
|
7307
7206
|
|
|
7308
7207
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7311,10 +7210,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7311
7210
|
##### Function: copyValidatedBlockHeader
|
|
7312
7211
|
|
|
7313
7212
|
```ts
|
|
7314
|
-
export function copyValidatedBlockHeader(value: unknown, requireProofOfWork = false, requireHeaderFormat = true): BlockHeader
|
|
7213
|
+
export function copyValidatedBlockHeader(value: unknown, requireProofOfWork = false, requireHeaderFormat = true, chain?: Chain): BlockHeader
|
|
7315
7214
|
```
|
|
7316
7215
|
|
|
7317
|
-
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
7216
|
+
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain)
|
|
7318
7217
|
|
|
7319
7218
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7320
7219
|
|
|
@@ -7322,7 +7221,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7322
7221
|
##### Function: createAndStartDefaultChaintracks
|
|
7323
7222
|
|
|
7324
7223
|
```ts
|
|
7325
|
-
export function createAndStartDefaultChaintracks<TStorage extends ChaintracksOptions["storage"]>(args: DefaultChaintracksArguments, createOptions: (...args: DefaultChaintracksArguments) => ChaintracksOptions): CreatedChaintracks<TStorage>
|
|
7224
|
+
export function createAndStartDefaultChaintracks<TStorage extends ChaintracksOptions["storage"]>(args: DefaultChaintracksArguments, createOptions: (...args: DefaultChaintracksArguments) => ChaintracksOptions): CreatedChaintracks<TStorage>
|
|
7326
7225
|
```
|
|
7327
7226
|
|
|
7328
7227
|
See also: [ChaintracksOptions](./services.md#interface-chaintracksoptions), [CreatedChaintracks](./services.md#interface-createdchaintracks), [DefaultChaintracksArguments](./services.md#type-defaultchaintracksarguments)
|
|
@@ -7333,7 +7232,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7333
7232
|
##### Function: createAndStartDefaultKnexChaintracks
|
|
7334
7233
|
|
|
7335
7234
|
```ts
|
|
7336
|
-
export function createAndStartDefaultKnexChaintracks<TStorage extends ChaintracksOptions["storage"]>(args: DefaultKnexChaintracksArguments, createOptions: (...args: DefaultKnexChaintracksArguments) => ChaintracksOptions): CreatedChaintracks<TStorage>
|
|
7235
|
+
export function createAndStartDefaultKnexChaintracks<TStorage extends ChaintracksOptions["storage"]>(args: DefaultKnexChaintracksArguments, createOptions: (...args: DefaultKnexChaintracksArguments) => ChaintracksOptions): CreatedChaintracks<TStorage>
|
|
7337
7236
|
```
|
|
7338
7237
|
|
|
7339
7238
|
See also: [ChaintracksOptions](./services.md#interface-chaintracksoptions), [CreatedChaintracks](./services.md#interface-createdchaintracks), [DefaultKnexChaintracksArguments](./services.md#type-defaultknexchaintracksarguments)
|
|
@@ -7346,7 +7245,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7346
7245
|
Builds the current Chaintracks schema. Exported so dialect DDL can be regression-tested without a live server.
|
|
7347
7246
|
|
|
7348
7247
|
```ts
|
|
7349
|
-
export function createChaintracksInitialSchema(knex: Knex): Knex.SchemaBuilder
|
|
7248
|
+
export function createChaintracksInitialSchema(knex: Knex): Knex.SchemaBuilder
|
|
7350
7249
|
```
|
|
7351
7250
|
|
|
7352
7251
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7355,7 +7254,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7355
7254
|
##### Function: createDefaultBulkFileDataManager
|
|
7356
7255
|
|
|
7357
7256
|
```ts
|
|
7358
|
-
export function createDefaultBulkFileDataManager(params: ResolvedDefaultChaintracksParams): BulkFileDataManager
|
|
7257
|
+
export function createDefaultBulkFileDataManager(params: ResolvedDefaultChaintracksParams): BulkFileDataManager
|
|
7359
7258
|
```
|
|
7360
7259
|
|
|
7361
7260
|
See also: [BulkFileDataManager](./services.md#class-bulkfiledatamanager), [ResolvedDefaultChaintracksParams](./services.md#interface-resolveddefaultchaintracksparams)
|
|
@@ -7382,7 +7281,7 @@ check proves it), this branch can be removed and browsers can share the v2
|
|
|
7382
7281
|
default. Node runtimes are unchanged.
|
|
7383
7282
|
|
|
7384
7283
|
```ts
|
|
7385
|
-
export function createDefaultChaintracksClient(chain: Exclude<Chain, "mock">): ChaintracksClientApi
|
|
7284
|
+
export function createDefaultChaintracksClient(chain: Exclude<Chain, "mock">): ChaintracksClientApi
|
|
7386
7285
|
```
|
|
7387
7286
|
|
|
7388
7287
|
See also: [Chain](./client.md#type-chain), [ChaintracksClientApi](./services.md#interface-chaintracksclientapi)
|
|
@@ -7393,7 +7292,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7393
7292
|
##### Function: createDefaultChaintracksStorageOptions
|
|
7394
7293
|
|
|
7395
7294
|
```ts
|
|
7396
|
-
export function createDefaultChaintracksStorageOptions(params: ResolvedDefaultChaintracksParams)
|
|
7295
|
+
export function createDefaultChaintracksStorageOptions(params: ResolvedDefaultChaintracksParams)
|
|
7397
7296
|
```
|
|
7398
7297
|
|
|
7399
7298
|
See also: [ResolvedDefaultChaintracksParams](./services.md#interface-resolveddefaultchaintracksparams)
|
|
@@ -7404,7 +7303,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7404
7303
|
##### Function: createDefaultIdbChaintracksOptions
|
|
7405
7304
|
|
|
7406
7305
|
```ts
|
|
7407
|
-
export function createDefaultIdbChaintracksOptions(...args: DefaultChaintracksArguments): ChaintracksOptions
|
|
7306
|
+
export function createDefaultIdbChaintracksOptions(...args: DefaultChaintracksArguments): ChaintracksOptions
|
|
7408
7307
|
```
|
|
7409
7308
|
|
|
7410
7309
|
See also: [ChaintracksOptions](./services.md#interface-chaintracksoptions), [DefaultChaintracksArguments](./services.md#type-defaultchaintracksarguments)
|
|
@@ -7415,7 +7314,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7415
7314
|
##### Function: createDefaultKnexChaintracksOptions
|
|
7416
7315
|
|
|
7417
7316
|
```ts
|
|
7418
|
-
export function createDefaultKnexChaintracksOptions(...args: DefaultKnexChaintracksArguments): ChaintracksOptions
|
|
7317
|
+
export function createDefaultKnexChaintracksOptions(...args: DefaultKnexChaintracksArguments): ChaintracksOptions
|
|
7419
7318
|
```
|
|
7420
7319
|
|
|
7421
7320
|
See also: [ChaintracksOptions](./services.md#interface-chaintracksoptions), [DefaultKnexChaintracksArguments](./services.md#type-defaultknexchaintracksarguments)
|
|
@@ -7431,7 +7330,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7431
7330
|
##### Function: createDefaultNoDbChaintracksOptions
|
|
7432
7331
|
|
|
7433
7332
|
```ts
|
|
7434
|
-
export function createDefaultNoDbChaintracksOptions(...args: DefaultChaintracksArguments): ChaintracksOptions
|
|
7333
|
+
export function createDefaultNoDbChaintracksOptions(...args: DefaultChaintracksArguments): ChaintracksOptions
|
|
7435
7334
|
```
|
|
7436
7335
|
|
|
7437
7336
|
See also: [ChaintracksOptions](./services.md#interface-chaintracksoptions), [DefaultChaintracksArguments](./services.md#type-defaultchaintracksarguments)
|
|
@@ -7454,7 +7353,7 @@ export function createDefaultWalletServicesOptions(...[chain, arcCallbackUrl, ar
|
|
|
7454
7353
|
arcadeUrl?: string,
|
|
7455
7354
|
arcadeApiKey?: string,
|
|
7456
7355
|
arcadeCallbackToken?: string
|
|
7457
|
-
]): WalletServicesOptions
|
|
7356
|
+
]): WalletServicesOptions
|
|
7458
7357
|
```
|
|
7459
7358
|
|
|
7460
7359
|
See also: [Chain](./client.md#type-chain), [ChaintracksClientApi](./services.md#interface-chaintracksclientapi), [WalletServicesOptions](./client.md#interface-walletservicesoptions)
|
|
@@ -7472,7 +7371,7 @@ export async function createIdbChaintracks(...args: DefaultChaintracksArguments)
|
|
|
7472
7371
|
storage: ChaintracksStorageIdb;
|
|
7473
7372
|
chaintracks: Chaintracks;
|
|
7474
7373
|
available: Promise<void>;
|
|
7475
|
-
}>
|
|
7374
|
+
}>
|
|
7476
7375
|
```
|
|
7477
7376
|
|
|
7478
7377
|
See also: [Chain](./client.md#type-chain), [Chaintracks](./services.md#class-chaintracks), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi), [ChaintracksStorageIdb](./services.md#class-chaintracksstorageidb), [DefaultChaintracksArguments](./services.md#type-defaultchaintracksarguments)
|
|
@@ -7490,7 +7389,7 @@ export async function createKnexChaintracks(...args: DefaultKnexChaintracksArgum
|
|
|
7490
7389
|
storage: ChaintracksStorageKnex;
|
|
7491
7390
|
chaintracks: Chaintracks;
|
|
7492
7391
|
available: Promise<void>;
|
|
7493
|
-
}>
|
|
7392
|
+
}>
|
|
7494
7393
|
```
|
|
7495
7394
|
|
|
7496
7395
|
See also: [Chain](./client.md#type-chain), [Chaintracks](./services.md#class-chaintracks), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi), [ChaintracksStorageKnex](./services.md#class-chaintracksstorageknex), [DefaultKnexChaintracksArguments](./services.md#type-defaultknexchaintracksarguments)
|
|
@@ -7508,7 +7407,7 @@ export async function createNoDbChaintracks(...args: DefaultChaintracksArguments
|
|
|
7508
7407
|
storage: ChaintracksStorageNoDb;
|
|
7509
7408
|
chaintracks: Chaintracks;
|
|
7510
7409
|
available: Promise<void>;
|
|
7511
|
-
}>
|
|
7410
|
+
}>
|
|
7512
7411
|
```
|
|
7513
7412
|
|
|
7514
7413
|
See also: [Chain](./client.md#type-chain), [Chaintracks](./services.md#class-chaintracks), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi), [ChaintracksStorageNoDb](./services.md#class-chaintracksstoragenodb), [DefaultChaintracksArguments](./services.md#type-defaultchaintracksarguments)
|
|
@@ -7519,7 +7418,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7519
7418
|
##### Function: createStopHandler
|
|
7520
7419
|
|
|
7521
7420
|
```ts
|
|
7522
|
-
export function createStopHandler(markOk: () => void, isOpen: () => boolean, markClosed: () => void, close: () => void, markDone: () => void): () => void
|
|
7421
|
+
export function createStopHandler(markOk: () => void, isOpen: () => boolean, markClosed: () => void, close: () => void, markDone: () => void): () => void
|
|
7523
7422
|
```
|
|
7524
7423
|
|
|
7525
7424
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7532,7 +7431,7 @@ Deserialize a BaseBlockHeader from an 80 byte buffer
|
|
|
7532
7431
|
```ts
|
|
7533
7432
|
export function deserializeBaseBlockHeader(buffer: number[] | Uint8Array, offset = 0): BaseBlockHeader {
|
|
7534
7433
|
validateByteWindow(buffer, offset, 80);
|
|
7535
|
-
const reader = ReaderUint8Array.makeReader(buffer, offset);
|
|
7434
|
+
const reader = Utils.ReaderUint8Array.makeReader(buffer, offset);
|
|
7536
7435
|
const header: BaseBlockHeader = {
|
|
7537
7436
|
version: reader.readUInt32LE(),
|
|
7538
7437
|
previousHash: asString(reader.read(32).reverse()),
|
|
@@ -7553,7 +7452,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7553
7452
|
##### Function: deserializeBaseBlockHeaders
|
|
7554
7453
|
|
|
7555
7454
|
```ts
|
|
7556
|
-
export function deserializeBaseBlockHeaders(buffer: number[] | Uint8Array, offset = 0, count?: number | undefined): BaseBlockHeader[]
|
|
7455
|
+
export function deserializeBaseBlockHeaders(buffer: number[] | Uint8Array, offset = 0, count?: number | undefined): BaseBlockHeader[]
|
|
7557
7456
|
```
|
|
7558
7457
|
|
|
7559
7458
|
See also: [BaseBlockHeader](./client.md#interface-baseblockheader)
|
|
@@ -7564,7 +7463,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7564
7463
|
##### Function: deserializeBlockHeader
|
|
7565
7464
|
|
|
7566
7465
|
```ts
|
|
7567
|
-
export function deserializeBlockHeader(buffer: number[] | Uint8Array, height: number, offset = 0): BlockHeader
|
|
7466
|
+
export function deserializeBlockHeader(buffer: number[] | Uint8Array, height: number, offset = 0): BlockHeader
|
|
7568
7467
|
```
|
|
7569
7468
|
|
|
7570
7469
|
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
@@ -7575,7 +7474,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7575
7474
|
##### Function: deserializeBlockHeaders
|
|
7576
7475
|
|
|
7577
7476
|
```ts
|
|
7578
|
-
export function deserializeBlockHeaders(firstHeight: number, buffer: number[] | Uint8Array, offset = 0, count?: number | undefined): BlockHeader[]
|
|
7477
|
+
export function deserializeBlockHeaders(firstHeight: number, buffer: number[] | Uint8Array, offset = 0, count?: number | undefined): BlockHeader[]
|
|
7579
7478
|
```
|
|
7580
7479
|
|
|
7581
7480
|
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
@@ -7660,6 +7559,17 @@ export function genesisHeader(chain: Chain): BlockHeader {
|
|
|
7660
7559
|
height: 0,
|
|
7661
7560
|
hash: "000000005d221c0e023cb56b5682cf094f32cd959958b40bc931e5797cae706c"
|
|
7662
7561
|
};
|
|
7562
|
+
case "regtest":
|
|
7563
|
+
return {
|
|
7564
|
+
version: 1,
|
|
7565
|
+
previousHash: "0000000000000000000000000000000000000000000000000000000000000000",
|
|
7566
|
+
merkleRoot: "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
|
|
7567
|
+
time: 1296688602,
|
|
7568
|
+
bits: 545259519,
|
|
7569
|
+
nonce: 2,
|
|
7570
|
+
height: 0,
|
|
7571
|
+
hash: "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"
|
|
7572
|
+
};
|
|
7663
7573
|
case "mock":
|
|
7664
7574
|
throw new Error("genesisHeader does not support 'mock' chain. Mock chain generates its own genesis block.");
|
|
7665
7575
|
}
|
|
@@ -7674,33 +7584,18 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7674
7584
|
##### Function: getBeefForTxid
|
|
7675
7585
|
|
|
7676
7586
|
```ts
|
|
7677
|
-
export async function getBeefForTxid(services: Services, txid: string): Promise<Beef>
|
|
7587
|
+
export async function getBeefForTxid(services: Services, txid: string): Promise<Beef>
|
|
7678
7588
|
```
|
|
7679
7589
|
|
|
7680
7590
|
See also: [Services](./services.md#class-services)
|
|
7681
7591
|
|
|
7682
7592
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7683
7593
|
|
|
7684
|
-
---
|
|
7685
|
-
##### Function: getCanonicalMerklePath
|
|
7686
|
-
|
|
7687
|
-
Obtain a canonical proof with provider failover when the service supports
|
|
7688
|
-
it. Custom WalletServices implementations without the optional failover
|
|
7689
|
-
method still fail closed after validating their single lookup.
|
|
7690
|
-
|
|
7691
|
-
```ts
|
|
7692
|
-
export async function getCanonicalMerklePath(services: WalletServices, chaintracker: ChainTracker, txid: string): Promise<GetMerklePathResult>
|
|
7693
|
-
```
|
|
7694
|
-
|
|
7695
|
-
See also: [GetMerklePathResult](./client.md#interface-getmerklepathresult), [WalletServices](./client.md#interface-walletservices)
|
|
7696
|
-
|
|
7697
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7698
|
-
|
|
7699
7594
|
---
|
|
7700
7595
|
##### Function: getExchangeRatesIo
|
|
7701
7596
|
|
|
7702
7597
|
```ts
|
|
7703
|
-
export async function getExchangeRatesIo(key: string, symbols?: string[], fetchClient?: typeof fetch): Promise<ExchangeRatesIoApi>
|
|
7598
|
+
export async function getExchangeRatesIo(key: string, symbols?: string[], fetchClient?: typeof fetch): Promise<ExchangeRatesIoApi>
|
|
7704
7599
|
```
|
|
7705
7600
|
|
|
7706
7601
|
See also: [ExchangeRatesIoApi](./services.md#interface-exchangeratesioapi)
|
|
@@ -7711,7 +7606,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7711
7606
|
##### Function: getWhatsOnChainBlockHeaderByHash
|
|
7712
7607
|
|
|
7713
7608
|
```ts
|
|
7714
|
-
export async function getWhatsOnChainBlockHeaderByHash(hash: string, chain: Chain = "main", apiKey?: string): Promise<BlockHeader | undefined>
|
|
7609
|
+
export async function getWhatsOnChainBlockHeaderByHash(hash: string, chain: Chain = "main", apiKey?: string): Promise<BlockHeader | undefined>
|
|
7715
7610
|
```
|
|
7716
7611
|
|
|
7717
7612
|
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain)
|
|
@@ -7729,7 +7624,7 @@ export function handlePostRawTxErrorResponse(r: PostTxResultForTxid, nne: () =>
|
|
|
7729
7624
|
statusText?: unknown;
|
|
7730
7625
|
status?: unknown;
|
|
7731
7626
|
ok?: boolean;
|
|
7732
|
-
}): void
|
|
7627
|
+
}): void
|
|
7733
7628
|
```
|
|
7734
7629
|
|
|
7735
7630
|
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
@@ -7743,7 +7638,7 @@ Decide whether a caught error is retryable for script-hash history calls.
|
|
|
7743
7638
|
If not retryable, sets `r.error` and returns false.
|
|
7744
7639
|
|
|
7745
7640
|
```ts
|
|
7746
|
-
export function handleScriptHashHistoryCatch(r: GetScriptHashHistoryResult, error_: unknown, _url: string, methodName: string, retry: number, maxRetry: number): boolean
|
|
7641
|
+
export function handleScriptHashHistoryCatch(r: GetScriptHashHistoryResult, error_: unknown, _url: string, methodName: string, retry: number, maxRetry: number): boolean
|
|
7747
7642
|
```
|
|
7748
7643
|
|
|
7749
7644
|
See also: [GetScriptHashHistoryResult](./client.md#interface-getscripthashhistoryresult)
|
|
@@ -7761,7 +7656,7 @@ Returns:
|
|
|
7761
7656
|
- `'ok'` — response was successful, continue parsing
|
|
7762
7657
|
|
|
7763
7658
|
```ts
|
|
7764
|
-
export function handleScriptHashHistoryResponse(r: GetScriptHashHistoryResult, response: ScriptHashHistoryResponse, methodName: string, retry: number): "continue" | "return" | "ok"
|
|
7659
|
+
export function handleScriptHashHistoryResponse(r: GetScriptHashHistoryResult, response: ScriptHashHistoryResponse, methodName: string, retry: number): "continue" | "return" | "ok"
|
|
7765
7660
|
```
|
|
7766
7661
|
|
|
7767
7662
|
See also: [GetScriptHashHistoryResult](./client.md#interface-getscripthashhistoryresult), [ScriptHashHistoryResponse](./services.md#interface-scripthashhistoryresponse)
|
|
@@ -7775,7 +7670,7 @@ Decide whether the ECONNRESET error is retryable and, if not, set `r.error`.
|
|
|
7775
7670
|
Returns true when the caller should retry, false when it should return.
|
|
7776
7671
|
|
|
7777
7672
|
```ts
|
|
7778
|
-
export function handleUtxoConnReset(r: GetUtxoStatusResult, error_: unknown, _url: string, retry: number, maxRetry: number): boolean
|
|
7673
|
+
export function handleUtxoConnReset(r: GetUtxoStatusResult, error_: unknown, _url: string, retry: number, maxRetry: number): boolean
|
|
7779
7674
|
```
|
|
7780
7675
|
|
|
7781
7676
|
See also: [GetUtxoStatusResult](./client.md#interface-getutxostatusresult)
|
|
@@ -7786,7 +7681,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7786
7681
|
##### Function: isArcAcceptedTxStatus
|
|
7787
7682
|
|
|
7788
7683
|
```ts
|
|
7789
|
-
export function isArcAcceptedTxStatus(txStatus: string | undefined): boolean
|
|
7684
|
+
export function isArcAcceptedTxStatus(txStatus: string | undefined): boolean
|
|
7790
7685
|
```
|
|
7791
7686
|
|
|
7792
7687
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7795,7 +7690,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7795
7690
|
##### Function: isArcDoubleSpendTxStatus
|
|
7796
7691
|
|
|
7797
7692
|
```ts
|
|
7798
|
-
export function isArcDoubleSpendTxStatus(txStatus: string | undefined): boolean
|
|
7693
|
+
export function isArcDoubleSpendTxStatus(txStatus: string | undefined): boolean
|
|
7799
7694
|
```
|
|
7800
7695
|
|
|
7801
7696
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7804,7 +7699,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7804
7699
|
##### Function: isArcInvalidTxStatus
|
|
7805
7700
|
|
|
7806
7701
|
```ts
|
|
7807
|
-
export function isArcInvalidTxStatus(txStatus: string | undefined): boolean
|
|
7702
|
+
export function isArcInvalidTxStatus(txStatus: string | undefined): boolean
|
|
7808
7703
|
```
|
|
7809
7704
|
|
|
7810
7705
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7813,7 +7708,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7813
7708
|
##### Function: isArcServiceErrorStatus
|
|
7814
7709
|
|
|
7815
7710
|
```ts
|
|
7816
|
-
export function isArcServiceErrorStatus(status: number | undefined, detail?: string): boolean
|
|
7711
|
+
export function isArcServiceErrorStatus(status: number | undefined, detail?: string): boolean
|
|
7817
7712
|
```
|
|
7818
7713
|
|
|
7819
7714
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7948,7 +7843,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7948
7843
|
Returns true if work1 is more work (greater than) work2
|
|
7949
7844
|
|
|
7950
7845
|
```ts
|
|
7951
|
-
export function isMoreWork(work1: string, work2: string): boolean
|
|
7846
|
+
export function isMoreWork(work1: string, work2: string): boolean
|
|
7952
7847
|
```
|
|
7953
7848
|
|
|
7954
7849
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7957,7 +7852,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7957
7852
|
##### Function: isValidFiatRate
|
|
7958
7853
|
|
|
7959
7854
|
```ts
|
|
7960
|
-
export function isValidFiatRate(value: unknown): value is number
|
|
7855
|
+
export function isValidFiatRate(value: unknown): value is number
|
|
7961
7856
|
```
|
|
7962
7857
|
|
|
7963
7858
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7966,7 +7861,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7966
7861
|
##### Function: makeMerklePathNote
|
|
7967
7862
|
|
|
7968
7863
|
```ts
|
|
7969
|
-
export function makeMerklePathNote(what: MerklePathNoteWhat, name: string, extra: Partial<MerklePathNote> = {}): MerklePathNote
|
|
7864
|
+
export function makeMerklePathNote(what: MerklePathNoteWhat, name: string, extra: Partial<MerklePathNote> = {}): MerklePathNote
|
|
7970
7865
|
```
|
|
7971
7866
|
|
|
7972
7867
|
See also: [MerklePathNote](./services.md#interface-merklepathnote), [MerklePathNoteWhat](./services.md#type-merklepathnotewhat)
|
|
@@ -7977,7 +7872,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7977
7872
|
##### Function: makePostBeefServiceError
|
|
7978
7873
|
|
|
7979
7874
|
```ts
|
|
7980
|
-
export function makePostBeefServiceError(providerName: string, txids: string[], what: "postBeefServiceError" | "postBeefServiceTimeout", timeoutMs?: number): PostBeefResult
|
|
7875
|
+
export function makePostBeefServiceError(providerName: string, txids: string[], what: "postBeefServiceError" | "postBeefServiceTimeout", timeoutMs?: number): PostBeefResult
|
|
7981
7876
|
```
|
|
7982
7877
|
|
|
7983
7878
|
See also: [PostBeefResult](./client.md#interface-postbeefresult)
|
|
@@ -7988,7 +7883,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7988
7883
|
##### Function: mapWithConcurrency
|
|
7989
7884
|
|
|
7990
7885
|
```ts
|
|
7991
|
-
export async function mapWithConcurrency<T, R>(values: T[], maxConcurrency: number, worker: (value: T, index: number) => Promise<R>): Promise<R[]>
|
|
7886
|
+
export async function mapWithConcurrency<T, R>(values: T[], maxConcurrency: number, worker: (value: T, index: number) => Promise<R>): Promise<R[]>
|
|
7992
7887
|
```
|
|
7993
7888
|
|
|
7994
7889
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7999,7 +7894,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7999
7894
|
Snapshot security-relevant ARC/Arcade constructor configuration exactly once.
|
|
8000
7895
|
|
|
8001
7896
|
```ts
|
|
8002
|
-
export function normalizeArcProviderConfig(config: string | ArcConfig | undefined, defaultDeploymentId: () => string): NormalizedArcProviderConfig
|
|
7897
|
+
export function normalizeArcProviderConfig(config: string | ArcConfig | undefined, defaultDeploymentId: () => string): NormalizedArcProviderConfig
|
|
8003
7898
|
```
|
|
8004
7899
|
|
|
8005
7900
|
See also: [ArcConfig](./services.md#interface-arcconfig), [NormalizedArcProviderConfig](./services.md#interface-normalizedarcproviderconfig)
|
|
@@ -8012,7 +7907,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8012
7907
|
Normalize and snapshot a complete validator request before asynchronous work.
|
|
8013
7908
|
|
|
8014
7909
|
```ts
|
|
8015
|
-
export function normalizeBulkFileDataValidationRequest(request: unknown): BulkFileDataValidationRequest
|
|
7910
|
+
export function normalizeBulkFileDataValidationRequest(request: unknown): BulkFileDataValidationRequest
|
|
8016
7911
|
```
|
|
8017
7912
|
|
|
8018
7913
|
See also: [BulkFileDataValidationRequest](./services.md#interface-bulkfiledatavalidationrequest)
|
|
@@ -8023,7 +7918,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8023
7918
|
##### Function: normalizeBulkHeaderFileInfo
|
|
8024
7919
|
|
|
8025
7920
|
```ts
|
|
8026
|
-
export function normalizeBulkHeaderFileInfo(value: unknown, allowStoredBoolean = false): BulkHeaderFileInfo
|
|
7921
|
+
export function normalizeBulkHeaderFileInfo(value: unknown, allowStoredBoolean = false): BulkHeaderFileInfo
|
|
8027
7922
|
```
|
|
8028
7923
|
|
|
8029
7924
|
See also: [BulkHeaderFileInfo](./services.md#interface-bulkheaderfileinfo)
|
|
@@ -8034,7 +7929,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8034
7929
|
##### Function: normalizeBulkHeaderFileSequence
|
|
8035
7930
|
|
|
8036
7931
|
```ts
|
|
8037
|
-
export function normalizeBulkHeaderFileSequence(files: unknown, allowStoredBoolean = false): BulkHeaderFileInfo[]
|
|
7932
|
+
export function normalizeBulkHeaderFileSequence(files: unknown, allowStoredBoolean = false): BulkHeaderFileInfo[]
|
|
8038
7933
|
```
|
|
8039
7934
|
|
|
8040
7935
|
See also: [BulkHeaderFileInfo](./services.md#interface-bulkheaderfileinfo)
|
|
@@ -8045,7 +7940,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8045
7940
|
##### Function: normalizeBulkHeaderFilesInfo
|
|
8046
7941
|
|
|
8047
7942
|
```ts
|
|
8048
|
-
export function normalizeBulkHeaderFilesInfo(value: unknown): BulkHeaderFilesInfo
|
|
7943
|
+
export function normalizeBulkHeaderFilesInfo(value: unknown): BulkHeaderFilesInfo
|
|
8049
7944
|
```
|
|
8050
7945
|
|
|
8051
7946
|
See also: [BulkHeaderFilesInfo](./services.md#interface-bulkheaderfilesinfo)
|
|
@@ -8056,7 +7951,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8056
7951
|
##### Function: normalizeFiatCurrencies
|
|
8057
7952
|
|
|
8058
7953
|
```ts
|
|
8059
|
-
export function normalizeFiatCurrencies(value: unknown, extras: readonly FiatCurrencyCode[] = []): FiatCurrencyCode[]
|
|
7954
|
+
export function normalizeFiatCurrencies(value: unknown, extras: readonly FiatCurrencyCode[] = []): FiatCurrencyCode[]
|
|
8060
7955
|
```
|
|
8061
7956
|
|
|
8062
7957
|
See also: [FiatCurrencyCode](./client.md#type-fiatcurrencycode)
|
|
@@ -8067,7 +7962,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8067
7962
|
##### Function: normalizeFiatCurrency
|
|
8068
7963
|
|
|
8069
7964
|
```ts
|
|
8070
|
-
export function normalizeFiatCurrency(value: unknown, name = "currency"): FiatCurrencyCode
|
|
7965
|
+
export function normalizeFiatCurrency(value: unknown, name = "currency"): FiatCurrencyCode
|
|
8071
7966
|
```
|
|
8072
7967
|
|
|
8073
7968
|
See also: [FiatCurrencyCode](./client.md#type-fiatcurrencycode)
|
|
@@ -8078,7 +7973,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8078
7973
|
##### Function: normalizeFiatExchangeRates
|
|
8079
7974
|
|
|
8080
7975
|
```ts
|
|
8081
|
-
export function normalizeFiatExchangeRates(value: unknown, required: readonly FiatCurrencyCode[], now = Date.now()): FiatExchangeRates
|
|
7976
|
+
export function normalizeFiatExchangeRates(value: unknown, required: readonly FiatCurrencyCode[], now = Date.now()): FiatExchangeRates
|
|
8082
7977
|
```
|
|
8083
7978
|
|
|
8084
7979
|
See also: [FiatCurrencyCode](./client.md#type-fiatcurrencycode), [FiatExchangeRates](./client.md#interface-fiatexchangerates)
|
|
@@ -8089,7 +7984,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8089
7984
|
##### Function: normalizeFiatRate
|
|
8090
7985
|
|
|
8091
7986
|
```ts
|
|
8092
|
-
export function normalizeFiatRate(value: unknown, currency: string): number
|
|
7987
|
+
export function normalizeFiatRate(value: unknown, currency: string): number
|
|
8093
7988
|
```
|
|
8094
7989
|
|
|
8095
7990
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8098,7 +7993,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8098
7993
|
##### Function: normalizeFiatRateTimestamps
|
|
8099
7994
|
|
|
8100
7995
|
```ts
|
|
8101
|
-
export function normalizeFiatRateTimestamps(value: unknown, now = Date.now()): Record<string, Date> | undefined
|
|
7996
|
+
export function normalizeFiatRateTimestamps(value: unknown, now = Date.now()): Record<string, Date> | undefined
|
|
8102
7997
|
```
|
|
8103
7998
|
|
|
8104
7999
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8107,7 +8002,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8107
8002
|
##### Function: normalizeFiatTimestamp
|
|
8108
8003
|
|
|
8109
8004
|
```ts
|
|
8110
|
-
export function normalizeFiatTimestamp(value: unknown, now = Date.now()): Date
|
|
8005
|
+
export function normalizeFiatTimestamp(value: unknown, now = Date.now()): Date
|
|
8111
8006
|
```
|
|
8112
8007
|
|
|
8113
8008
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8116,7 +8011,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8116
8011
|
##### Function: normalizePostRawHex
|
|
8117
8012
|
|
|
8118
8013
|
```ts
|
|
8119
|
-
export function normalizePostRawHex(value: unknown, maximumBytes: number, name = "rawTx"): string
|
|
8014
|
+
export function normalizePostRawHex(value: unknown, maximumBytes: number, name = "rawTx"): string
|
|
8120
8015
|
```
|
|
8121
8016
|
|
|
8122
8017
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8125,7 +8020,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8125
8020
|
##### Function: normalizePostTxids
|
|
8126
8021
|
|
|
8127
8022
|
```ts
|
|
8128
|
-
export function normalizePostTxids(value: unknown, name = "txids", allowEmpty = false): string[]
|
|
8023
|
+
export function normalizePostTxids(value: unknown, name = "txids", allowEmpty = false): string[]
|
|
8129
8024
|
```
|
|
8130
8025
|
|
|
8131
8026
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8134,7 +8029,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8134
8029
|
##### Function: normalizeTxid
|
|
8135
8030
|
|
|
8136
8031
|
```ts
|
|
8137
|
-
export function normalizeTxid(value: unknown, name = "txid"): string
|
|
8032
|
+
export function normalizeTxid(value: unknown, name = "txid"): string
|
|
8138
8033
|
```
|
|
8139
8034
|
|
|
8140
8035
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8143,7 +8038,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8143
8038
|
##### Function: normalizeWalletOutpoint
|
|
8144
8039
|
|
|
8145
8040
|
```ts
|
|
8146
|
-
export function normalizeWalletOutpoint(value: unknown): string | undefined
|
|
8041
|
+
export function normalizeWalletOutpoint(value: unknown): string | undefined
|
|
8147
8042
|
```
|
|
8148
8043
|
|
|
8149
8044
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8159,7 +8054,7 @@ export function parseFileLink(file: string): {
|
|
|
8159
8054
|
} | "latest";
|
|
8160
8055
|
sourceUrl: string;
|
|
8161
8056
|
fileName: string;
|
|
8162
|
-
} | undefined
|
|
8057
|
+
} | undefined
|
|
8163
8058
|
```
|
|
8164
8059
|
|
|
8165
8060
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8175,20 +8070,37 @@ export function populateUtxoDetails(r: GetUtxoStatusResult, result: Array<{
|
|
|
8175
8070
|
value: number;
|
|
8176
8071
|
height: number;
|
|
8177
8072
|
tx_pos: number;
|
|
8178
|
-
}>, outpoint?: string): void
|
|
8073
|
+
}>, outpoint?: string): void
|
|
8179
8074
|
```
|
|
8180
8075
|
|
|
8181
8076
|
See also: [GetUtxoStatusResult](./client.md#interface-getutxostatusresult)
|
|
8182
8077
|
|
|
8183
8078
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8184
8079
|
|
|
8080
|
+
---
|
|
8081
|
+
##### Function: proofOfWorkLimitBits
|
|
8082
|
+
|
|
8083
|
+
The compact encoding of the highest proof-of-work target `chain` admits.
|
|
8084
|
+
|
|
8085
|
+
Only `'regtest'` raises the limit. Every other chain — and an omitted chain,
|
|
8086
|
+
which is how every caller that predates this parameter asks — keeps the mainnet
|
|
8087
|
+
limit, so no existing validation is relaxed.
|
|
8088
|
+
|
|
8089
|
+
```ts
|
|
8090
|
+
export function proofOfWorkLimitBits(chain?: Chain): number
|
|
8091
|
+
```
|
|
8092
|
+
|
|
8093
|
+
See also: [Chain](./client.md#type-chain)
|
|
8094
|
+
|
|
8095
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8096
|
+
|
|
8185
8097
|
---
|
|
8186
8098
|
##### Function: publicArcadeUrl
|
|
8187
8099
|
|
|
8188
8100
|
Credential-free public Arcade host for supported networks.
|
|
8189
8101
|
|
|
8190
8102
|
```ts
|
|
8191
|
-
export function publicArcadeUrl(chain: Chain): string | undefined
|
|
8103
|
+
export function publicArcadeUrl(chain: Chain): string | undefined
|
|
8192
8104
|
```
|
|
8193
8105
|
|
|
8194
8106
|
See also: [Chain](./client.md#type-chain)
|
|
@@ -8199,7 +8111,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8199
8111
|
##### Function: readUInt32BE
|
|
8200
8112
|
|
|
8201
8113
|
```ts
|
|
8202
|
-
export function readUInt32BE(a: number[] | Uint8Array, offset: number): number
|
|
8114
|
+
export function readUInt32BE(a: number[] | Uint8Array, offset: number): number
|
|
8203
8115
|
```
|
|
8204
8116
|
|
|
8205
8117
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8208,7 +8120,30 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8208
8120
|
##### Function: readUInt32LE
|
|
8209
8121
|
|
|
8210
8122
|
```ts
|
|
8211
|
-
export function readUInt32LE(a: number[] | Uint8Array, offset: number): number
|
|
8123
|
+
export function readUInt32LE(a: number[] | Uint8Array, offset: number): number
|
|
8124
|
+
```
|
|
8125
|
+
|
|
8126
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8127
|
+
|
|
8128
|
+
---
|
|
8129
|
+
##### Function: regtestArcadeUrl
|
|
8130
|
+
|
|
8131
|
+
Arcade broadcaster / ARC endpoint for regtest, or `undefined` when `REGTEST_ARCADE_URL` is unset.
|
|
8132
|
+
|
|
8133
|
+
```ts
|
|
8134
|
+
export function regtestArcadeUrl(): string | undefined
|
|
8135
|
+
```
|
|
8136
|
+
|
|
8137
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8138
|
+
|
|
8139
|
+
---
|
|
8140
|
+
##### Function: regtestChaintracksUrl
|
|
8141
|
+
|
|
8142
|
+
ChainTracks service URL for regtest. Falls back to `${REGTEST_ARCADE_URL}/chaintracks/v1` when
|
|
8143
|
+
`REGTEST_CHAINTRACKS_URL` is unset (mirrors the tstn layout). Throws when neither is configured.
|
|
8144
|
+
|
|
8145
|
+
```ts
|
|
8146
|
+
export function regtestChaintracksUrl(): string
|
|
8212
8147
|
```
|
|
8213
8148
|
|
|
8214
8149
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8220,7 +8155,7 @@ Convert an internal tri-state classification to the historical boolean
|
|
|
8220
8155
|
contract only when a provider supplied a conclusive answer.
|
|
8221
8156
|
|
|
8222
8157
|
```ts
|
|
8223
|
-
export function requireConclusiveUtxo(classification: OutputUtxoClassification): boolean
|
|
8158
|
+
export function requireConclusiveUtxo(classification: OutputUtxoClassification): boolean
|
|
8224
8159
|
```
|
|
8225
8160
|
|
|
8226
8161
|
See also: [OutputUtxoClassification](./services.md#interface-outpututxoclassification)
|
|
@@ -8231,7 +8166,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8231
8166
|
##### Function: resolveDefaultChaintracksArguments
|
|
8232
8167
|
|
|
8233
8168
|
```ts
|
|
8234
|
-
export function resolveDefaultChaintracksArguments(args: DefaultChaintracksArguments): ResolvedDefaultChaintracksParams
|
|
8169
|
+
export function resolveDefaultChaintracksArguments(args: DefaultChaintracksArguments): ResolvedDefaultChaintracksParams
|
|
8235
8170
|
```
|
|
8236
8171
|
|
|
8237
8172
|
See also: [DefaultChaintracksArguments](./services.md#type-defaultchaintracksarguments), [ResolvedDefaultChaintracksParams](./services.md#interface-resolveddefaultchaintracksparams)
|
|
@@ -8242,7 +8177,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8242
8177
|
##### Function: resolveDefaultKnexChaintracksArguments
|
|
8243
8178
|
|
|
8244
8179
|
```ts
|
|
8245
|
-
export function resolveDefaultKnexChaintracksArguments(args: DefaultKnexChaintracksArguments): ResolvedDefaultKnexChaintracksParams
|
|
8180
|
+
export function resolveDefaultKnexChaintracksArguments(args: DefaultKnexChaintracksArguments): ResolvedDefaultKnexChaintracksParams
|
|
8246
8181
|
```
|
|
8247
8182
|
|
|
8248
8183
|
See also: [DefaultKnexChaintracksArguments](./services.md#type-defaultknexchaintracksarguments), [ResolvedDefaultKnexChaintracksParams](./services.md#interface-resolveddefaultknexchaintracksparams)
|
|
@@ -8255,7 +8190,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8255
8190
|
Convert an untrusted diagnostic to bounded, single-line text suitable for logs and status APIs.
|
|
8256
8191
|
|
|
8257
8192
|
```ts
|
|
8258
|
-
export function safeDiagnostic(value: unknown, maximum = 512): string
|
|
8193
|
+
export function safeDiagnostic(value: unknown, maximum = 512): string
|
|
8259
8194
|
```
|
|
8260
8195
|
|
|
8261
8196
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8264,7 +8199,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8264
8199
|
##### Function: selectBulkHeaderFiles
|
|
8265
8200
|
|
|
8266
8201
|
```ts
|
|
8267
|
-
export function selectBulkHeaderFiles(files: BulkHeaderFileInfo[], chain: Chain, maxPerFile: number): BulkHeaderFileInfo[]
|
|
8202
|
+
export function selectBulkHeaderFiles(files: BulkHeaderFileInfo[], chain: Chain, maxPerFile: number): BulkHeaderFileInfo[]
|
|
8268
8203
|
```
|
|
8269
8204
|
|
|
8270
8205
|
See also: [BulkHeaderFileInfo](./services.md#interface-bulkheaderfileinfo), [Chain](./client.md#type-chain)
|
|
@@ -8283,7 +8218,7 @@ the block hash for the header.
|
|
|
8283
8218
|
export function serializeBaseBlockHeader(header: BaseBlockHeader, buffer?: number[], offset?: number): number[] {
|
|
8284
8219
|
const validated = copyBaseHeaderData(header);
|
|
8285
8220
|
validateBaseBlockHeaderFormat(validated);
|
|
8286
|
-
const writer = new Writer();
|
|
8221
|
+
const writer = new Utils.Writer();
|
|
8287
8222
|
writer.writeUInt32LE(validated.version);
|
|
8288
8223
|
writer.write(asArray(validated.previousHash).reverse());
|
|
8289
8224
|
writer.write(asArray(validated.merkleRoot).reverse());
|
|
@@ -8318,7 +8253,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8318
8253
|
##### Function: serializeBaseBlockHeaders
|
|
8319
8254
|
|
|
8320
8255
|
```ts
|
|
8321
|
-
export function serializeBaseBlockHeaders(headers: BlockHeader[]): Uint8Array
|
|
8256
|
+
export function serializeBaseBlockHeaders(headers: BlockHeader[]): Uint8Array
|
|
8322
8257
|
```
|
|
8323
8258
|
|
|
8324
8259
|
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
@@ -8334,7 +8269,7 @@ Computes sha256 hash of file contents read as bytes with no encoding.
|
|
|
8334
8269
|
export async function sha256HashOfBinaryFile(fs: ChaintracksFsApi, filepath: string, bufferSize = 80000): Promise<{
|
|
8335
8270
|
hash: string;
|
|
8336
8271
|
length: number;
|
|
8337
|
-
}>
|
|
8272
|
+
}>
|
|
8338
8273
|
```
|
|
8339
8274
|
|
|
8340
8275
|
See also: [ChaintracksFsApi](./services.md#interface-chaintracksfsapi)
|
|
@@ -8360,7 +8295,7 @@ diagnostics. The optional legacy array mode is bounded for older custom
|
|
|
8360
8295
|
WalletServices implementations; ordinary providers return one path.
|
|
8361
8296
|
|
|
8362
8297
|
```ts
|
|
8363
|
-
export function snapshotMerklePathResult(value: unknown, allowLegacyArray = false, providerName?: string): SnapshotMerklePathResult
|
|
8298
|
+
export function snapshotMerklePathResult(value: unknown, allowLegacyArray = false, providerName?: string): SnapshotMerklePathResult
|
|
8364
8299
|
```
|
|
8365
8300
|
|
|
8366
8301
|
See also: [SnapshotMerklePathResult](./services.md#interface-snapshotmerklepathresult)
|
|
@@ -8371,7 +8306,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8371
8306
|
##### Function: snapshotPostBeefRequest
|
|
8372
8307
|
|
|
8373
8308
|
```ts
|
|
8374
|
-
export function snapshotPostBeefRequest(beef: Beef, txids: string[]): ValidatedPostBeefRequest
|
|
8309
|
+
export function snapshotPostBeefRequest(beef: Beef, txids: string[]): ValidatedPostBeefRequest
|
|
8375
8310
|
```
|
|
8376
8311
|
|
|
8377
8312
|
See also: [ValidatedPostBeefRequest](./services.md#interface-validatedpostbeefrequest)
|
|
@@ -8382,7 +8317,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8382
8317
|
##### Function: startChaintracks
|
|
8383
8318
|
|
|
8384
8319
|
```ts
|
|
8385
|
-
export function startChaintracks<TStorage extends ChaintracksOptions["storage"]>(params: ResolvedDefaultChaintracksParams, options: ChaintracksOptions): CreatedChaintracks<TStorage>
|
|
8320
|
+
export function startChaintracks<TStorage extends ChaintracksOptions["storage"]>(params: ResolvedDefaultChaintracksParams, options: ChaintracksOptions): CreatedChaintracks<TStorage>
|
|
8386
8321
|
```
|
|
8387
8322
|
|
|
8388
8323
|
See also: [ChaintracksOptions](./services.md#interface-chaintracksoptions), [CreatedChaintracks](./services.md#interface-createdchaintracks), [ResolvedDefaultChaintracksParams](./services.md#interface-resolveddefaultchaintracksparams)
|
|
@@ -8395,7 +8330,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8395
8330
|
Arcade broadcaster / ARC endpoint for stn, or `undefined` when unset.
|
|
8396
8331
|
|
|
8397
8332
|
```ts
|
|
8398
|
-
export function stnArcadeUrl(): string | undefined
|
|
8333
|
+
export function stnArcadeUrl(): string | undefined
|
|
8399
8334
|
```
|
|
8400
8335
|
|
|
8401
8336
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8407,7 +8342,7 @@ ChainTracks service URL for stn. Falls back to the configured Arcade host's
|
|
|
8407
8342
|
legacy-compatible path when STN_CHAINTRACKS_URL is unset.
|
|
8408
8343
|
|
|
8409
8344
|
```ts
|
|
8410
|
-
export function stnChaintracksUrl(): string
|
|
8345
|
+
export function stnChaintracksUrl(): string
|
|
8411
8346
|
```
|
|
8412
8347
|
|
|
8413
8348
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8418,7 +8353,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8418
8353
|
Subtract Buffer encoded chainwork values
|
|
8419
8354
|
|
|
8420
8355
|
```ts
|
|
8421
|
-
export function subWork(work1: string, work2: string): string
|
|
8356
|
+
export function subWork(work1: string, work2: string): string
|
|
8422
8357
|
```
|
|
8423
8358
|
|
|
8424
8359
|
Returns
|
|
@@ -8454,7 +8389,7 @@ the block hash for the header.
|
|
|
8454
8389
|
|
|
8455
8390
|
```ts
|
|
8456
8391
|
export function toBinaryBaseBlockHeader(header: BaseBlockHeader): number[] {
|
|
8457
|
-
const writer = new Writer();
|
|
8392
|
+
const writer = new Utils.Writer();
|
|
8458
8393
|
writer.writeUInt32LE(header.version);
|
|
8459
8394
|
writer.writeReverse(asArray(header.previousHash));
|
|
8460
8395
|
writer.writeReverse(asArray(header.merkleRoot));
|
|
@@ -8478,7 +8413,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8478
8413
|
##### Function: toDefaultChaintracksArguments
|
|
8479
8414
|
|
|
8480
8415
|
```ts
|
|
8481
|
-
export function toDefaultChaintracksArguments(params: ResolvedDefaultChaintracksParams): DefaultChaintracksArguments
|
|
8416
|
+
export function toDefaultChaintracksArguments(params: ResolvedDefaultChaintracksParams): DefaultChaintracksArguments
|
|
8482
8417
|
```
|
|
8483
8418
|
|
|
8484
8419
|
See also: [DefaultChaintracksArguments](./services.md#type-defaultchaintracksarguments), [ResolvedDefaultChaintracksParams](./services.md#interface-resolveddefaultchaintracksparams)
|
|
@@ -8489,7 +8424,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8489
8424
|
##### Function: toDefaultKnexChaintracksArguments
|
|
8490
8425
|
|
|
8491
8426
|
```ts
|
|
8492
|
-
export function toDefaultKnexChaintracksArguments(params: ResolvedDefaultKnexChaintracksParams): DefaultKnexChaintracksArguments
|
|
8427
|
+
export function toDefaultKnexChaintracksArguments(params: ResolvedDefaultKnexChaintracksParams): DefaultKnexChaintracksArguments
|
|
8493
8428
|
```
|
|
8494
8429
|
|
|
8495
8430
|
See also: [DefaultKnexChaintracksArguments](./services.md#type-defaultknexchaintracksarguments), [ResolvedDefaultKnexChaintracksParams](./services.md#interface-resolveddefaultknexchaintracksparams)
|
|
@@ -8502,7 +8437,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8502
8437
|
Arcade broadcaster / ARC endpoint for tstn, or `undefined` when `TSTN_ARCADE_URL` is unset.
|
|
8503
8438
|
|
|
8504
8439
|
```ts
|
|
8505
|
-
export function tstnArcadeUrl(): string | undefined
|
|
8440
|
+
export function tstnArcadeUrl(): string | undefined
|
|
8506
8441
|
```
|
|
8507
8442
|
|
|
8508
8443
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8514,7 +8449,7 @@ ChainTracks service URL for tstn. Falls back to `${TSTN_ARCADE_URL}/chaintracks/
|
|
|
8514
8449
|
`TSTN_CHAINTRACKS_URL` is unset (mirrors the ttn layout). Throws when neither is configured.
|
|
8515
8450
|
|
|
8516
8451
|
```ts
|
|
8517
|
-
export function tstnChaintracksUrl(): string
|
|
8452
|
+
export function tstnChaintracksUrl(): string
|
|
8518
8453
|
```
|
|
8519
8454
|
|
|
8520
8455
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8523,7 +8458,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8523
8458
|
##### Function: updateChaintracksFiatExchangeRates
|
|
8524
8459
|
|
|
8525
8460
|
```ts
|
|
8526
|
-
export async function updateChaintracksFiatExchangeRates(targetCurrencies: string[], options: WalletServicesOptions): Promise<FiatExchangeRates>
|
|
8461
|
+
export async function updateChaintracksFiatExchangeRates(targetCurrencies: string[], options: WalletServicesOptions): Promise<FiatExchangeRates>
|
|
8527
8462
|
```
|
|
8528
8463
|
|
|
8529
8464
|
See also: [FiatExchangeRates](./client.md#interface-fiatexchangerates), [WalletServicesOptions](./client.md#interface-walletservicesoptions)
|
|
@@ -8534,7 +8469,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8534
8469
|
##### Function: updateExchangeratesapi
|
|
8535
8470
|
|
|
8536
8471
|
```ts
|
|
8537
|
-
export async function updateExchangeratesapi(targetCurrencies: string[], options: WalletServicesOptions): Promise<FiatExchangeRates>
|
|
8472
|
+
export async function updateExchangeratesapi(targetCurrencies: string[], options: WalletServicesOptions): Promise<FiatExchangeRates>
|
|
8538
8473
|
```
|
|
8539
8474
|
|
|
8540
8475
|
See also: [FiatExchangeRates](./client.md#interface-fiatexchangerates), [WalletServicesOptions](./client.md#interface-walletservicesoptions)
|
|
@@ -8547,7 +8482,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8547
8482
|
Hash map of known valid bulk header files by their `fileHash`.
|
|
8548
8483
|
|
|
8549
8484
|
```ts
|
|
8550
|
-
export function validBulkHeaderFilesByFileHash(): Record<string, BulkHeaderFileInfo>
|
|
8485
|
+
export function validBulkHeaderFilesByFileHash(): Record<string, BulkHeaderFileInfo>
|
|
8551
8486
|
```
|
|
8552
8487
|
|
|
8553
8488
|
See also: [BulkHeaderFileInfo](./services.md#interface-bulkheaderfileinfo)
|
|
@@ -8564,7 +8499,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8564
8499
|
Throws Error if blockHash is in the dirtyHashes list.
|
|
8565
8500
|
|
|
8566
8501
|
```ts
|
|
8567
|
-
export function validateAgainstDirtyHashes(blockHash: string): void
|
|
8502
|
+
export function validateAgainstDirtyHashes(blockHash: string): void
|
|
8568
8503
|
```
|
|
8569
8504
|
|
|
8570
8505
|
See also: [blockHash](./services.md#function-blockhash)
|
|
@@ -8572,12 +8507,12 @@ See also: [blockHash](./services.md#function-blockhash)
|
|
|
8572
8507
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8573
8508
|
|
|
8574
8509
|
---
|
|
8575
|
-
##### Function:
|
|
8510
|
+
##### Function: validateArcadeTxData
|
|
8576
8511
|
|
|
8577
|
-
Validate and snapshot
|
|
8512
|
+
Validate and snapshot the untrusted Arcade `GET /tx/{txid}` response.
|
|
8578
8513
|
|
|
8579
8514
|
```ts
|
|
8580
|
-
export function
|
|
8515
|
+
export function validateArcadeTxData(value: unknown, expectedTxid: string, responseStatus = 200): ArcMinerGetTxData
|
|
8581
8516
|
```
|
|
8582
8517
|
|
|
8583
8518
|
See also: [ArcMinerGetTxData](./services.md#interface-arcminergettxdata)
|
|
@@ -8591,7 +8526,7 @@ Validates the exact data representation of an unpositioned 80-byte block
|
|
|
8591
8526
|
header before it reaches a chain lookup, queue, or serializer.
|
|
8592
8527
|
|
|
8593
8528
|
```ts
|
|
8594
|
-
export function validateBaseBlockHeaderFormat(header: BaseBlockHeader): void
|
|
8529
|
+
export function validateBaseBlockHeaderFormat(header: BaseBlockHeader): void
|
|
8595
8530
|
```
|
|
8596
8531
|
|
|
8597
8532
|
See also: [BaseBlockHeader](./client.md#interface-baseblockheader)
|
|
@@ -8605,12 +8540,14 @@ Validate headers contained in an array of bytes. The headers must be consecutive
|
|
|
8605
8540
|
where the hash of each header equals the previousHash of the following header.
|
|
8606
8541
|
|
|
8607
8542
|
```ts
|
|
8608
|
-
export function validateBufferOfHeaders(buffer: Uint8Array, previousHash: string, offset = 0, count = -1, previousChainWork?: string): {
|
|
8543
|
+
export function validateBufferOfHeaders(buffer: Uint8Array, previousHash: string, offset = 0, count = -1, previousChainWork?: string, chain?: Chain): {
|
|
8609
8544
|
lastHeaderHash: string;
|
|
8610
8545
|
lastChainWork: string | undefined;
|
|
8611
|
-
}
|
|
8546
|
+
}
|
|
8612
8547
|
```
|
|
8613
8548
|
|
|
8549
|
+
See also: [Chain](./client.md#type-chain)
|
|
8550
|
+
|
|
8614
8551
|
Returns
|
|
8615
8552
|
|
|
8616
8553
|
Header hash of last header validated or previousHash if there where none.
|
|
@@ -8625,6 +8562,11 @@ Argument Details
|
|
|
8625
8562
|
+ Optional starting offset within `buffer`.
|
|
8626
8563
|
+ **count**
|
|
8627
8564
|
+ Optional number of headers to validate. Validates to end of buffer if missing.
|
|
8565
|
+
+ **previousChainWork**
|
|
8566
|
+
+ Optional chain work through `previousHash`; when present, the result carries it forward.
|
|
8567
|
+
+ **chain**
|
|
8568
|
+
+ Optional chain the headers belong to. Selects its proof-of-work limit
|
|
8569
|
+
(see `proofOfWorkLimitBits`); omitted means the mainnet limit.
|
|
8628
8570
|
|
|
8629
8571
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8630
8572
|
|
|
@@ -8634,7 +8576,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8634
8576
|
Validates the contents of a bulk header file.
|
|
8635
8577
|
|
|
8636
8578
|
```ts
|
|
8637
|
-
export async function validateBulkFileData(bf: BulkHeaderFileInfo, prevHash: string, prevChainWork: string, fetch?: ChaintracksFetchApi): Promise<BulkHeaderFileInfo>
|
|
8579
|
+
export async function validateBulkFileData(bf: BulkHeaderFileInfo, prevHash: string, prevChainWork: string, fetch?: ChaintracksFetchApi): Promise<BulkHeaderFileInfo>
|
|
8638
8580
|
```
|
|
8639
8581
|
|
|
8640
8582
|
See also: [BulkHeaderFileInfo](./services.md#interface-bulkheaderfileinfo), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi)
|
|
@@ -8656,28 +8598,13 @@ Argument Details
|
|
|
8656
8598
|
|
|
8657
8599
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8658
8600
|
|
|
8659
|
-
---
|
|
8660
|
-
##### Function: validateCanonicalMerklePathResult
|
|
8661
|
-
|
|
8662
|
-
Reject proof-provider results unless at least one returned path proves the
|
|
8663
|
-
requested transaction against the active chain. Invalid paths are removed
|
|
8664
|
-
before the result is returned so a stale path cannot precede a valid one.
|
|
8665
|
-
|
|
8666
|
-
```ts
|
|
8667
|
-
export async function validateCanonicalMerklePathResult(txid: string, result: GetMerklePathResult, chaintracker: ChainTracker): Promise<void>
|
|
8668
|
-
```
|
|
8669
|
-
|
|
8670
|
-
See also: [GetMerklePathResult](./client.md#interface-getmerklepathresult)
|
|
8671
|
-
|
|
8672
|
-
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8673
|
-
|
|
8674
8601
|
---
|
|
8675
8602
|
##### Function: validateGenesisHeader
|
|
8676
8603
|
|
|
8677
8604
|
Verifies that buffer begins with valid genesis block header for the specified chain.
|
|
8678
8605
|
|
|
8679
8606
|
```ts
|
|
8680
|
-
export function validateGenesisHeader(buffer: Uint8Array, chain: Chain): void
|
|
8607
|
+
export function validateGenesisHeader(buffer: Uint8Array, chain: Chain): void
|
|
8681
8608
|
```
|
|
8682
8609
|
|
|
8683
8610
|
See also: [Chain](./client.md#type-chain)
|
|
@@ -8690,17 +8617,24 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8690
8617
|
Ensures that a header has a valid proof-of-work target and hash.
|
|
8691
8618
|
|
|
8692
8619
|
```ts
|
|
8693
|
-
export function validateHeaderDifficulty(hash: number[] | Uint8Array, bits: number)
|
|
8620
|
+
export function validateHeaderDifficulty(hash: number[] | Uint8Array, bits: number, chain?: Chain)
|
|
8694
8621
|
```
|
|
8695
8622
|
|
|
8623
|
+
See also: [Chain](./client.md#type-chain)
|
|
8624
|
+
|
|
8696
8625
|
Returns
|
|
8697
8626
|
|
|
8698
8627
|
true if the header is valid
|
|
8699
8628
|
|
|
8700
8629
|
Argument Details
|
|
8701
8630
|
|
|
8702
|
-
+ **
|
|
8703
|
-
+ The header
|
|
8631
|
+
+ **hash**
|
|
8632
|
+
+ The header hash, big-endian.
|
|
8633
|
+
+ **bits**
|
|
8634
|
+
+ The header's compact target.
|
|
8635
|
+
+ **chain**
|
|
8636
|
+
+ Optional chain the header belongs to. Selects its proof-of-work limit
|
|
8637
|
+
(see `proofOfWorkLimitBits`); omitted means the mainnet limit.
|
|
8704
8638
|
|
|
8705
8639
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8706
8640
|
|
|
@@ -8708,7 +8642,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8708
8642
|
##### Function: validateHeaderFormat
|
|
8709
8643
|
|
|
8710
8644
|
```ts
|
|
8711
|
-
export function validateHeaderFormat(header: BlockHeader): void
|
|
8645
|
+
export function validateHeaderFormat(header: BlockHeader): void
|
|
8712
8646
|
```
|
|
8713
8647
|
|
|
8714
8648
|
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
@@ -8722,13 +8656,13 @@ Ensures that a structured header's computed hash satisfies its declared
|
|
|
8722
8656
|
proof-of-work target.
|
|
8723
8657
|
|
|
8724
8658
|
```ts
|
|
8725
|
-
export function validateHeaderProofOfWork(header: BlockHeader): true {
|
|
8726
|
-
validateConsensusProofOfWork(header.hash, header.bits);
|
|
8659
|
+
export function validateHeaderProofOfWork(header: BlockHeader, chain?: Chain): true {
|
|
8660
|
+
validateConsensusProofOfWork(header.hash, header.bits, chain);
|
|
8727
8661
|
return true;
|
|
8728
8662
|
}
|
|
8729
8663
|
```
|
|
8730
8664
|
|
|
8731
|
-
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
8665
|
+
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain)
|
|
8732
8666
|
|
|
8733
8667
|
Returns
|
|
8734
8668
|
|
|
@@ -8738,6 +8672,9 @@ Argument Details
|
|
|
8738
8672
|
|
|
8739
8673
|
+ **header**
|
|
8740
8674
|
+ Header whose format and hash have already been checked.
|
|
8675
|
+
+ **chain**
|
|
8676
|
+
+ Optional chain the header belongs to. Selects its proof-of-work limit
|
|
8677
|
+
(see `proofOfWorkLimitBits`); omitted means the mainnet limit.
|
|
8741
8678
|
|
|
8742
8679
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8743
8680
|
|
|
@@ -8745,10 +8682,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8745
8682
|
##### Function: validateMerklePathResult
|
|
8746
8683
|
|
|
8747
8684
|
```ts
|
|
8748
|
-
export function validateMerklePathResult(requestedTxid: unknown, result: GetMerklePathResult, requireProofOfWork = false, requireHeaderFormat = true): ValidatedMerklePathResult
|
|
8685
|
+
export function validateMerklePathResult(requestedTxid: unknown, result: GetMerklePathResult, requireProofOfWork = false, requireHeaderFormat = true, chain?: Chain): ValidatedMerklePathResult
|
|
8749
8686
|
```
|
|
8750
8687
|
|
|
8751
|
-
See also: [GetMerklePathResult](./client.md#interface-getmerklepathresult), [ValidatedMerklePathResult](./services.md#interface-validatedmerklepathresult)
|
|
8688
|
+
See also: [Chain](./client.md#type-chain), [GetMerklePathResult](./client.md#interface-getmerklepathresult), [ValidatedMerklePathResult](./services.md#interface-validatedmerklepathresult)
|
|
8752
8689
|
|
|
8753
8690
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8754
8691
|
|
|
@@ -8756,7 +8693,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8756
8693
|
##### Function: validatePostBeefResult
|
|
8757
8694
|
|
|
8758
8695
|
```ts
|
|
8759
|
-
export function validatePostBeefResult(value: unknown, expectedTxids: string[], configuredProviderName: string, allowInternalTimeoutNote = false): PostBeefResult
|
|
8696
|
+
export function validatePostBeefResult(value: unknown, expectedTxids: string[], configuredProviderName: string, allowInternalTimeoutNote = false): PostBeefResult
|
|
8760
8697
|
```
|
|
8761
8698
|
|
|
8762
8699
|
See also: [PostBeefResult](./client.md#interface-postbeefresult)
|
|
@@ -8767,7 +8704,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8767
8704
|
##### Function: validatePostBeefResultOrServiceError
|
|
8768
8705
|
|
|
8769
8706
|
```ts
|
|
8770
|
-
export function validatePostBeefResultOrServiceError(value: unknown, expectedTxids: string[], configuredProviderName: string): PostBeefResult
|
|
8707
|
+
export function validatePostBeefResultOrServiceError(value: unknown, expectedTxids: string[], configuredProviderName: string): PostBeefResult
|
|
8771
8708
|
```
|
|
8772
8709
|
|
|
8773
8710
|
See also: [PostBeefResult](./client.md#interface-postbeefresult)
|
|
@@ -8778,7 +8715,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8778
8715
|
##### Function: validatePostTxResult
|
|
8779
8716
|
|
|
8780
8717
|
```ts
|
|
8781
|
-
export function validatePostTxResult(value: unknown, expectedTxid: string, configuredProviderName: string): PostTxResultForTxid
|
|
8718
|
+
export function validatePostTxResult(value: unknown, expectedTxid: string, configuredProviderName: string): PostTxResultForTxid
|
|
8782
8719
|
```
|
|
8783
8720
|
|
|
8784
8721
|
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
@@ -8789,7 +8726,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8789
8726
|
##### Function: validatePostTxResultOrServiceError
|
|
8790
8727
|
|
|
8791
8728
|
```ts
|
|
8792
|
-
export function validatePostTxResultOrServiceError(value: unknown, expectedTxid: string, configuredProviderName: string): PostTxResultForTxid
|
|
8729
|
+
export function validatePostTxResultOrServiceError(value: unknown, expectedTxid: string, configuredProviderName: string): PostTxResultForTxid
|
|
8793
8730
|
```
|
|
8794
8731
|
|
|
8795
8732
|
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
@@ -8802,7 +8739,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8802
8739
|
Snapshot and bind a raw-transaction provider result to its requested txid.
|
|
8803
8740
|
|
|
8804
8741
|
```ts
|
|
8805
|
-
export function validateRawTxResult(value: unknown, expectedTxid: string, providerName?: string): GetRawTxResult
|
|
8742
|
+
export function validateRawTxResult(value: unknown, expectedTxid: string, providerName?: string): GetRawTxResult
|
|
8806
8743
|
```
|
|
8807
8744
|
|
|
8808
8745
|
See also: [GetRawTxResult](./client.md#interface-getrawtxresult)
|
|
@@ -8813,7 +8750,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8813
8750
|
##### Function: validateScriptHash
|
|
8814
8751
|
|
|
8815
8752
|
```ts
|
|
8816
|
-
export function validateScriptHash(output: string, outputFormat?: GetUtxoStatusOutputFormat): string
|
|
8753
|
+
export function validateScriptHash(output: string, outputFormat?: GetUtxoStatusOutputFormat): string
|
|
8817
8754
|
```
|
|
8818
8755
|
|
|
8819
8756
|
See also: [GetUtxoStatusOutputFormat](./client.md#type-getutxostatusoutputformat)
|
|
@@ -8826,7 +8763,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8826
8763
|
Validate and own a script-history result before it contributes competing transaction IDs.
|
|
8827
8764
|
|
|
8828
8765
|
```ts
|
|
8829
|
-
export function validateScriptHashHistoryResult(value: unknown, configuredProviderName?: string): GetScriptHashHistoryResult
|
|
8766
|
+
export function validateScriptHashHistoryResult(value: unknown, configuredProviderName?: string): GetScriptHashHistoryResult
|
|
8830
8767
|
```
|
|
8831
8768
|
|
|
8832
8769
|
See also: [GetScriptHashHistoryResult](./client.md#interface-getscripthashhistoryresult)
|
|
@@ -8841,7 +8778,7 @@ can influence wallet transaction state. Provider names may be replaced with
|
|
|
8841
8778
|
a locally configured name so remote data cannot forge durable attribution.
|
|
8842
8779
|
|
|
8843
8780
|
```ts
|
|
8844
|
-
export function validateStatusForTxidsResult(value: unknown, requestedTxids: readonly string[], providerName?: string): GetStatusForTxidsResult
|
|
8781
|
+
export function validateStatusForTxidsResult(value: unknown, requestedTxids: readonly string[], providerName?: string): GetStatusForTxidsResult
|
|
8845
8782
|
```
|
|
8846
8783
|
|
|
8847
8784
|
See also: [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresult)
|
|
@@ -8854,7 +8791,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8854
8791
|
Validate, bind, and own a UTXO-oracle result before wallet state uses it.
|
|
8855
8792
|
|
|
8856
8793
|
```ts
|
|
8857
|
-
export function validateUtxoStatusResult(value: unknown, expectedOutpoint?: string, configuredProviderName?: string): GetUtxoStatusResult
|
|
8794
|
+
export function validateUtxoStatusResult(value: unknown, expectedOutpoint?: string, configuredProviderName?: string): GetUtxoStatusResult
|
|
8858
8795
|
```
|
|
8859
8796
|
|
|
8860
8797
|
See also: [GetUtxoStatusResult](./client.md#interface-getutxostatusresult)
|
|
@@ -8865,7 +8802,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8865
8802
|
##### Function: validateWocChainInfo
|
|
8866
8803
|
|
|
8867
8804
|
```ts
|
|
8868
|
-
export function validateWocChainInfo(value: unknown, expectedChain: Chain): WocChainInfo
|
|
8805
|
+
export function validateWocChainInfo(value: unknown, expectedChain: Chain): WocChainInfo
|
|
8869
8806
|
```
|
|
8870
8807
|
|
|
8871
8808
|
See also: [Chain](./client.md#type-chain), [WocChainInfo](./services.md#interface-wocchaininfo)
|
|
@@ -8876,7 +8813,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8876
8813
|
##### Function: wocGetHeadersHeaderToBlockHeader
|
|
8877
8814
|
|
|
8878
8815
|
```ts
|
|
8879
|
-
export function wocGetHeadersHeaderToBlockHeader(h: WocGetHeadersHeader): BlockHeader
|
|
8816
|
+
export function wocGetHeadersHeaderToBlockHeader(h: WocGetHeadersHeader): BlockHeader
|
|
8880
8817
|
```
|
|
8881
8818
|
|
|
8882
8819
|
See also: [BlockHeader](./client.md#interface-blockheader), [WocGetHeadersHeader](./services.md#interface-wocgetheadersheader)
|
|
@@ -8887,7 +8824,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8887
8824
|
##### Function: workBNtoBuffer
|
|
8888
8825
|
|
|
8889
8826
|
```ts
|
|
8890
|
-
export function workBNtoBuffer(work: BigNumber): string
|
|
8827
|
+
export function workBNtoBuffer(work: BigNumber): string
|
|
8891
8828
|
```
|
|
8892
8829
|
|
|
8893
8830
|
Returns
|
|
@@ -8905,7 +8842,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8905
8842
|
##### Function: writeUInt32BE
|
|
8906
8843
|
|
|
8907
8844
|
```ts
|
|
8908
|
-
export function writeUInt32BE(n: number, a: number[] | Uint8Array, offset: number): number
|
|
8845
|
+
export function writeUInt32BE(n: number, a: number[] | Uint8Array, offset: number): number
|
|
8909
8846
|
```
|
|
8910
8847
|
|
|
8911
8848
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8914,7 +8851,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8914
8851
|
##### Function: writeUInt32LE
|
|
8915
8852
|
|
|
8916
8853
|
```ts
|
|
8917
|
-
export function writeUInt32LE(n: number, a: number[] | Uint8Array, offset: number): number
|
|
8854
|
+
export function writeUInt32LE(n: number, a: number[] | Uint8Array, offset: number): number
|
|
8918
8855
|
```
|
|
8919
8856
|
|
|
8920
8857
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -9179,7 +9116,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
9179
9116
|
##### Variable: MAX_POST_BEEF_TXIDS
|
|
9180
9117
|
|
|
9181
9118
|
```ts
|
|
9182
|
-
MAX_POST_BEEF_TXIDS = MAXIMUM_SEND_WITH_TRANSACTIONS
|
|
9119
|
+
MAX_POST_BEEF_TXIDS = Validation.MAXIMUM_SEND_WITH_TRANSACTIONS
|
|
9183
9120
|
```
|
|
9184
9121
|
|
|
9185
9122
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|