@bopen-io/wallet-toolbox 2.14.5 → 2.15.0-bopen.1
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 +47 -2
- package/README.md +73 -7
- package/docs/client.md +3020 -2729
- package/docs/monitor.md +164 -153
- package/docs/services.md +856 -710
- package/docs/setup.md +46 -1
- package/docs/storage.md +1654 -1636
- package/docs/wallet.md +2090 -1842
- package/out/src/Setup.d.ts +10 -0
- package/out/src/Setup.d.ts.map +1 -1
- package/out/src/Setup.js +24 -0
- package/out/src/Setup.js.map +1 -1
- package/out/src/monitor/MonitorDaemon.d.ts +2 -0
- package/out/src/monitor/MonitorDaemon.d.ts.map +1 -1
- package/out/src/monitor/MonitorDaemon.js +9 -1
- package/out/src/monitor/MonitorDaemon.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.d.ts +5 -0
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.js +11 -3
- package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageKnex.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts +3 -0
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +115 -207
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/adminServer/adminServer.d.ts.map +1 -1
- package/out/src/storage/adminServer/adminServer.js +3 -41
- package/out/src/storage/adminServer/adminServer.js.map +1 -1
- package/out/src/storage/adminServer/reqReviewQuery.d.ts +41 -0
- package/out/src/storage/adminServer/reqReviewQuery.d.ts.map +1 -0
- package/out/src/storage/adminServer/reqReviewQuery.js +67 -0
- package/out/src/storage/adminServer/reqReviewQuery.js.map +1 -0
- package/out/src/storage/index.all.d.ts +1 -0
- package/out/src/storage/index.all.d.ts.map +1 -1
- package/out/src/storage/index.all.js +1 -0
- package/out/src/storage/index.all.js.map +1 -1
- package/out/src/storage/knexPostgres.d.ts +16 -0
- package/out/src/storage/knexPostgres.d.ts.map +1 -0
- package/out/src/storage/knexPostgres.js +34 -0
- package/out/src/storage/knexPostgres.js.map +1 -0
- package/out/src/storage/methods/listActionsKnex.d.ts.map +1 -1
- package/out/src/storage/methods/listActionsKnex.js +0 -1
- 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 +0 -1
- package/out/src/storage/methods/listOutputsKnex.js.map +1 -1
- package/out/src/storage/methods/purgeData.d.ts.map +1 -1
- package/out/src/storage/methods/purgeData.js +0 -3
- 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 +0 -3
- package/out/src/storage/methods/reviewStatus.js.map +1 -1
- package/out/src/storage/portable/index.js +38 -12
- package/out/src/storage/portable/index.js.map +1 -1
- package/out/src/storage/remoting/StorageServer.d.ts +17 -4
- package/out/src/storage/remoting/StorageServer.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageServer.js +22 -13
- package/out/src/storage/remoting/StorageServer.js.map +1 -1
- package/out/src/storage/schema/KnexMigrations.d.ts +7 -2
- package/out/src/storage/schema/KnexMigrations.d.ts.map +1 -1
- package/out/src/storage/schema/KnexMigrations.js +162 -60
- package/out/src/storage/schema/KnexMigrations.js.map +1 -1
- package/package.json +5 -4
package/docs/services.md
CHANGED
|
@@ -1537,6 +1537,7 @@ Chaintracks client API excluding events and callbacks
|
|
|
1537
1537
|
|
|
1538
1538
|
```ts
|
|
1539
1539
|
export interface ChaintracksClientApi extends ChainTracker {
|
|
1540
|
+
readonly supportsReorgEvents?: boolean;
|
|
1540
1541
|
getChain(): Promise<Chain>;
|
|
1541
1542
|
getInfo(): Promise<ChaintracksInfoApi>;
|
|
1542
1543
|
getPresentHeight(): Promise<number>;
|
|
@@ -1560,6 +1561,17 @@ export interface ChaintracksClientApi extends ChainTracker {
|
|
|
1560
1561
|
|
|
1561
1562
|
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)
|
|
1562
1563
|
|
|
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
|
+
|
|
1563
1575
|
###### Method addHeader
|
|
1564
1576
|
|
|
1565
1577
|
Submit a possibly new header for adding
|
|
@@ -2185,6 +2197,7 @@ export interface ChaintracksServiceOptions {
|
|
|
2185
2197
|
http?: Partial<HttpServerPolicyDefaults>;
|
|
2186
2198
|
maxRequestsPerMinute?: number;
|
|
2187
2199
|
maxHeaderSubmissionsPerMinute?: number;
|
|
2200
|
+
trustProxy?: boolean | number | string | string[];
|
|
2188
2201
|
maxHeadersPerRequest?: number;
|
|
2189
2202
|
maxWaitMsecs?: number;
|
|
2190
2203
|
logRequests?: boolean;
|
|
@@ -2220,7 +2233,7 @@ logRequests?: boolean
|
|
|
2220
2233
|
|
|
2221
2234
|
###### Property maxHeaderSubmissionsPerMinute
|
|
2222
2235
|
|
|
2223
|
-
|
|
2236
|
+
Header submissions allowed per client address per minute. Defaults to 120.
|
|
2224
2237
|
|
|
2225
2238
|
```ts
|
|
2226
2239
|
maxHeaderSubmissionsPerMinute?: number
|
|
@@ -2236,7 +2249,7 @@ maxHeadersPerRequest?: number
|
|
|
2236
2249
|
|
|
2237
2250
|
###### Property maxRequestsPerMinute
|
|
2238
2251
|
|
|
2239
|
-
|
|
2252
|
+
Request starts allowed per client address per minute. Defaults to 3,000.
|
|
2240
2253
|
|
|
2241
2254
|
```ts
|
|
2242
2255
|
maxRequestsPerMinute?: number
|
|
@@ -2258,6 +2271,14 @@ prepended to the path of each registered service endpoint
|
|
|
2258
2271
|
routingPrefix: string
|
|
2259
2272
|
```
|
|
2260
2273
|
|
|
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
|
+
|
|
2261
2282
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2262
2283
|
|
|
2263
2284
|
---
|
|
@@ -4187,25 +4208,25 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4187
4208
|
|
|
4188
4209
|
| | | |
|
|
4189
4210
|
| --- | --- | --- |
|
|
4190
|
-
| [ARC](#class-arc) | [BulkIngestorChaintracks](#class-bulkingestorchaintracks) | [
|
|
4191
|
-
| [ArcSSEClient](#class-arcsseclient) | [BulkIngestorWhatsOnChainCdn](#class-bulkingestorwhatsonchaincdn) | [
|
|
4192
|
-
| [Arcade](#class-arcade) | [BulkIngestorWhatsOnChainWs](#class-bulkingestorwhatsonchainws) | [
|
|
4193
|
-
| [BHServiceClient](#class-bhserviceclient) | [BulkStorageBase](#class-bulkstoragebase) | [
|
|
4194
|
-
| [Bitails](#class-bitails) | [Chaintracks](#class-chaintracks) | [
|
|
4195
|
-
| [BulkFileDataCacheFs](#class-bulkfiledatacachefs) | [ChaintracksAppendableFile](#class-chaintracksappendablefile) | [
|
|
4196
|
-
| [BulkFileDataManager](#class-bulkfiledatamanager) | [ChaintracksChainTracker](#class-chaintrackschaintracker) | [
|
|
4197
|
-
| [BulkFileDataReader](#class-bulkfiledatareader) | [ChaintracksFetch](#class-chaintracksfetch) | [
|
|
4198
|
-
| [BulkFileDataValidationError](#class-bulkfiledatavalidationerror) | [ChaintracksFetchError](#class-chaintracksfetcherror) | [
|
|
4199
|
-
| [BulkFilesReader](#class-bulkfilesreader) | [ChaintracksFsStatics](#class-chaintracksfsstatics) | [
|
|
4200
|
-
| [BulkFilesReaderFs](#class-bulkfilesreaderfs) | [ChaintracksKnexMigrations](#class-chaintracksknexmigrations) | [
|
|
4201
|
-
| [BulkFilesReaderStorage](#class-bulkfilesreaderstorage) | [
|
|
4202
|
-
| [BulkHeaderFile](#class-bulkheaderfile) | [
|
|
4203
|
-
| [BulkHeaderFileFs](#class-bulkheaderfilefs) | [
|
|
4204
|
-
| [BulkHeaderFileStorage](#class-bulkheaderfilestorage) | [
|
|
4205
|
-
| [BulkHeaderFiles](#class-bulkheaderfiles) | [
|
|
4206
|
-
| [BulkIngestorBase](#class-bulkingestorbase) | [
|
|
4207
|
-
| [BulkIngestorCDN](#class-bulkingestorcdn) | [
|
|
4208
|
-
| [BulkIngestorCDNBabbage](#class-bulkingestorcdnbabbage) | [
|
|
4211
|
+
| [ARC](#class-arc) | [BulkIngestorChaintracks](#class-bulkingestorchaintracks) | [ChaintracksWritableFile](#class-chaintrackswritablefile) |
|
|
4212
|
+
| [ArcSSEClient](#class-arcsseclient) | [BulkIngestorWhatsOnChainCdn](#class-bulkingestorwhatsonchaincdn) | [DurableFileBulkFileDownloadBudget](#class-durablefilebulkfiledownloadbudget) |
|
|
4213
|
+
| [Arcade](#class-arcade) | [BulkIngestorWhatsOnChainWs](#class-bulkingestorwhatsonchainws) | [FixedWindowBulkFileDownloadBudget](#class-fixedwindowbulkfiledownloadbudget) |
|
|
4214
|
+
| [BHServiceClient](#class-bhserviceclient) | [BulkStorageBase](#class-bulkstoragebase) | [GoChaintracksServiceClient](#class-gochaintracksserviceclient) |
|
|
4215
|
+
| [Bitails](#class-bitails) | [Chaintracks](#class-chaintracks) | [HeightRange](#class-heightrange) |
|
|
4216
|
+
| [BulkFileDataCacheFs](#class-bulkfiledatacachefs) | [ChaintracksAppendableFile](#class-chaintracksappendablefile) | [InlineBulkFileDataValidator](#class-inlinebulkfiledatavalidator) |
|
|
4217
|
+
| [BulkFileDataManager](#class-bulkfiledatamanager) | [ChaintracksChainTracker](#class-chaintrackschaintracker) | [LiveIngestorBase](#class-liveingestorbase) |
|
|
4218
|
+
| [BulkFileDataReader](#class-bulkfiledatareader) | [ChaintracksFetch](#class-chaintracksfetch) | [LiveIngestorChaintracksSSE](#class-liveingestorchaintrackssse) |
|
|
4219
|
+
| [BulkFileDataValidationError](#class-bulkfiledatavalidationerror) | [ChaintracksFetchError](#class-chaintracksfetcherror) | [LiveIngestorWhatsOnChainPoll](#class-liveingestorwhatsonchainpoll) |
|
|
4220
|
+
| [BulkFilesReader](#class-bulkfilesreader) | [ChaintracksFsStatics](#class-chaintracksfsstatics) | [LiveIngestorWhatsOnChainWs](#class-liveingestorwhatsonchainws) |
|
|
4221
|
+
| [BulkFilesReaderFs](#class-bulkfilesreaderfs) | [ChaintracksKnexMigrations](#class-chaintracksknexmigrations) | [LocalChainTracker](#class-localchaintracker) |
|
|
4222
|
+
| [BulkFilesReaderStorage](#class-bulkfilesreaderstorage) | [ChaintracksQueueCapacityError](#class-chaintracksqueuecapacityerror) | [NodeBulkFileDataValidator](#class-nodebulkfiledatavalidator) |
|
|
4223
|
+
| [BulkHeaderFile](#class-bulkheaderfile) | [ChaintracksReadableFile](#class-chaintracksreadablefile) | [SdkWhatsOnChain](#class-sdkwhatsonchain) |
|
|
4224
|
+
| [BulkHeaderFileFs](#class-bulkheaderfilefs) | [ChaintracksService](#class-chaintracksservice) | [ServiceCollection](#class-servicecollection) |
|
|
4225
|
+
| [BulkHeaderFileStorage](#class-bulkheaderfilestorage) | [ChaintracksServiceClient](#class-chaintracksserviceclient) | [Services](#class-services) |
|
|
4226
|
+
| [BulkHeaderFiles](#class-bulkheaderfiles) | [ChaintracksStorageBase](#class-chaintracksstoragebase) | [SingleWriterMultiReaderLock](#class-singlewritermultireaderlock) |
|
|
4227
|
+
| [BulkIngestorBase](#class-bulkingestorbase) | [ChaintracksStorageIdb](#class-chaintracksstorageidb) | [WhatsOnChain](#class-whatsonchain) |
|
|
4228
|
+
| [BulkIngestorCDN](#class-bulkingestorcdn) | [ChaintracksStorageKnex](#class-chaintracksstorageknex) | [WhatsOnChainNoServices](#class-whatsonchainnoservices) |
|
|
4229
|
+
| [BulkIngestorCDNBabbage](#class-bulkingestorcdnbabbage) | [ChaintracksStorageNoDb](#class-chaintracksstoragenodb) | [WhatsOnChainServices](#class-whatsonchainservices) |
|
|
4209
4230
|
|
|
4210
4231
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4211
4232
|
|
|
@@ -4226,10 +4247,10 @@ export class ARC {
|
|
|
4226
4247
|
readonly headers: Record<string, string> | undefined;
|
|
4227
4248
|
constructor(URL: string, config?: ArcConfig, name?: string);
|
|
4228
4249
|
constructor(URL: string, apiKey?: string, name?: string);
|
|
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>
|
|
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>
|
|
4233
4254
|
}
|
|
4234
4255
|
```
|
|
4235
4256
|
|
|
@@ -4271,7 +4292,7 @@ Argument Details
|
|
|
4271
4292
|
This seems to only work for recently submitted txids...but that's all we need to complete postBeef!
|
|
4272
4293
|
|
|
4273
4294
|
```ts
|
|
4274
|
-
async getTxData(txid: string): Promise<ArcMinerGetTxData>
|
|
4295
|
+
async getTxData(txid: string): Promise<ArcMinerGetTxData>
|
|
4275
4296
|
```
|
|
4276
4297
|
See also: [ArcMinerGetTxData](./services.md#interface-arcminergettxdata)
|
|
4277
4298
|
|
|
@@ -4283,7 +4304,7 @@ It does process multiple new transactions, however, which allows results for all
|
|
|
4283
4304
|
to be collected by the `/v1/tx/${txid}` endpoint.
|
|
4284
4305
|
|
|
4285
4306
|
```ts
|
|
4286
|
-
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
4307
|
+
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
4287
4308
|
```
|
|
4288
4309
|
See also: [PostBeefResult](./client.md#interface-postbeefresult)
|
|
4289
4310
|
|
|
@@ -4298,7 +4319,7 @@ The ARC '/v1/tx' endpoint, as of 2025-02-17 DOES NOT support the following hex s
|
|
|
4298
4319
|
1. V2 serialized Beef
|
|
4299
4320
|
|
|
4300
4321
|
```ts
|
|
4301
|
-
async postRawTx(rawTx: HexString, txids?: string[]): Promise<PostTxResultForTxid>
|
|
4322
|
+
async postRawTx(rawTx: HexString, txids?: string[]): Promise<PostTxResultForTxid>
|
|
4302
4323
|
```
|
|
4303
4324
|
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
4304
4325
|
|
|
@@ -4309,11 +4330,11 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4309
4330
|
|
|
4310
4331
|
```ts
|
|
4311
4332
|
export class ArcSSEClient {
|
|
4312
|
-
constructor(options: ArcSSEClientOptions)
|
|
4313
|
-
get lastEventId(): string | undefined
|
|
4314
|
-
connect(): void
|
|
4315
|
-
close(): void
|
|
4316
|
-
async fetchEvents(): Promise<number>
|
|
4333
|
+
constructor(options: ArcSSEClientOptions)
|
|
4334
|
+
get lastEventId(): string | undefined
|
|
4335
|
+
connect(): void
|
|
4336
|
+
close(): void
|
|
4337
|
+
async fetchEvents(): Promise<number>
|
|
4317
4338
|
}
|
|
4318
4339
|
```
|
|
4319
4340
|
|
|
@@ -4324,7 +4345,7 @@ See also: [ArcSSEClientOptions](./services.md#interface-arcsseclientoptions)
|
|
|
4324
4345
|
Close the connection, discard unacknowledged network events, and reset lifecycle state.
|
|
4325
4346
|
|
|
4326
4347
|
```ts
|
|
4327
|
-
close(): void
|
|
4348
|
+
close(): void
|
|
4328
4349
|
```
|
|
4329
4350
|
|
|
4330
4351
|
###### Method connect
|
|
@@ -4332,7 +4353,7 @@ close(): void
|
|
|
4332
4353
|
Open the SSE connection. Events are processed serially in exact arrival order.
|
|
4333
4354
|
|
|
4334
4355
|
```ts
|
|
4335
|
-
connect(): void
|
|
4356
|
+
connect(): void
|
|
4336
4357
|
```
|
|
4337
4358
|
|
|
4338
4359
|
###### Method fetchEvents
|
|
@@ -4340,7 +4361,7 @@ connect(): void
|
|
|
4340
4361
|
Ensure a connection is open; events still commit asynchronously in arrival order.
|
|
4341
4362
|
|
|
4342
4363
|
```ts
|
|
4343
|
-
async fetchEvents(): Promise<number>
|
|
4364
|
+
async fetchEvents(): Promise<number>
|
|
4344
4365
|
```
|
|
4345
4366
|
|
|
4346
4367
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -4359,12 +4380,12 @@ export class Arcade {
|
|
|
4359
4380
|
readonly headers: Record<string, string> | undefined;
|
|
4360
4381
|
constructor(URL: string, config?: ArcConfig, name?: string);
|
|
4361
4382
|
constructor(URL: string, apiKey?: string, name?: string);
|
|
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>
|
|
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>
|
|
4368
4389
|
}
|
|
4369
4390
|
```
|
|
4370
4391
|
|
|
@@ -4392,7 +4413,7 @@ states remain unknown, while MINED/IMMUTABLE are authoritative mined
|
|
|
4392
4413
|
observations whose proof is validated separately.
|
|
4393
4414
|
|
|
4394
4415
|
```ts
|
|
4395
|
-
async getStatusForTxids(txids: string[]): Promise<GetStatusForTxidsResult>
|
|
4416
|
+
async getStatusForTxids(txids: string[]): Promise<GetStatusForTxidsResult>
|
|
4396
4417
|
```
|
|
4397
4418
|
See also: [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresult)
|
|
4398
4419
|
|
|
@@ -4401,7 +4422,7 @@ See also: [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresul
|
|
|
4401
4422
|
Look up a transaction's current status (and merkle path once mined) via `GET /tx/{txid}`.
|
|
4402
4423
|
|
|
4403
4424
|
```ts
|
|
4404
|
-
async getTxData(txid: string): Promise<ArcMinerGetTxData>
|
|
4425
|
+
async getTxData(txid: string): Promise<ArcMinerGetTxData>
|
|
4405
4426
|
```
|
|
4406
4427
|
See also: [ArcMinerGetTxData](./services.md#interface-arcminergettxdata)
|
|
4407
4428
|
|
|
@@ -4413,7 +4434,7 @@ Submit a single transaction to Arcade's `POST /tx` endpoint.
|
|
|
4413
4434
|
txid is taken from `txids` when supplied (Arcade derives the same txid from the parsed tx).
|
|
4414
4435
|
|
|
4415
4436
|
```ts
|
|
4416
|
-
async postRawTx(rawTx: HexString, txids?: string[]): Promise<PostTxResultForTxid>
|
|
4437
|
+
async postRawTx(rawTx: HexString, txids?: string[]): Promise<PostTxResultForTxid>
|
|
4417
4438
|
```
|
|
4418
4439
|
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
4419
4440
|
|
|
@@ -4424,42 +4445,51 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4424
4445
|
|
|
4425
4446
|
```ts
|
|
4426
4447
|
export class BHServiceClient implements ChaintracksClientApi {
|
|
4448
|
+
readonly supportsReorgEvents = false;
|
|
4427
4449
|
bhs: BlockHeadersService;
|
|
4428
4450
|
cache: Record<number, string>;
|
|
4429
4451
|
chain: Chain;
|
|
4430
4452
|
serviceUrl: string;
|
|
4431
4453
|
options: ChaintracksServiceClientOptions;
|
|
4432
4454
|
apiKey: string;
|
|
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>
|
|
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>
|
|
4458
4480
|
}
|
|
4459
4481
|
```
|
|
4460
4482
|
|
|
4461
4483
|
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)
|
|
4462
4484
|
|
|
4485
|
+
###### Property supportsReorgEvents
|
|
4486
|
+
|
|
4487
|
+
HTTP polling client; callback event methods are legacy unsupported stubs.
|
|
4488
|
+
|
|
4489
|
+
```ts
|
|
4490
|
+
readonly supportsReorgEvents = false
|
|
4491
|
+
```
|
|
4492
|
+
|
|
4463
4493
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4464
4494
|
|
|
4465
4495
|
---
|
|
@@ -4472,11 +4502,11 @@ export class Bitails {
|
|
|
4472
4502
|
readonly URL: string;
|
|
4473
4503
|
readonly httpClient: HttpClient;
|
|
4474
4504
|
readonly requestTimeoutMsecs: number;
|
|
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>
|
|
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>
|
|
4480
4510
|
}
|
|
4481
4511
|
```
|
|
4482
4512
|
|
|
@@ -4489,14 +4519,14 @@ Bitails does not natively support a postBeef end-point aware of multiple txids o
|
|
|
4489
4519
|
Send rawTx in `txids` order from beef.
|
|
4490
4520
|
|
|
4491
4521
|
```ts
|
|
4492
|
-
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
4522
|
+
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
4493
4523
|
```
|
|
4494
4524
|
See also: [PostBeefResult](./client.md#interface-postbeefresult)
|
|
4495
4525
|
|
|
4496
4526
|
###### Method postRaws
|
|
4497
4527
|
|
|
4498
4528
|
```ts
|
|
4499
|
-
async postRaws(raws: HexString[], txids?: string[]): Promise<PostBeefResult>
|
|
4529
|
+
async postRaws(raws: HexString[], txids?: string[]): Promise<PostBeefResult>
|
|
4500
4530
|
```
|
|
4501
4531
|
See also: [PostBeefResult](./client.md#interface-postbeefresult)
|
|
4502
4532
|
|
|
@@ -4520,12 +4550,12 @@ byte length and SHA-256 digest.
|
|
|
4520
4550
|
|
|
4521
4551
|
```ts
|
|
4522
4552
|
export class BulkFileDataCacheFs implements BulkFileDataCacheApi {
|
|
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>
|
|
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>
|
|
4529
4559
|
}
|
|
4530
4560
|
```
|
|
4531
4561
|
|
|
@@ -4546,7 +4576,7 @@ subject to the optional `maxRetained` limit.
|
|
|
4546
4576
|
|
|
4547
4577
|
```ts
|
|
4548
4578
|
export class BulkFileDataManager {
|
|
4549
|
-
static createDefaultOptions(chain: Chain): BulkFileDataManagerOptions
|
|
4579
|
+
static createDefaultOptions(chain: Chain): BulkFileDataManagerOptions
|
|
4550
4580
|
readonly chain: Chain;
|
|
4551
4581
|
readonly maxPerFile: number;
|
|
4552
4582
|
readonly fetch?: ChaintracksFetchApi;
|
|
@@ -4556,29 +4586,29 @@ export class BulkFileDataManager {
|
|
|
4556
4586
|
readonly downloadBudget?: BulkFileDownloadBudgetApi;
|
|
4557
4587
|
readonly validator: BulkFileDataValidatorApi;
|
|
4558
4588
|
readonly failedLoadRetryMsecs: number;
|
|
4559
|
-
constructor(options: BulkFileDataManagerOptions | Chain)
|
|
4560
|
-
getStats(): BulkFileDataManagerStats
|
|
4561
|
-
async deleteBulkFiles(): Promise<void>
|
|
4562
|
-
async setStorage(storage: ChaintracksStorageBulkFileApi, log: (...args: any[]) => void): Promise<void>
|
|
4589
|
+
constructor(options: BulkFileDataManagerOptions | Chain)
|
|
4590
|
+
getStats(): BulkFileDataManagerStats
|
|
4591
|
+
async deleteBulkFiles(): Promise<void>
|
|
4592
|
+
async setStorage(storage: ChaintracksStorageBulkFileApi, log: (...args: any[]) => void): Promise<void>
|
|
4563
4593
|
heightRangesFromBulkFiles(files: BulkHeaderFileInfo[]): {
|
|
4564
4594
|
all: HeightRange;
|
|
4565
4595
|
cdn: HeightRange;
|
|
4566
4596
|
incremental: HeightRange;
|
|
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>
|
|
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>
|
|
4582
4612
|
}
|
|
4583
4613
|
```
|
|
4584
4614
|
|
|
@@ -4593,7 +4623,7 @@ Synchronizes bfds and storage files, after which this manager maintains sync.
|
|
|
4593
4623
|
There should be no changes to bulk files by direct access to storage bulk file methods.
|
|
4594
4624
|
|
|
4595
4625
|
```ts
|
|
4596
|
-
async setStorage(storage: ChaintracksStorageBulkFileApi, log: (...args: any[]) => void): Promise<void>
|
|
4626
|
+
async setStorage(storage: ChaintracksStorageBulkFileApi, log: (...args: any[]) => void): Promise<void>
|
|
4597
4627
|
```
|
|
4598
4628
|
See also: [ChaintracksStorageBulkFileApi](./services.md#interface-chaintracksstoragebulkfileapi)
|
|
4599
4629
|
|
|
@@ -4608,8 +4638,8 @@ export class BulkFileDataReader {
|
|
|
4608
4638
|
readonly range: HeightRange;
|
|
4609
4639
|
readonly maxBufferSize: number;
|
|
4610
4640
|
nextHeight: number;
|
|
4611
|
-
constructor(manager: BulkFileDataManager, range: HeightRange, maxBufferSize: number)
|
|
4612
|
-
async read(): Promise<Uint8Array | undefined>
|
|
4641
|
+
constructor(manager: BulkFileDataManager, range: HeightRange, maxBufferSize: number)
|
|
4642
|
+
async read(): Promise<Uint8Array | undefined>
|
|
4613
4643
|
}
|
|
4614
4644
|
```
|
|
4615
4645
|
|
|
@@ -4618,7 +4648,7 @@ See also: [BulkFileDataManager](./services.md#class-bulkfiledatamanager), [Heigh
|
|
|
4618
4648
|
###### Method read
|
|
4619
4649
|
|
|
4620
4650
|
```ts
|
|
4621
|
-
async read(): Promise<Uint8Array | undefined>
|
|
4651
|
+
async read(): Promise<Uint8Array | undefined>
|
|
4622
4652
|
```
|
|
4623
4653
|
|
|
4624
4654
|
Returns
|
|
@@ -4637,7 +4667,7 @@ a replacement that cannot be validated.
|
|
|
4637
4667
|
|
|
4638
4668
|
```ts
|
|
4639
4669
|
export class BulkFileDataValidationError extends Error {
|
|
4640
|
-
constructor(message: string, public readonly data?: Uint8Array)
|
|
4670
|
+
constructor(message: string, public readonly data?: Uint8Array)
|
|
4641
4671
|
}
|
|
4642
4672
|
```
|
|
4643
4673
|
|
|
@@ -4655,18 +4685,18 @@ export class BulkFilesReader {
|
|
|
4655
4685
|
range: HeightRange;
|
|
4656
4686
|
maxBufferSize = 400 * 80;
|
|
4657
4687
|
nextHeight: number | undefined;
|
|
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>
|
|
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>
|
|
4670
4700
|
}
|
|
4671
4701
|
```
|
|
4672
4702
|
|
|
@@ -4709,7 +4739,7 @@ See also: [HeightRange](./services.md#class-heightrange)
|
|
|
4709
4739
|
###### Method read
|
|
4710
4740
|
|
|
4711
4741
|
```ts
|
|
4712
|
-
async read(): Promise<Uint8Array | undefined>
|
|
4742
|
+
async read(): Promise<Uint8Array | undefined>
|
|
4713
4743
|
```
|
|
4714
4744
|
|
|
4715
4745
|
Returns
|
|
@@ -4721,7 +4751,7 @@ an array containing the next `maxBufferSize` bytes of headers from the files.
|
|
|
4721
4751
|
Reset the reading process and adjust the range to be read to a new subset of what's available...
|
|
4722
4752
|
|
|
4723
4753
|
```ts
|
|
4724
|
-
resetRange(range: HeightRange, maxBufferSize?: number)
|
|
4754
|
+
resetRange(range: HeightRange, maxBufferSize?: number)
|
|
4725
4755
|
```
|
|
4726
4756
|
See also: [HeightRange](./services.md#class-heightrange)
|
|
4727
4757
|
|
|
@@ -4739,10 +4769,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4739
4769
|
|
|
4740
4770
|
```ts
|
|
4741
4771
|
export class BulkFilesReaderFs extends BulkFilesReader {
|
|
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>
|
|
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>
|
|
4746
4776
|
}
|
|
4747
4777
|
```
|
|
4748
4778
|
|
|
@@ -4753,7 +4783,7 @@ See also: [BulkFilesReader](./services.md#class-bulkfilesreader), [BulkHeaderFil
|
|
|
4753
4783
|
Return a BulkFilesReader configured to access the intersection of `range` and available headers.
|
|
4754
4784
|
|
|
4755
4785
|
```ts
|
|
4756
|
-
static async fromFs(fs: ChaintracksFsApi, rootFolder: string, jsonFilename: string, range?: HeightRange, maxBufferSize?: number): Promise<BulkFilesReaderFs>
|
|
4786
|
+
static async fromFs(fs: ChaintracksFsApi, rootFolder: string, jsonFilename: string, range?: HeightRange, maxBufferSize?: number): Promise<BulkFilesReaderFs>
|
|
4757
4787
|
```
|
|
4758
4788
|
See also: [BulkFilesReaderFs](./services.md#class-bulkfilesreaderfs), [ChaintracksFsApi](./services.md#interface-chaintracksfsapi), [HeightRange](./services.md#class-heightrange)
|
|
4759
4789
|
|
|
@@ -4764,8 +4794,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4764
4794
|
|
|
4765
4795
|
```ts
|
|
4766
4796
|
export class BulkFilesReaderStorage extends BulkFilesReader {
|
|
4767
|
-
constructor(storage: ChaintracksStorageBase, files: BulkHeaderFileStorage[], range?: HeightRange, maxBufferSize?: number)
|
|
4768
|
-
static async fromStorage(storage: ChaintracksStorageBase, fetch?: ChaintracksFetchApi, range?: HeightRange, maxBufferSize?: number): Promise<BulkFilesReaderStorage>
|
|
4797
|
+
constructor(storage: ChaintracksStorageBase, files: BulkHeaderFileStorage[], range?: HeightRange, maxBufferSize?: number)
|
|
4798
|
+
static async fromStorage(storage: ChaintracksStorageBase, fetch?: ChaintracksFetchApi, range?: HeightRange, maxBufferSize?: number): Promise<BulkFilesReaderStorage>
|
|
4769
4799
|
}
|
|
4770
4800
|
```
|
|
4771
4801
|
|
|
@@ -4791,15 +4821,15 @@ export abstract class BulkHeaderFile implements BulkHeaderFileInfo {
|
|
|
4791
4821
|
prevHash: string;
|
|
4792
4822
|
sourceUrl?: string;
|
|
4793
4823
|
validated?: boolean;
|
|
4794
|
-
constructor(info: BulkHeaderFileInfo)
|
|
4824
|
+
constructor(info: BulkHeaderFileInfo)
|
|
4795
4825
|
abstract readDataFromFile(length: number, offset: number): Promise<Uint8Array | undefined>;
|
|
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
|
|
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
|
|
4803
4833
|
}
|
|
4804
4834
|
```
|
|
4805
4835
|
|
|
@@ -4810,7 +4840,7 @@ See also: [BulkHeaderFileInfo](./services.md#interface-bulkheaderfileinfo), [Cha
|
|
|
4810
4840
|
Whenever reloading data from a backing store, validated fileHash must be re-verified
|
|
4811
4841
|
|
|
4812
4842
|
```ts
|
|
4813
|
-
async computeFileHash(): Promise<string>
|
|
4843
|
+
async computeFileHash(): Promise<string>
|
|
4814
4844
|
```
|
|
4815
4845
|
|
|
4816
4846
|
Returns
|
|
@@ -4824,9 +4854,9 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4824
4854
|
|
|
4825
4855
|
```ts
|
|
4826
4856
|
export class BulkHeaderFileFs extends BulkHeaderFile {
|
|
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>
|
|
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>
|
|
4830
4860
|
}
|
|
4831
4861
|
```
|
|
4832
4862
|
|
|
@@ -4839,9 +4869,9 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4839
4869
|
|
|
4840
4870
|
```ts
|
|
4841
4871
|
export class BulkHeaderFileStorage extends BulkHeaderFile {
|
|
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>
|
|
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>
|
|
4845
4875
|
}
|
|
4846
4876
|
```
|
|
4847
4877
|
|
|
@@ -4854,7 +4884,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4854
4884
|
|
|
4855
4885
|
```ts
|
|
4856
4886
|
export abstract class BulkHeaderFiles implements BulkHeaderFilesInfo {
|
|
4857
|
-
constructor(public rootFolder: string, public jsonFilename: string, public files: BulkHeaderFileInfo[], public headersPerFile: number)
|
|
4887
|
+
constructor(public rootFolder: string, public jsonFilename: string, public files: BulkHeaderFileInfo[], public headersPerFile: number)
|
|
4858
4888
|
}
|
|
4859
4889
|
```
|
|
4860
4890
|
|
|
@@ -4867,19 +4897,19 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4867
4897
|
|
|
4868
4898
|
```ts
|
|
4869
4899
|
export abstract class BulkIngestorBase implements BulkIngestorApi {
|
|
4870
|
-
static createBulkIngestorBaseOptions(chain: Chain)
|
|
4900
|
+
static createBulkIngestorBaseOptions(chain: Chain)
|
|
4871
4901
|
chain: Chain;
|
|
4872
4902
|
jsonFilename: string;
|
|
4873
4903
|
log: (...args: any[]) => void = () => { };
|
|
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
|
|
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
|
|
4879
4909
|
filesInfo: BulkHeaderFilesInfo | undefined;
|
|
4880
|
-
async getPresentHeight(): Promise<number | undefined>
|
|
4910
|
+
async getPresentHeight(): Promise<number | undefined>
|
|
4881
4911
|
abstract fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>;
|
|
4882
|
-
async synchronize(presentHeight: number, before: HeightRanges, priorLiveHeaders: BlockHeader[]): Promise<BulkSyncResult>
|
|
4912
|
+
async synchronize(presentHeight: number, before: HeightRanges, priorLiveHeaders: BlockHeader[]): Promise<BulkSyncResult>
|
|
4883
4913
|
}
|
|
4884
4914
|
```
|
|
4885
4915
|
|
|
@@ -4897,7 +4927,7 @@ See also: [BulkHeaderFilesInfo](./services.md#interface-bulkheaderfilesinfo)
|
|
|
4897
4927
|
###### Method createBulkIngestorBaseOptions
|
|
4898
4928
|
|
|
4899
4929
|
```ts
|
|
4900
|
-
static createBulkIngestorBaseOptions(chain: Chain)
|
|
4930
|
+
static createBulkIngestorBaseOptions(chain: Chain)
|
|
4901
4931
|
```
|
|
4902
4932
|
See also: [Chain](./client.md#type-chain)
|
|
4903
4933
|
|
|
@@ -4939,7 +4969,7 @@ Argument Details
|
|
|
4939
4969
|
At least one derived BulkIngestor must override this method to provide the current height of the active chain tip.
|
|
4940
4970
|
|
|
4941
4971
|
```ts
|
|
4942
|
-
async getPresentHeight(): Promise<number | undefined>
|
|
4972
|
+
async getPresentHeight(): Promise<number | undefined>
|
|
4943
4973
|
```
|
|
4944
4974
|
|
|
4945
4975
|
Returns
|
|
@@ -4953,7 +4983,7 @@ A BulkIngestor has two potential goals:
|
|
|
4953
4983
|
2. To source missing live headers to be forwarded to live storage.
|
|
4954
4984
|
|
|
4955
4985
|
```ts
|
|
4956
|
-
async synchronize(presentHeight: number, before: HeightRanges, priorLiveHeaders: BlockHeader[]): Promise<BulkSyncResult>
|
|
4986
|
+
async synchronize(presentHeight: number, before: HeightRanges, priorLiveHeaders: BlockHeader[]): Promise<BulkSyncResult>
|
|
4957
4987
|
```
|
|
4958
4988
|
See also: [BlockHeader](./client.md#interface-blockheader), [BulkSyncResult](./services.md#interface-bulksyncresult), [HeightRanges](./services.md#interface-heightranges)
|
|
4959
4989
|
|
|
@@ -4977,7 +5007,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
4977
5007
|
|
|
4978
5008
|
```ts
|
|
4979
5009
|
export class BulkIngestorCDN extends BulkIngestorBase {
|
|
4980
|
-
static createBulkIngestorCDNOptions(chain: Chain, cdnUrl: string, fetch: ChaintracksFetchApi, maxPerFile?: number): BulkIngestorCDNOptions
|
|
5010
|
+
static createBulkIngestorCDNOptions(chain: Chain, cdnUrl: string, fetch: ChaintracksFetchApi, maxPerFile?: number): BulkIngestorCDNOptions
|
|
4981
5011
|
fetch: ChaintracksFetchApi;
|
|
4982
5012
|
jsonResource: string;
|
|
4983
5013
|
cdnUrl: string;
|
|
@@ -4985,10 +5015,10 @@ export class BulkIngestorCDN extends BulkIngestorBase {
|
|
|
4985
5015
|
availableBulkFiles: BulkHeaderFilesInfo | undefined;
|
|
4986
5016
|
selectedFiles: BulkHeaderFileInfo[] | undefined;
|
|
4987
5017
|
currentRange: HeightRange | undefined;
|
|
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[]>
|
|
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[]>
|
|
4992
5022
|
}
|
|
4993
5023
|
```
|
|
4994
5024
|
|
|
@@ -4997,7 +5027,7 @@ See also: [BlockHeader](./client.md#interface-blockheader), [BulkHeaderFileInfo]
|
|
|
4997
5027
|
###### Method createBulkIngestorCDNOptions
|
|
4998
5028
|
|
|
4999
5029
|
```ts
|
|
5000
|
-
static createBulkIngestorCDNOptions(chain: Chain, cdnUrl: string, fetch: ChaintracksFetchApi, maxPerFile?: number): BulkIngestorCDNOptions
|
|
5030
|
+
static createBulkIngestorCDNOptions(chain: Chain, cdnUrl: string, fetch: ChaintracksFetchApi, maxPerFile?: number): BulkIngestorCDNOptions
|
|
5001
5031
|
```
|
|
5002
5032
|
See also: [BulkIngestorCDNOptions](./services.md#interface-bulkingestorcdnoptions), [Chain](./client.md#type-chain), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi)
|
|
5003
5033
|
|
|
@@ -5032,7 +5062,7 @@ Context Replace:
|
|
|
5032
5062
|
- Proceed as context Incremental.
|
|
5033
5063
|
|
|
5034
5064
|
```ts
|
|
5035
|
-
async fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5065
|
+
async fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5036
5066
|
```
|
|
5037
5067
|
See also: [BlockHeader](./client.md#interface-blockheader), [HeightRange](./services.md#class-heightrange), [HeightRanges](./services.md#interface-heightranges)
|
|
5038
5068
|
|
|
@@ -5052,7 +5082,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5052
5082
|
|
|
5053
5083
|
```ts
|
|
5054
5084
|
export class BulkIngestorCDNBabbage extends BulkIngestorCDN {
|
|
5055
|
-
static createBulkIngestorCDNBabbageOptions(chain: Chain, fetch: ChaintracksFetchApi): BulkIngestorCDNOptions
|
|
5085
|
+
static createBulkIngestorCDNBabbageOptions(chain: Chain, fetch: ChaintracksFetchApi): BulkIngestorCDNOptions
|
|
5056
5086
|
}
|
|
5057
5087
|
```
|
|
5058
5088
|
|
|
@@ -5061,7 +5091,7 @@ See also: [BulkIngestorCDN](./services.md#class-bulkingestorcdn), [BulkIngestorC
|
|
|
5061
5091
|
###### Method createBulkIngestorCDNBabbageOptions
|
|
5062
5092
|
|
|
5063
5093
|
```ts
|
|
5064
|
-
static createBulkIngestorCDNBabbageOptions(chain: Chain, fetch: ChaintracksFetchApi): BulkIngestorCDNOptions
|
|
5094
|
+
static createBulkIngestorCDNBabbageOptions(chain: Chain, fetch: ChaintracksFetchApi): BulkIngestorCDNOptions
|
|
5065
5095
|
```
|
|
5066
5096
|
See also: [BulkIngestorCDNOptions](./services.md#interface-bulkingestorcdnoptions), [Chain](./client.md#type-chain), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi)
|
|
5067
5097
|
|
|
@@ -5081,9 +5111,9 @@ continuity, and genesis checks before storage.
|
|
|
5081
5111
|
|
|
5082
5112
|
```ts
|
|
5083
5113
|
export class BulkIngestorChaintracks extends BulkIngestorBase {
|
|
5084
|
-
constructor(options: BulkIngestorChaintracksOptions)
|
|
5085
|
-
override async getPresentHeight(): Promise<number>
|
|
5086
|
-
async fetchHeaders(_before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5114
|
+
constructor(options: BulkIngestorChaintracksOptions)
|
|
5115
|
+
override async getPresentHeight(): Promise<number>
|
|
5116
|
+
async fetchHeaders(_before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5087
5117
|
}
|
|
5088
5118
|
```
|
|
5089
5119
|
|
|
@@ -5096,14 +5126,14 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5096
5126
|
|
|
5097
5127
|
```ts
|
|
5098
5128
|
export class BulkIngestorWhatsOnChainCdn extends BulkIngestorBase {
|
|
5099
|
-
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5129
|
+
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5100
5130
|
fetch: ChaintracksFetchApi;
|
|
5101
5131
|
idleWait: number;
|
|
5102
5132
|
woc: WhatsOnChainServices;
|
|
5103
5133
|
stopOldListenersToken: StopListenerToken = { stop: undefined };
|
|
5104
|
-
constructor(options: BulkIngestorWhatsOnChainOptions)
|
|
5105
|
-
override async getPresentHeight(): Promise<number | undefined>
|
|
5106
|
-
async fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5134
|
+
constructor(options: BulkIngestorWhatsOnChainOptions)
|
|
5135
|
+
override async getPresentHeight(): Promise<number | undefined>
|
|
5136
|
+
async fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5107
5137
|
}
|
|
5108
5138
|
```
|
|
5109
5139
|
|
|
@@ -5112,7 +5142,7 @@ See also: [BlockHeader](./client.md#interface-blockheader), [BulkIngestorBase](.
|
|
|
5112
5142
|
###### Method createBulkIngestorWhatsOnChainOptions
|
|
5113
5143
|
|
|
5114
5144
|
```ts
|
|
5115
|
-
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5145
|
+
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5116
5146
|
```
|
|
5117
5147
|
See also: [BulkIngestorWhatsOnChainOptions](./services.md#interface-bulkingestorwhatsonchainoptions), [Chain](./client.md#type-chain)
|
|
5118
5148
|
|
|
@@ -5128,14 +5158,14 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5128
5158
|
|
|
5129
5159
|
```ts
|
|
5130
5160
|
export class BulkIngestorWhatsOnChainWs extends BulkIngestorBase {
|
|
5131
|
-
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5161
|
+
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5132
5162
|
idleWait: number;
|
|
5133
5163
|
maxHeadersPerRequest: number;
|
|
5134
5164
|
woc: WhatsOnChainServices;
|
|
5135
5165
|
stopOldListenersToken: StopListenerToken = { stop: undefined };
|
|
5136
|
-
constructor(options: BulkIngestorWhatsOnChainOptions)
|
|
5137
|
-
override async getPresentHeight(): Promise<number | undefined>
|
|
5138
|
-
async fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5166
|
+
constructor(options: BulkIngestorWhatsOnChainOptions)
|
|
5167
|
+
override async getPresentHeight(): Promise<number | undefined>
|
|
5168
|
+
async fetchHeaders(before: HeightRanges, fetchRange: HeightRange, bulkRange: HeightRange, priorLiveHeaders: BlockHeader[]): Promise<BlockHeader[]>
|
|
5139
5169
|
}
|
|
5140
5170
|
```
|
|
5141
5171
|
|
|
@@ -5144,7 +5174,7 @@ See also: [BlockHeader](./client.md#interface-blockheader), [BulkIngestorBase](.
|
|
|
5144
5174
|
###### Method createBulkIngestorWhatsOnChainOptions
|
|
5145
5175
|
|
|
5146
5176
|
```ts
|
|
5147
|
-
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5177
|
+
static createBulkIngestorWhatsOnChainOptions(chain: Chain): BulkIngestorWhatsOnChainOptions
|
|
5148
5178
|
```
|
|
5149
5179
|
See also: [BulkIngestorWhatsOnChainOptions](./services.md#interface-bulkingestorwhatsonchainoptions), [Chain](./client.md#type-chain)
|
|
5150
5180
|
|
|
@@ -5160,20 +5190,20 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5160
5190
|
|
|
5161
5191
|
```ts
|
|
5162
5192
|
export abstract class BulkStorageBase implements BulkStorageApi {
|
|
5163
|
-
static createBulkStorageBaseOptions(chain: Chain, fs: ChaintracksFsApi): BulkStorageBaseOptions
|
|
5193
|
+
static createBulkStorageBaseOptions(chain: Chain, fs: ChaintracksFsApi): BulkStorageBaseOptions
|
|
5164
5194
|
chain: Chain;
|
|
5165
5195
|
fs: ChaintracksFsApi;
|
|
5166
5196
|
log: (...args: any[]) => void = () => { };
|
|
5167
|
-
constructor(options: BulkStorageBaseOptions)
|
|
5168
|
-
async shutdown(): Promise<void>
|
|
5197
|
+
constructor(options: BulkStorageBaseOptions)
|
|
5198
|
+
async shutdown(): Promise<void>
|
|
5169
5199
|
abstract appendHeaders(minHeight: number, count: number, newBulkHeaders: Uint8Array): Promise<void>;
|
|
5170
5200
|
abstract getMaxHeight(): Promise<number>;
|
|
5171
5201
|
abstract headersToBuffer(height: number, count: number): Promise<Uint8Array>;
|
|
5172
5202
|
abstract findHeaderForHeightOrUndefined(height: number): Promise<BlockHeader | undefined>;
|
|
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>
|
|
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>
|
|
5177
5207
|
}
|
|
5178
5208
|
```
|
|
5179
5209
|
|
|
@@ -5186,37 +5216,37 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5186
5216
|
|
|
5187
5217
|
```ts
|
|
5188
5218
|
export class Chaintracks implements ChaintracksManagementApi {
|
|
5189
|
-
static createOptions(chain: Chain): ChaintracksOptions
|
|
5219
|
+
static createOptions(chain: Chain): ChaintracksOptions
|
|
5190
5220
|
log: (...args: any[]) => void = () => { };
|
|
5191
5221
|
readonly chain: Chain;
|
|
5192
5222
|
readonly readonly: boolean;
|
|
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>
|
|
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>
|
|
5220
5250
|
private async syncBulkStorageNoLock(presentHeight: number, initialRanges: HeightRanges): Promise<void> {
|
|
5221
5251
|
let newLiveHeaders: BlockHeader[] = [];
|
|
5222
5252
|
let before = initialRanges;
|
|
@@ -5294,7 +5324,7 @@ bulk ingestors will be attempted to resolve the linkage up to a depth of `addLiv
|
|
|
5294
5324
|
Headers are considered in the order they were added.
|
|
5295
5325
|
|
|
5296
5326
|
```ts
|
|
5297
|
-
async addHeader(header: BaseBlockHeader): Promise<void>
|
|
5327
|
+
async addHeader(header: BaseBlockHeader): Promise<void>
|
|
5298
5328
|
```
|
|
5299
5329
|
See also: [BaseBlockHeader](./client.md#interface-baseblockheader)
|
|
5300
5330
|
|
|
@@ -5303,7 +5333,7 @@ See also: [BaseBlockHeader](./client.md#interface-baseblockheader)
|
|
|
5303
5333
|
Returns local process state without locks, storage reads, or network I/O.
|
|
5304
5334
|
|
|
5305
5335
|
```ts
|
|
5306
|
-
getAvailabilitySnapshot(): ChaintracksAvailabilitySnapshotApi
|
|
5336
|
+
getAvailabilitySnapshot(): ChaintracksAvailabilitySnapshotApi
|
|
5307
5337
|
```
|
|
5308
5338
|
See also: [ChaintracksAvailabilitySnapshotApi](./services.md#interface-chaintracksavailabilitysnapshotapi)
|
|
5309
5339
|
|
|
@@ -5313,7 +5343,7 @@ Returns the last known valid height immediately and refreshes stale state
|
|
|
5313
5343
|
once in the background. Cold start waits for the single shared refresh.
|
|
5314
5344
|
|
|
5315
5345
|
```ts
|
|
5316
|
-
async getPresentHeight(): Promise<number>
|
|
5346
|
+
async getPresentHeight(): Promise<number>
|
|
5317
5347
|
```
|
|
5318
5348
|
|
|
5319
5349
|
###### Method makeAvailable
|
|
@@ -5325,7 +5355,7 @@ Note that the main thread continues running and takes additional write locks
|
|
|
5325
5355
|
itself when already available.
|
|
5326
5356
|
|
|
5327
5357
|
```ts
|
|
5328
|
-
async makeAvailable(): Promise<void>
|
|
5358
|
+
async makeAvailable(): Promise<void>
|
|
5329
5359
|
```
|
|
5330
5360
|
|
|
5331
5361
|
Returns
|
|
@@ -5335,7 +5365,7 @@ when available for client requests
|
|
|
5335
5365
|
###### Method validate
|
|
5336
5366
|
|
|
5337
5367
|
```ts
|
|
5338
|
-
async validate(): Promise<boolean>
|
|
5368
|
+
async validate(): Promise<boolean>
|
|
5339
5369
|
```
|
|
5340
5370
|
|
|
5341
5371
|
Returns
|
|
@@ -5349,8 +5379,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5349
5379
|
|
|
5350
5380
|
```ts
|
|
5351
5381
|
export class ChaintracksAppendableFile extends ChaintracksFolderAwareFile implements ChaintracksAppendableFileApi {
|
|
5352
|
-
static async openAsAppendable(path: string): Promise<ChaintracksAppendableFile>
|
|
5353
|
-
async append(data: Uint8Array): Promise<void>
|
|
5382
|
+
static async openAsAppendable(path: string): Promise<ChaintracksAppendableFile>
|
|
5383
|
+
async append(data: Uint8Array): Promise<void>
|
|
5354
5384
|
}
|
|
5355
5385
|
```
|
|
5356
5386
|
|
|
@@ -5363,18 +5393,38 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5363
5393
|
|
|
5364
5394
|
```ts
|
|
5365
5395
|
export class ChaintracksChainTracker implements ChainTracker {
|
|
5366
|
-
chaintracks: ChaintracksClientApi;
|
|
5367
5396
|
cache: Record<number, string>;
|
|
5368
5397
|
options: ChaintracksChainTrackerOptions;
|
|
5369
5398
|
readonly telemetry: Telemetry;
|
|
5370
|
-
constructor(chain?: Chain, chaintracks?: ChaintracksClientApi, options?: ChaintracksChainTrackerOptions)
|
|
5371
|
-
|
|
5372
|
-
|
|
5399
|
+
constructor(chain?: Chain, chaintracks?: ChaintracksClientApi, options?: ChaintracksChainTrackerOptions)
|
|
5400
|
+
get chaintracks(): ChaintracksClientApi
|
|
5401
|
+
set chaintracks(value: ChaintracksClientApi)
|
|
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>
|
|
5373
5407
|
}
|
|
5374
5408
|
```
|
|
5375
5409
|
|
|
5376
5410
|
See also: [Chain](./client.md#type-chain), [ChaintracksChainTrackerOptions](./services.md#interface-chaintrackschaintrackeroptions), [ChaintracksClientApi](./services.md#interface-chaintracksclientapi)
|
|
5377
5411
|
|
|
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
|
+
|
|
5378
5428
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5379
5429
|
|
|
5380
5430
|
---
|
|
@@ -5389,10 +5439,10 @@ every materialized response has an explicit byte ceiling.
|
|
|
5389
5439
|
```ts
|
|
5390
5440
|
export class ChaintracksFetch implements ChaintracksFetchApi {
|
|
5391
5441
|
httpClient: HttpClient = defaultHttpClient();
|
|
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
|
|
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
|
|
5396
5446
|
}
|
|
5397
5447
|
```
|
|
5398
5448
|
|
|
@@ -5405,8 +5455,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5405
5455
|
|
|
5406
5456
|
```ts
|
|
5407
5457
|
export class ChaintracksFetchError extends Error {
|
|
5408
|
-
constructor(message: string, public readonly url: string, public readonly status: number, public readonly statusText: string, public readonly retryAfterMsecs?: number)
|
|
5409
|
-
get retryable(): boolean
|
|
5458
|
+
constructor(message: string, public readonly url: string, public readonly status: number, public readonly statusText: string, public readonly retryAfterMsecs?: number)
|
|
5459
|
+
get retryable(): boolean
|
|
5410
5460
|
}
|
|
5411
5461
|
```
|
|
5412
5462
|
|
|
@@ -5417,14 +5467,14 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5417
5467
|
|
|
5418
5468
|
```ts
|
|
5419
5469
|
export abstract class ChaintracksFsStatics {
|
|
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
|
|
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
|
|
5428
5478
|
}
|
|
5429
5479
|
```
|
|
5430
5480
|
|
|
@@ -5438,13 +5488,13 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5438
5488
|
```ts
|
|
5439
5489
|
export class ChaintracksKnexMigrations implements MigrationSource<string> {
|
|
5440
5490
|
migrations: 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>
|
|
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>
|
|
5448
5498
|
}
|
|
5449
5499
|
```
|
|
5450
5500
|
|
|
@@ -5452,6 +5502,18 @@ See also: [Chain](./client.md#type-chain)
|
|
|
5452
5502
|
|
|
5453
5503
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5454
5504
|
|
|
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
|
+
|
|
5455
5517
|
---
|
|
5456
5518
|
##### Class: ChaintracksReadableFile
|
|
5457
5519
|
|
|
@@ -5460,11 +5522,11 @@ export class ChaintracksReadableFile implements ChaintracksReadableFileApi {
|
|
|
5460
5522
|
path: string;
|
|
5461
5523
|
parsedPath: Path.ParsedPath;
|
|
5462
5524
|
f: fs.FileHandle;
|
|
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>
|
|
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>
|
|
5468
5530
|
}
|
|
5469
5531
|
```
|
|
5470
5532
|
|
|
@@ -5477,16 +5539,16 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5477
5539
|
|
|
5478
5540
|
```ts
|
|
5479
5541
|
export class ChaintracksService {
|
|
5480
|
-
static createChaintracksServiceOptions(chain: Chain): ChaintracksServiceOptions
|
|
5542
|
+
static createChaintracksServiceOptions(chain: Chain): ChaintracksServiceOptions
|
|
5481
5543
|
chain: Chain;
|
|
5482
5544
|
options: ChaintracksServiceOptions;
|
|
5483
5545
|
port?: number;
|
|
5484
5546
|
chaintracks: Chaintracks;
|
|
5485
5547
|
services: Services;
|
|
5486
5548
|
server?: Server<typeof IncomingMessage, typeof ServerResponse>;
|
|
5487
|
-
constructor(options: ChaintracksServiceOptions)
|
|
5488
|
-
async stopJsonRpcServer(): Promise<void>
|
|
5489
|
-
async startJsonRpcServer(port?: number): Promise<void>
|
|
5549
|
+
constructor(options: ChaintracksServiceOptions)
|
|
5550
|
+
async stopJsonRpcServer(): Promise<void>
|
|
5551
|
+
async startJsonRpcServer(port?: number): Promise<void>
|
|
5490
5552
|
}
|
|
5491
5553
|
```
|
|
5492
5554
|
|
|
@@ -5501,36 +5563,45 @@ Connects to a ChaintracksService to implement 'ChaintracksClientApi'
|
|
|
5501
5563
|
|
|
5502
5564
|
```ts
|
|
5503
5565
|
export class ChaintracksServiceClient implements ChaintracksClientApi {
|
|
5504
|
-
|
|
5566
|
+
readonly supportsReorgEvents = false;
|
|
5567
|
+
static createChaintracksServiceClientOptions(): ChaintracksServiceClientOptions
|
|
5505
5568
|
options: ChaintracksServiceClientOptions;
|
|
5506
|
-
constructor(public chain: Chain, serviceUrl: string, options?: ChaintracksServiceClientOptions)
|
|
5569
|
+
constructor(public chain: Chain, serviceUrl: string, options?: ChaintracksServiceClientOptions)
|
|
5507
5570
|
readonly serviceUrl: string;
|
|
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>
|
|
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>
|
|
5529
5592
|
}
|
|
5530
5593
|
```
|
|
5531
5594
|
|
|
5532
5595
|
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)
|
|
5533
5596
|
|
|
5597
|
+
###### Property supportsReorgEvents
|
|
5598
|
+
|
|
5599
|
+
HTTP polling client; callback event methods are legacy unsupported stubs.
|
|
5600
|
+
|
|
5601
|
+
```ts
|
|
5602
|
+
readonly supportsReorgEvents = false
|
|
5603
|
+
```
|
|
5604
|
+
|
|
5534
5605
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5535
5606
|
|
|
5536
5607
|
---
|
|
@@ -5540,7 +5611,7 @@ Required interface methods of a Chaintracks Storage Engine implementation.
|
|
|
5540
5611
|
|
|
5541
5612
|
```ts
|
|
5542
5613
|
export abstract class ChaintracksStorageBase implements ChaintracksStorageQueryApi, ChaintracksStorageIngestApi {
|
|
5543
|
-
static createStorageBaseOptions(chain: Chain): ChaintracksStorageBaseOptions
|
|
5614
|
+
static createStorageBaseOptions(chain: Chain): ChaintracksStorageBaseOptions
|
|
5544
5615
|
log: (...args: any[]) => void = () => { };
|
|
5545
5616
|
chain: Chain;
|
|
5546
5617
|
liveHeightThreshold: number;
|
|
@@ -5550,19 +5621,19 @@ export abstract class ChaintracksStorageBase implements ChaintracksStorageQueryA
|
|
|
5550
5621
|
isAvailable: boolean = false;
|
|
5551
5622
|
hasMigrated: boolean = false;
|
|
5552
5623
|
bulkManager: BulkFileDataManager;
|
|
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>
|
|
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>
|
|
5566
5637
|
abstract deleteLiveBlockHeaders(): Promise<void>;
|
|
5567
5638
|
abstract deleteOlderLiveBlockHeaders(maxHeight: number): Promise<number>;
|
|
5568
5639
|
abstract findChainTipHeader(): Promise<LiveBlockHeader>;
|
|
@@ -5577,26 +5648,26 @@ export abstract class ChaintracksStorageBase implements ChaintracksStorageQueryA
|
|
|
5577
5648
|
abstract getLiveHeaders(range: HeightRange): Promise<LiveBlockHeader[]>;
|
|
5578
5649
|
abstract insertHeader(header: BlockHeader): Promise<InsertHeaderResult>;
|
|
5579
5650
|
abstract destroy(): 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>
|
|
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>
|
|
5584
5655
|
async getAvailableHeightRanges(): Promise<{
|
|
5585
5656
|
bulk: HeightRange;
|
|
5586
5657
|
live: HeightRange;
|
|
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[]>
|
|
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[]>
|
|
5600
5671
|
}
|
|
5601
5672
|
```
|
|
5602
5673
|
|
|
@@ -5629,34 +5700,34 @@ export class ChaintracksStorageIdb extends ChaintracksStorageBase implements Cha
|
|
|
5629
5700
|
db?: IDBPDatabase<ChaintracksStorageIdbSchema>;
|
|
5630
5701
|
whenLastAccess?: Date;
|
|
5631
5702
|
allStores: string[] = ["live_headers", "bulk_headers"];
|
|
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">
|
|
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">
|
|
5660
5731
|
}
|
|
5661
5732
|
```
|
|
5662
5733
|
|
|
@@ -5670,7 +5741,7 @@ Set existing headers with previousHeaderId value set to the headerId value of
|
|
|
5670
5741
|
a header which is to be deleted to null.
|
|
5671
5742
|
|
|
5672
5743
|
```ts
|
|
5673
|
-
override async deleteOlderLiveBlockHeaders(maxHeight: number): Promise<number>
|
|
5744
|
+
override async deleteOlderLiveBlockHeaders(maxHeight: number): Promise<number>
|
|
5674
5745
|
```
|
|
5675
5746
|
|
|
5676
5747
|
Returns
|
|
@@ -5685,7 +5756,7 @@ Argument Details
|
|
|
5685
5756
|
###### Method findChainTipHeader
|
|
5686
5757
|
|
|
5687
5758
|
```ts
|
|
5688
|
-
override async findChainTipHeader(): Promise<LiveBlockHeader>
|
|
5759
|
+
override async findChainTipHeader(): Promise<LiveBlockHeader>
|
|
5689
5760
|
```
|
|
5690
5761
|
See also: [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
5691
5762
|
|
|
@@ -5700,7 +5771,7 @@ an error if there is no tip.
|
|
|
5700
5771
|
###### Method findChainTipHeaderOrUndefined
|
|
5701
5772
|
|
|
5702
5773
|
```ts
|
|
5703
|
-
override async findChainTipHeaderOrUndefined(): Promise<LiveBlockHeader | undefined>
|
|
5774
|
+
override async findChainTipHeaderOrUndefined(): Promise<LiveBlockHeader | undefined>
|
|
5704
5775
|
```
|
|
5705
5776
|
See also: [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
5706
5777
|
|
|
@@ -5720,7 +5791,7 @@ So true is stored as a 1, and false is stored as no property value (delete v['pr
|
|
|
5720
5791
|
This function restores these property values to true and false.
|
|
5721
5792
|
|
|
5722
5793
|
```ts
|
|
5723
|
-
protected repairStoredLiveHeader(header?: LiveBlockHeader): LiveBlockHeader | undefined
|
|
5794
|
+
protected repairStoredLiveHeader(header?: LiveBlockHeader): LiveBlockHeader | undefined
|
|
5724
5795
|
```
|
|
5725
5796
|
See also: [LiveBlockHeader](./services.md#interface-liveblockheader)
|
|
5726
5797
|
|
|
@@ -5738,40 +5809,40 @@ Also see `chaintracksStorageMemory` which leverages Knex support for an in memor
|
|
|
5738
5809
|
|
|
5739
5810
|
```ts
|
|
5740
5811
|
export class ChaintracksStorageKnex extends ChaintracksStorageBase implements ChaintracksStorageBulkFileApi {
|
|
5741
|
-
static createStorageKnexOptions(chain: Chain, knex?: Knex): ChaintracksStorageKnexOptions
|
|
5812
|
+
static createStorageKnexOptions(chain: Chain, knex?: Knex): ChaintracksStorageKnexOptions
|
|
5742
5813
|
knex: Knex;
|
|
5743
5814
|
_dbtype?: DBType;
|
|
5744
5815
|
bulkFilesTableName: string = "bulk_files";
|
|
5745
5816
|
headerTableName: string = "live_headers";
|
|
5746
5817
|
stateTableName: string = "chaintracks_state";
|
|
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[]>
|
|
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[]>
|
|
5775
5846
|
}
|
|
5776
5847
|
```
|
|
5777
5848
|
|
|
@@ -5819,22 +5890,22 @@ export class ChaintracksStorageNoDb extends ChaintracksStorageBase {
|
|
|
5819
5890
|
tipHeaderId: 0,
|
|
5820
5891
|
hashToHeaderId: new Map<string, number>()
|
|
5821
5892
|
};
|
|
5822
|
-
constructor(options: ChaintracksStorageNoDbOptions)
|
|
5823
|
-
override async destroy(): Promise<void>
|
|
5824
|
-
async getData(): Promise<ChaintracksNoDbData>
|
|
5825
|
-
override async deleteLiveBlockHeaders(): Promise<void>
|
|
5826
|
-
override async deleteOlderLiveBlockHeaders(maxHeight: number): Promise<number>
|
|
5827
|
-
override async findChainTipHeader(): Promise<LiveBlockHeader>
|
|
5828
|
-
override async findChainTipHeaderOrUndefined(): Promise<LiveBlockHeader | undefined>
|
|
5829
|
-
override async findLiveHeaderForBlockHash(hash: string): Promise<LiveBlockHeader | null>
|
|
5830
|
-
override async findLiveHeaderForHeaderId(headerId: number): Promise<LiveBlockHeader>
|
|
5831
|
-
override async findLiveHeaderForHeight(height: number): Promise<LiveBlockHeader | null>
|
|
5832
|
-
override async findLiveHeaderForMerkleRoot(merkleRoot: string): Promise<LiveBlockHeader | null>
|
|
5833
|
-
override async findLiveHeightRange(): Promise<HeightRange>
|
|
5834
|
-
override async findMaxHeaderId(): Promise<number>
|
|
5835
|
-
override async liveHeadersForBulk(count: number): Promise<LiveBlockHeader[]>
|
|
5836
|
-
override async getLiveHeaders(range: HeightRange): Promise<LiveBlockHeader[]>
|
|
5837
|
-
override async insertHeader(header: BlockHeader): Promise<InsertHeaderResult>
|
|
5893
|
+
constructor(options: ChaintracksStorageNoDbOptions)
|
|
5894
|
+
override async destroy(): Promise<void>
|
|
5895
|
+
async getData(): Promise<ChaintracksNoDbData>
|
|
5896
|
+
override async deleteLiveBlockHeaders(): Promise<void>
|
|
5897
|
+
override async deleteOlderLiveBlockHeaders(maxHeight: number): Promise<number>
|
|
5898
|
+
override async findChainTipHeader(): Promise<LiveBlockHeader>
|
|
5899
|
+
override async findChainTipHeaderOrUndefined(): Promise<LiveBlockHeader | undefined>
|
|
5900
|
+
override async findLiveHeaderForBlockHash(hash: string): Promise<LiveBlockHeader | null>
|
|
5901
|
+
override async findLiveHeaderForHeaderId(headerId: number): Promise<LiveBlockHeader>
|
|
5902
|
+
override async findLiveHeaderForHeight(height: number): Promise<LiveBlockHeader | null>
|
|
5903
|
+
override async findLiveHeaderForMerkleRoot(merkleRoot: string): Promise<LiveBlockHeader | null>
|
|
5904
|
+
override async findLiveHeightRange(): Promise<HeightRange>
|
|
5905
|
+
override async findMaxHeaderId(): Promise<number>
|
|
5906
|
+
override async liveHeadersForBulk(count: number): Promise<LiveBlockHeader[]>
|
|
5907
|
+
override async getLiveHeaders(range: HeightRange): Promise<LiveBlockHeader[]>
|
|
5908
|
+
override async insertHeader(header: BlockHeader): Promise<InsertHeaderResult>
|
|
5838
5909
|
}
|
|
5839
5910
|
```
|
|
5840
5911
|
|
|
@@ -5845,7 +5916,7 @@ See also: [BlockHeader](./client.md#interface-blockheader), [ChaintracksStorageB
|
|
|
5845
5916
|
Returns an isolated diagnostic snapshot; mutating it never changes tracker state.
|
|
5846
5917
|
|
|
5847
5918
|
```ts
|
|
5848
|
-
async getData(): Promise<ChaintracksNoDbData>
|
|
5919
|
+
async getData(): Promise<ChaintracksNoDbData>
|
|
5849
5920
|
```
|
|
5850
5921
|
|
|
5851
5922
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -5855,8 +5926,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
5855
5926
|
|
|
5856
5927
|
```ts
|
|
5857
5928
|
export class ChaintracksWritableFile extends ChaintracksFolderAwareFile implements ChaintracksWritableFileApi {
|
|
5858
|
-
static async openAsWritable(path: string): Promise<ChaintracksWritableFile>
|
|
5859
|
-
async append(data: Uint8Array): Promise<void>
|
|
5929
|
+
static async openAsWritable(path: string): Promise<ChaintracksWritableFile>
|
|
5930
|
+
async append(data: Uint8Array): Promise<void>
|
|
5860
5931
|
}
|
|
5861
5932
|
```
|
|
5862
5933
|
|
|
@@ -5875,10 +5946,10 @@ unrecorded request. Deployments must place `stateFile` on durable storage.
|
|
|
5875
5946
|
|
|
5876
5947
|
```ts
|
|
5877
5948
|
export class DurableFileBulkFileDownloadBudget implements BulkFileDownloadBudgetApi {
|
|
5878
|
-
constructor(options: DurableFileBulkFileDownloadBudgetOptions)
|
|
5879
|
-
async initialize(): Promise<void>
|
|
5880
|
-
async consume(byteCount: number): Promise<void>
|
|
5881
|
-
snapshot(): BulkFileDownloadBudgetSnapshot
|
|
5949
|
+
constructor(options: DurableFileBulkFileDownloadBudgetOptions)
|
|
5950
|
+
async initialize(): Promise<void>
|
|
5951
|
+
async consume(byteCount: number): Promise<void>
|
|
5952
|
+
snapshot(): BulkFileDownloadBudgetSnapshot
|
|
5882
5953
|
}
|
|
5883
5954
|
```
|
|
5884
5955
|
|
|
@@ -5892,7 +5963,7 @@ Load and validate the durable ledger before the service becomes ready.
|
|
|
5892
5963
|
readiness reports the persisted allowance and corrupt state fails startup.
|
|
5893
5964
|
|
|
5894
5965
|
```ts
|
|
5895
|
-
async initialize(): Promise<void>
|
|
5966
|
+
async initialize(): Promise<void>
|
|
5896
5967
|
```
|
|
5897
5968
|
|
|
5898
5969
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -5906,15 +5977,15 @@ fails, preventing a failing upstream from bypassing the bound.
|
|
|
5906
5977
|
|
|
5907
5978
|
```ts
|
|
5908
5979
|
export class FixedWindowBulkFileDownloadBudget implements BulkFileDownloadBudgetApi {
|
|
5909
|
-
constructor(options: FixedWindowBulkFileDownloadBudgetOptions)
|
|
5910
|
-
consume(byteCount: number): void
|
|
5980
|
+
constructor(options: FixedWindowBulkFileDownloadBudgetOptions)
|
|
5981
|
+
consume(byteCount: number): void
|
|
5911
5982
|
snapshot(): {
|
|
5912
5983
|
maxBytes: number;
|
|
5913
5984
|
consumedBytes: number;
|
|
5914
5985
|
remainingBytes: number;
|
|
5915
5986
|
windowStartedAt: number;
|
|
5916
5987
|
windowMsecs: number;
|
|
5917
|
-
}
|
|
5988
|
+
}
|
|
5918
5989
|
}
|
|
5919
5990
|
```
|
|
5920
5991
|
|
|
@@ -5932,30 +6003,39 @@ processing without a local WhatsOnChain polling ingestor.
|
|
|
5932
6003
|
|
|
5933
6004
|
```ts
|
|
5934
6005
|
export class GoChaintracksServiceClient implements ChaintracksClientApi {
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
async
|
|
5938
|
-
async
|
|
5939
|
-
async
|
|
5940
|
-
async
|
|
5941
|
-
async
|
|
5942
|
-
async
|
|
5943
|
-
async
|
|
5944
|
-
async
|
|
5945
|
-
async
|
|
5946
|
-
async
|
|
5947
|
-
async
|
|
5948
|
-
async
|
|
5949
|
-
async
|
|
5950
|
-
async
|
|
5951
|
-
async
|
|
5952
|
-
async
|
|
5953
|
-
async
|
|
6006
|
+
readonly supportsReorgEvents = true;
|
|
6007
|
+
constructor(public chain: Chain, serviceUrl: string, options: GoChaintracksServiceClientOptions = {})
|
|
6008
|
+
async currentHeight(): Promise<number>
|
|
6009
|
+
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
6010
|
+
async getChain(): Promise<Chain>
|
|
6011
|
+
async getInfo(): Promise<ChaintracksInfoApi>
|
|
6012
|
+
async getPresentHeight(): Promise<number>
|
|
6013
|
+
async getHeaders(height: number, count: number): Promise<string>
|
|
6014
|
+
async findChainTipHeader(): Promise<BlockHeader>
|
|
6015
|
+
async findChainTipHash(): Promise<string>
|
|
6016
|
+
async findHeaderForHeight(height: number): Promise<BlockHeader | undefined>
|
|
6017
|
+
async findHeaderForBlockHash(hash: string): Promise<BlockHeader | undefined>
|
|
6018
|
+
async addHeader(_header: BaseBlockHeader): Promise<void>
|
|
6019
|
+
async startListening(): Promise<void>
|
|
6020
|
+
async listening(): Promise<void>
|
|
6021
|
+
async isListening(): Promise<boolean>
|
|
6022
|
+
async isSynchronized(): Promise<boolean>
|
|
6023
|
+
async subscribeHeaders(listener: HeaderListener): Promise<string>
|
|
6024
|
+
async subscribeReorgs(listener: ReorgListener): Promise<string>
|
|
6025
|
+
async unsubscribe(subscriptionId: string): Promise<boolean>
|
|
5954
6026
|
}
|
|
5955
6027
|
```
|
|
5956
6028
|
|
|
5957
6029
|
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)
|
|
5958
6030
|
|
|
6031
|
+
###### Property supportsReorgEvents
|
|
6032
|
+
|
|
6033
|
+
SSE client; reorg registration is a supported additive capability.
|
|
6034
|
+
|
|
6035
|
+
```ts
|
|
6036
|
+
readonly supportsReorgEvents = true
|
|
6037
|
+
```
|
|
6038
|
+
|
|
5959
6039
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
5960
6040
|
|
|
5961
6041
|
---
|
|
@@ -5967,18 +6047,18 @@ Operations support integrating contiguous batches of headers,
|
|
|
5967
6047
|
|
|
5968
6048
|
```ts
|
|
5969
6049
|
export class HeightRange implements HeightRangeApi {
|
|
5970
|
-
constructor(public minHeight: number, public maxHeight: number)
|
|
6050
|
+
constructor(public minHeight: number, public maxHeight: number)
|
|
5971
6051
|
static readonly empty = new HeightRange(0, -1);
|
|
5972
|
-
get isEmpty()
|
|
5973
|
-
static from(headers: BlockHeader[]): HeightRange
|
|
5974
|
-
get length()
|
|
5975
|
-
toString(): string
|
|
5976
|
-
contains(range: HeightRange | number)
|
|
5977
|
-
intersect(range: HeightRange)
|
|
5978
|
-
union(range: HeightRange)
|
|
5979
|
-
subtract(range: HeightRange)
|
|
5980
|
-
above(range: HeightRange)
|
|
5981
|
-
copy(): HeightRange
|
|
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
|
|
5982
6062
|
}
|
|
5983
6063
|
```
|
|
5984
6064
|
|
|
@@ -6004,14 +6084,14 @@ Otherwise returns a copy of this range.
|
|
|
6004
6084
|
This returns the portion of this range that is strictly above `range`.
|
|
6005
6085
|
|
|
6006
6086
|
```ts
|
|
6007
|
-
above(range: HeightRange)
|
|
6087
|
+
above(range: HeightRange)
|
|
6008
6088
|
```
|
|
6009
6089
|
See also: [HeightRange](./services.md#class-heightrange)
|
|
6010
6090
|
|
|
6011
6091
|
###### Method contains
|
|
6012
6092
|
|
|
6013
6093
|
```ts
|
|
6014
|
-
contains(range: HeightRange | number)
|
|
6094
|
+
contains(range: HeightRange | number)
|
|
6015
6095
|
```
|
|
6016
6096
|
See also: [HeightRange](./services.md#class-heightrange)
|
|
6017
6097
|
|
|
@@ -6029,14 +6109,14 @@ Argument Details
|
|
|
6029
6109
|
Return a copy of this range.
|
|
6030
6110
|
|
|
6031
6111
|
```ts
|
|
6032
|
-
copy(): HeightRange
|
|
6112
|
+
copy(): HeightRange
|
|
6033
6113
|
```
|
|
6034
6114
|
See also: [HeightRange](./services.md#class-heightrange)
|
|
6035
6115
|
|
|
6036
6116
|
###### Method from
|
|
6037
6117
|
|
|
6038
6118
|
```ts
|
|
6039
|
-
static from(headers: BlockHeader[]): HeightRange
|
|
6119
|
+
static from(headers: BlockHeader[]): HeightRange
|
|
6040
6120
|
```
|
|
6041
6121
|
See also: [BlockHeader](./client.md#interface-blockheader), [HeightRange](./services.md#class-heightrange)
|
|
6042
6122
|
|
|
@@ -6058,7 +6138,7 @@ Intersection with an empty range is always empty.
|
|
|
6058
6138
|
The result is always a single, possibly empty, range.
|
|
6059
6139
|
|
|
6060
6140
|
```ts
|
|
6061
|
-
intersect(range: HeightRange)
|
|
6141
|
+
intersect(range: HeightRange)
|
|
6062
6142
|
```
|
|
6063
6143
|
See also: [HeightRange](./services.md#class-heightrange)
|
|
6064
6144
|
|
|
@@ -6069,7 +6149,7 @@ Returns `range` subtracted from this range.
|
|
|
6069
6149
|
Throws an error if the subtraction would create two disjoint ranges.
|
|
6070
6150
|
|
|
6071
6151
|
```ts
|
|
6072
|
-
subtract(range: HeightRange)
|
|
6152
|
+
subtract(range: HeightRange)
|
|
6073
6153
|
```
|
|
6074
6154
|
See also: [HeightRange](./services.md#class-heightrange)
|
|
6075
6155
|
|
|
@@ -6078,7 +6158,7 @@ See also: [HeightRange](./services.md#class-heightrange)
|
|
|
6078
6158
|
function toString() { [native code] }
|
|
6079
6159
|
|
|
6080
6160
|
```ts
|
|
6081
|
-
toString(): string
|
|
6161
|
+
toString(): string
|
|
6082
6162
|
```
|
|
6083
6163
|
|
|
6084
6164
|
Returns
|
|
@@ -6094,7 +6174,7 @@ Only valid if the two ranges overlap or touch, or one is empty.
|
|
|
6094
6174
|
Throws an error if the union would create two disjoint ranges.
|
|
6095
6175
|
|
|
6096
6176
|
```ts
|
|
6097
|
-
union(range: HeightRange)
|
|
6177
|
+
union(range: HeightRange)
|
|
6098
6178
|
```
|
|
6099
6179
|
See also: [HeightRange](./services.md#class-heightrange)
|
|
6100
6180
|
|
|
@@ -6109,7 +6189,7 @@ dependency-free fallback.
|
|
|
6109
6189
|
|
|
6110
6190
|
```ts
|
|
6111
6191
|
export class InlineBulkFileDataValidator implements BulkFileDataValidatorApi {
|
|
6112
|
-
async validate(request: BulkFileDataValidationRequest): Promise<BulkFileDataValidationResult>
|
|
6192
|
+
async validate(request: BulkFileDataValidationRequest): Promise<BulkFileDataValidationResult>
|
|
6113
6193
|
}
|
|
6114
6194
|
```
|
|
6115
6195
|
|
|
@@ -6122,13 +6202,13 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6122
6202
|
|
|
6123
6203
|
```ts
|
|
6124
6204
|
export abstract class LiveIngestorBase implements LiveIngestorApi {
|
|
6125
|
-
static createLiveIngestorBaseOptions(chain: Chain)
|
|
6205
|
+
static createLiveIngestorBaseOptions(chain: Chain)
|
|
6126
6206
|
chain: Chain;
|
|
6127
6207
|
log: (...args: any[]) => void = () => ;
|
|
6128
|
-
constructor(options: LiveIngestorBaseOptions)
|
|
6208
|
+
constructor(options: LiveIngestorBaseOptions)
|
|
6129
6209
|
async shutdown(): Promise<void> { }
|
|
6130
|
-
async setStorage(storage: ChaintracksStorageApi, log: (...args: any[]) => void): Promise<void>
|
|
6131
|
-
storage(): ChaintracksStorageApi
|
|
6210
|
+
async setStorage(storage: ChaintracksStorageApi, log: (...args: any[]) => void): Promise<void>
|
|
6211
|
+
storage(): ChaintracksStorageApi
|
|
6132
6212
|
abstract getHeaderByHash(hash: string): Promise<BlockHeader | undefined>;
|
|
6133
6213
|
abstract startListening(liveHeaders: BlockHeader[]): Promise<void>;
|
|
6134
6214
|
abstract stopListening(): void;
|
|
@@ -6157,7 +6237,7 @@ Argument Details
|
|
|
6157
6237
|
Allocate resources.
|
|
6158
6238
|
|
|
6159
6239
|
```ts
|
|
6160
|
-
async setStorage(storage: ChaintracksStorageApi, log: (...args: any[]) => void): Promise<void>
|
|
6240
|
+
async setStorage(storage: ChaintracksStorageApi, log: (...args: any[]) => void): Promise<void>
|
|
6161
6241
|
```
|
|
6162
6242
|
See also: [ChaintracksStorageApi](./services.md#interface-chaintracksstorageapi)
|
|
6163
6243
|
|
|
@@ -6172,7 +6252,7 @@ Release resources.
|
|
|
6172
6252
|
Override if required.
|
|
6173
6253
|
|
|
6174
6254
|
```ts
|
|
6175
|
-
async shutdown(): Promise<void>
|
|
6255
|
+
async shutdown(): Promise<void>
|
|
6176
6256
|
```
|
|
6177
6257
|
|
|
6178
6258
|
###### Method startListening
|
|
@@ -6204,7 +6284,7 @@ abstract stopListening(): void
|
|
|
6204
6284
|
###### Method storage
|
|
6205
6285
|
|
|
6206
6286
|
```ts
|
|
6207
|
-
storage(): ChaintracksStorageApi
|
|
6287
|
+
storage(): ChaintracksStorageApi
|
|
6208
6288
|
```
|
|
6209
6289
|
See also: [ChaintracksStorageApi](./services.md#interface-chaintracksstorageapi)
|
|
6210
6290
|
|
|
@@ -6222,12 +6302,12 @@ Adapts a remote Chaintracks event stream, such as Arcade/go-chaintracks
|
|
|
6222
6302
|
|
|
6223
6303
|
```ts
|
|
6224
6304
|
export class LiveIngestorChaintracksSSE extends LiveIngestorBase {
|
|
6225
|
-
static createLiveIngestorChaintracksSSEOptions(chain: Chain, chaintracks: ChaintracksClientApi): LiveIngestorChaintracksSSEOptions
|
|
6226
|
-
constructor(private readonly options: LiveIngestorChaintracksSSEOptions)
|
|
6227
|
-
async getHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6228
|
-
async startListening(liveHeaders: BlockHeader[]): Promise<void>
|
|
6229
|
-
stopListening(): void
|
|
6230
|
-
override async shutdown(): Promise<void>
|
|
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>
|
|
6231
6311
|
}
|
|
6232
6312
|
```
|
|
6233
6313
|
|
|
@@ -6242,18 +6322,18 @@ Reports new headers by polling periodically.
|
|
|
6242
6322
|
|
|
6243
6323
|
```ts
|
|
6244
6324
|
export class LiveIngestorWhatsOnChainPoll extends LiveIngestorBase {
|
|
6245
|
-
static createLiveIngestorWhatsOnChainOptions(chain: Chain): LiveIngestorWhatsOnChainOptions
|
|
6325
|
+
static createLiveIngestorWhatsOnChainOptions(chain: Chain): LiveIngestorWhatsOnChainOptions
|
|
6246
6326
|
idleWait: number;
|
|
6247
6327
|
retryWait: number;
|
|
6248
6328
|
retryWaitMax: number;
|
|
6249
6329
|
maxQueuedHeaders: number;
|
|
6250
6330
|
woc: WhatsOnChainServices;
|
|
6251
6331
|
done: boolean = false;
|
|
6252
|
-
constructor(options: LiveIngestorWhatsOnChainOptions)
|
|
6253
|
-
async getHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6254
|
-
async startListening(liveHeaders: BlockHeader[]): Promise<void>
|
|
6255
|
-
stopListening(): void
|
|
6256
|
-
override async shutdown(): Promise<void>
|
|
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>
|
|
6257
6337
|
}
|
|
6258
6338
|
```
|
|
6259
6339
|
|
|
@@ -6266,7 +6346,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6266
6346
|
|
|
6267
6347
|
```ts
|
|
6268
6348
|
export class LiveIngestorWhatsOnChainWs extends LiveIngestorBase {
|
|
6269
|
-
static createLiveIngestorWhatsOnChainOptions(chain: Chain): LiveIngestorWhatsOnChainOptions
|
|
6349
|
+
static createLiveIngestorWhatsOnChainOptions(chain: Chain): LiveIngestorWhatsOnChainOptions
|
|
6270
6350
|
idleWait: number;
|
|
6271
6351
|
retryWait: number;
|
|
6272
6352
|
retryWaitMax: number;
|
|
@@ -6274,11 +6354,11 @@ export class LiveIngestorWhatsOnChainWs extends LiveIngestorBase {
|
|
|
6274
6354
|
woc: WhatsOnChainServices;
|
|
6275
6355
|
stopNewListenersToken: StopListenerToken = { stop: undefined };
|
|
6276
6356
|
done = false;
|
|
6277
|
-
constructor(options: LiveIngestorWhatsOnChainOptions)
|
|
6278
|
-
async getHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6279
|
-
async startListening(liveHeaders: BlockHeader[]): Promise<void>
|
|
6280
|
-
stopListening(): void
|
|
6281
|
-
override async shutdown(): Promise<void>
|
|
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>
|
|
6282
6362
|
}
|
|
6283
6363
|
```
|
|
6284
6364
|
|
|
@@ -6298,21 +6378,43 @@ references before accepting a fallback result.
|
|
|
6298
6378
|
|
|
6299
6379
|
```ts
|
|
6300
6380
|
export class LocalChainTracker implements ChainTracker {
|
|
6301
|
-
constructor(options: LocalChainTrackerOptions)
|
|
6302
|
-
getMode(): LocalChainTrackerMode
|
|
6303
|
-
setMode(mode: LocalChainTrackerMode): void
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
async
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
async
|
|
6310
|
-
async
|
|
6381
|
+
constructor(options: LocalChainTrackerOptions)
|
|
6382
|
+
getMode(): LocalChainTrackerMode
|
|
6383
|
+
setMode(mode: LocalChainTrackerMode): void
|
|
6384
|
+
getVerificationContext(): string
|
|
6385
|
+
async getVerificationContextToken(signal?: AbortSignal): Promise<string>
|
|
6386
|
+
async dispose(): Promise<void>
|
|
6387
|
+
getStatus(): LocalChainTrackerStatus
|
|
6388
|
+
getLocalClient(): ChaintracksClientApi
|
|
6389
|
+
async currentHeight(): Promise<number>
|
|
6390
|
+
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
6391
|
+
async synchronize(): Promise<LocalChainTrackerStatus>
|
|
6392
|
+
async clearLocalData(): Promise<LocalChainTrackerStatus>
|
|
6393
|
+
async checkConsistency(): Promise<LocalChainTrackerStatus>
|
|
6311
6394
|
}
|
|
6312
6395
|
```
|
|
6313
6396
|
|
|
6314
6397
|
See also: [ChaintracksClientApi](./services.md#interface-chaintracksclientapi), [LocalChainTrackerMode](./services.md#type-localchaintrackermode), [LocalChainTrackerOptions](./services.md#interface-localchaintrackeroptions), [LocalChainTrackerStatus](./services.md#interface-localchaintrackerstatus)
|
|
6315
6398
|
|
|
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
|
+
|
|
6316
6418
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6317
6419
|
|
|
6318
6420
|
---
|
|
@@ -6326,10 +6428,10 @@ queue bounds prevent validation copies from consuming unbounded memory.
|
|
|
6326
6428
|
|
|
6327
6429
|
```ts
|
|
6328
6430
|
export class NodeBulkFileDataValidator implements BulkFileDataValidatorApi {
|
|
6329
|
-
constructor(options: NodeBulkFileDataValidatorOptions = {})
|
|
6330
|
-
async validate(request: BulkFileDataValidationRequest): Promise<BulkFileDataValidationResult>
|
|
6331
|
-
getStats(): BulkFileDataValidatorStats
|
|
6332
|
-
async destroy(): Promise<void>
|
|
6431
|
+
constructor(options: NodeBulkFileDataValidatorOptions = {})
|
|
6432
|
+
async validate(request: BulkFileDataValidationRequest): Promise<BulkFileDataValidationResult>
|
|
6433
|
+
getStats(): BulkFileDataValidatorStats
|
|
6434
|
+
async destroy(): Promise<void>
|
|
6333
6435
|
}
|
|
6334
6436
|
```
|
|
6335
6437
|
|
|
@@ -6349,11 +6451,11 @@ export default class SdkWhatsOnChain implements ChainTracker {
|
|
|
6349
6451
|
protected readonly URL: string;
|
|
6350
6452
|
protected readonly httpClient: HttpClient;
|
|
6351
6453
|
protected readonly requestTimeoutMsecs: number;
|
|
6352
|
-
constructor(network: "main" | "test" | "stn" | "ttn" | "tstn" = "main", config: LocalWhatsOnChainConfig = {})
|
|
6353
|
-
protected async request<T, Data = unknown>(url: string, options: HttpClientRequestOptions<Data>): Promise<HttpClientResponse<T>>
|
|
6354
|
-
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
6355
|
-
async currentHeight(): Promise<number>
|
|
6356
|
-
protected getHttpHeaders(): Record<string, string>
|
|
6454
|
+
constructor(network: "main" | "test" | "stn" | "ttn" | "tstn" = "main", config: LocalWhatsOnChainConfig = {})
|
|
6455
|
+
protected async request<T, Data = unknown>(url: string, options: HttpClientRequestOptions<Data>): Promise<HttpClientResponse<T>>
|
|
6456
|
+
async isValidRootForHeight(root: string, height: number): Promise<boolean>
|
|
6457
|
+
async currentHeight(): Promise<number>
|
|
6458
|
+
protected getHttpHeaders(): Record<string, string>
|
|
6357
6459
|
}
|
|
6358
6460
|
```
|
|
6359
6461
|
|
|
@@ -6362,7 +6464,7 @@ export default class SdkWhatsOnChain implements ChainTracker {
|
|
|
6362
6464
|
Constructs an instance of the WhatsOnChain ChainTracker.
|
|
6363
6465
|
|
|
6364
6466
|
```ts
|
|
6365
|
-
constructor(network: "main" | "test" | "stn" | "ttn" | "tstn" = "main", config: LocalWhatsOnChainConfig = {})
|
|
6467
|
+
constructor(network: "main" | "test" | "stn" | "ttn" | "tstn" = "main", config: LocalWhatsOnChainConfig = {})
|
|
6366
6468
|
```
|
|
6367
6469
|
|
|
6368
6470
|
Argument Details
|
|
@@ -6389,30 +6491,30 @@ export class ServiceCollection<T> {
|
|
|
6389
6491
|
constructor(public serviceName: string, services?: Array<{
|
|
6390
6492
|
name: string;
|
|
6391
6493
|
service: T;
|
|
6392
|
-
}>)
|
|
6494
|
+
}>)
|
|
6393
6495
|
add(s: {
|
|
6394
6496
|
name: string;
|
|
6395
6497
|
service: T;
|
|
6396
|
-
}): this
|
|
6397
|
-
remove(name: string): void
|
|
6398
|
-
get name(): string
|
|
6399
|
-
get service(): T
|
|
6400
|
-
getServiceToCall(i: number): ServiceToCall<T>
|
|
6401
|
-
get serviceToCall(): ServiceToCall<T>
|
|
6402
|
-
get allServicesToCall(): Array<ServiceToCall<T>>
|
|
6403
|
-
moveServiceToLast(stc: ServiceToCall<T>): void
|
|
6404
|
-
get allServices(): T[]
|
|
6405
|
-
get count(): number
|
|
6406
|
-
get index(): number
|
|
6407
|
-
reset(): void
|
|
6408
|
-
next(): number
|
|
6409
|
-
clone(): ServiceCollection<T>
|
|
6410
|
-
_addServiceCall(providerName: string, call: ServiceCall): ProviderCallHistory
|
|
6411
|
-
getDuration(since: Date | string): number
|
|
6412
|
-
addServiceCallSuccess(stc: ServiceToCall<T>, result?: string): void
|
|
6413
|
-
addServiceCallFailure(stc: ServiceToCall<T>, result?: string): void
|
|
6414
|
-
addServiceCallError(stc: ServiceToCall<T>, error: WalletError): void
|
|
6415
|
-
getServiceCallHistory(reset?: boolean): ServiceCallHistory
|
|
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
|
|
6416
6518
|
}
|
|
6417
6519
|
```
|
|
6418
6520
|
|
|
@@ -6429,7 +6531,7 @@ readonly since: Date
|
|
|
6429
6531
|
###### Method getServiceCallHistory
|
|
6430
6532
|
|
|
6431
6533
|
```ts
|
|
6432
|
-
getServiceCallHistory(reset?: boolean): ServiceCallHistory
|
|
6534
|
+
getServiceCallHistory(reset?: boolean): ServiceCallHistory
|
|
6433
6535
|
```
|
|
6434
6536
|
See also: [ServiceCallHistory](./client.md#interface-servicecallhistory)
|
|
6435
6537
|
|
|
@@ -6442,7 +6544,7 @@ A copy of current service call history
|
|
|
6442
6544
|
Used to de-prioritize a service call by moving it to the end of the list.
|
|
6443
6545
|
|
|
6444
6546
|
```ts
|
|
6445
|
-
moveServiceToLast(stc: ServiceToCall<T>): void
|
|
6547
|
+
moveServiceToLast(stc: ServiceToCall<T>): void
|
|
6446
6548
|
```
|
|
6447
6549
|
See also: [ServiceToCall](./services.md#interface-servicetocall)
|
|
6448
6550
|
|
|
@@ -6454,7 +6556,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6454
6556
|
```ts
|
|
6455
6557
|
export class Services implements WalletServices {
|
|
6456
6558
|
static readonly getStatusForTxidsBatchLimit = 20;
|
|
6457
|
-
static createDefaultOptions(chain: Chain): WalletServicesOptions
|
|
6559
|
+
static createDefaultOptions(chain: Chain): WalletServicesOptions
|
|
6458
6560
|
options: WalletServicesOptions;
|
|
6459
6561
|
whatsonchain: WhatsOnChain;
|
|
6460
6562
|
arcTaal: ARC;
|
|
@@ -6470,36 +6572,36 @@ export class Services implements WalletServices {
|
|
|
6470
6572
|
updateFiatExchangeRateServices!: ServiceCollection<UpdateFiatExchangeRateService>;
|
|
6471
6573
|
chain: Chain;
|
|
6472
6574
|
readonly telemetry: Telemetry;
|
|
6473
|
-
constructor(optionsOrChain: Chain | WalletServicesOptions)
|
|
6474
|
-
getServicesCallHistory(reset?: boolean): ServicesCallHistory
|
|
6475
|
-
async getChainTracker(): Promise<ChainTracker>
|
|
6476
|
-
async getBsvExchangeRate(): Promise<number>
|
|
6477
|
-
async getFiatExchangeRate(currency: FiatCurrencyCode, base?: FiatCurrencyCode): Promise<number>
|
|
6478
|
-
async getFiatExchangeRates(targetCurrencies: FiatCurrencyCode[]): Promise<FiatExchangeRates>
|
|
6479
|
-
get getProofsCount(): number
|
|
6480
|
-
get getRawTxsCount(): number
|
|
6481
|
-
get postBeefServicesCount(): number
|
|
6482
|
-
get getUtxoStatsCount(): number
|
|
6483
|
-
async getStatusForTxids(txids: string[], useNext?: boolean): Promise<GetStatusForTxidsResult>
|
|
6484
|
-
hashOutputScript(script: string): string
|
|
6485
|
-
async isUtxo(output: TableOutput): Promise<boolean>
|
|
6486
|
-
async getUtxoStatus(output: string, outputFormat?: GetUtxoStatusOutputFormat, outpoint?: string, useNext?: boolean, logger?: WalletLoggerInterface): Promise<GetUtxoStatusResult>
|
|
6487
|
-
async getScriptHashHistory(hash: string, useNext?: boolean, logger?: WalletLoggerInterface): Promise<GetScriptHashHistoryResult>
|
|
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>
|
|
6488
6590
|
postBeefMode: "PromiseAll" | "UntilSuccess" = "UntilSuccess";
|
|
6489
6591
|
postBeefUntilSuccessSoftTimeoutMs = 5000;
|
|
6490
6592
|
postBeefUntilSuccessSoftTimeoutPerKbMs = 50;
|
|
6491
6593
|
postBeefUntilSuccessSoftTimeoutMaxMs = 30000;
|
|
6492
|
-
async postBeef(beef: Beef, txids: string[], logger?: WalletLoggerInterface): Promise<PostBeefResult[]>
|
|
6493
|
-
async getRawTx(txid: string, useNext?: boolean): Promise<GetRawTxResult>
|
|
6494
|
-
async invokeChaintracksWithRetry<R>(method: () => Promise<R>, operation: string = "unknown"): Promise<R>
|
|
6495
|
-
async getHeaderForHeight(height: number): Promise<number[]>
|
|
6496
|
-
async getHeight(): Promise<number>
|
|
6497
|
-
async hashToHeader(hash: string): Promise<BlockHeader>
|
|
6498
|
-
async getMerklePath(txid: string, useNext?: boolean, logger?: WalletLoggerInterface): Promise<GetMerklePathResult>
|
|
6499
|
-
async getValidatedMerklePath(txid: string, validate: (result: GetMerklePathResult) => Promise<void>): Promise<GetMerklePathResult>
|
|
6500
|
-
async updateFiatExchangeRates(targetCurrencies: FiatCurrencyCode[], updateMsecs?: number): Promise<FiatExchangeRates>
|
|
6501
|
-
async nLockTimeIsFinal(tx: string | number[] | BsvTransaction | number): Promise<boolean>
|
|
6502
|
-
async getBeefForTxid(txid: string): Promise<Beef>
|
|
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>
|
|
6503
6605
|
}
|
|
6504
6606
|
```
|
|
6505
6607
|
|
|
@@ -6543,7 +6645,7 @@ postBeefUntilSuccessSoftTimeoutPerKbMs = 50
|
|
|
6543
6645
|
###### Method hashOutputScript
|
|
6544
6646
|
|
|
6545
6647
|
```ts
|
|
6546
|
-
hashOutputScript(script: string): string
|
|
6648
|
+
hashOutputScript(script: string): string
|
|
6547
6649
|
```
|
|
6548
6650
|
|
|
6549
6651
|
Returns
|
|
@@ -6565,9 +6667,9 @@ Allows multiple readers or one writer at a time.
|
|
|
6565
6667
|
|
|
6566
6668
|
```ts
|
|
6567
6669
|
export class SingleWriterMultiReaderLock {
|
|
6568
|
-
constructor(private readonly maxQueued = 4096)
|
|
6569
|
-
async withReadLock<T>(fn: () => Promise<T>): Promise<T>
|
|
6570
|
-
async withWriteLock<T>(fn: () => Promise<T>): Promise<T>
|
|
6670
|
+
constructor(private readonly maxQueued = 4096)
|
|
6671
|
+
async withReadLock<T>(fn: () => Promise<T>): Promise<T>
|
|
6672
|
+
async withWriteLock<T>(fn: () => Promise<T>): Promise<T>
|
|
6571
6673
|
}
|
|
6572
6674
|
```
|
|
6573
6675
|
|
|
@@ -6579,8 +6681,8 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6579
6681
|
```ts
|
|
6580
6682
|
export class WhatsOnChain extends WhatsOnChainNoServices {
|
|
6581
6683
|
services: Services;
|
|
6582
|
-
constructor(chain: Chain = "main", config: WalletToolboxWhatsOnChainConfig = {}, services?: Services)
|
|
6583
|
-
async getMerklePath(txid: string, services: WalletServices): Promise<GetMerklePathResult>
|
|
6684
|
+
constructor(chain: Chain = "main", config: WalletToolboxWhatsOnChainConfig = {}, services?: Services)
|
|
6685
|
+
async getMerklePath(txid: string, services: WalletServices): Promise<GetMerklePathResult>
|
|
6584
6686
|
}
|
|
6585
6687
|
```
|
|
6586
6688
|
|
|
@@ -6593,20 +6695,20 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6593
6695
|
|
|
6594
6696
|
```ts
|
|
6595
6697
|
export class WhatsOnChainNoServices extends SdkWhatsOnChain {
|
|
6596
|
-
constructor(chain: Chain = "main", config: WalletToolboxWhatsOnChainConfig = {})
|
|
6597
|
-
async getStatusForTxids(txids: string[]): Promise<GetStatusForTxidsResult>
|
|
6598
|
-
async getTxPropagation(txid: string): Promise<number>
|
|
6599
|
-
async getRawTx(txid: string): Promise<string | undefined>
|
|
6600
|
-
async getRawTxResult(txid: string): Promise<GetRawTxResult>
|
|
6601
|
-
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
6602
|
-
async postRawTx(rawTx: HexString): Promise<PostTxResultForTxid>
|
|
6603
|
-
async updateBsvExchangeRate(rate?: BsvExchangeRate, updateMsecs?: number): Promise<BsvExchangeRate>
|
|
6604
|
-
async getUtxoStatus(output: string, outputFormat?: GetUtxoStatusOutputFormat, outpoint?: string): Promise<GetUtxoStatusResult>
|
|
6605
|
-
async getScriptHashConfirmedHistory(hash: string): Promise<GetScriptHashHistoryResult>
|
|
6606
|
-
async getScriptHashUnconfirmedHistory(hash: string): Promise<GetScriptHashHistoryResult>
|
|
6607
|
-
async getScriptHashHistory(hash: string): Promise<GetScriptHashHistoryResult>
|
|
6608
|
-
async getBlockHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6609
|
-
async getChainInfo(): Promise<WocChainInfo>
|
|
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>
|
|
6610
6712
|
}
|
|
6611
6713
|
```
|
|
6612
6714
|
|
|
@@ -6635,7 +6737,7 @@ See also: [BlockHeader](./client.md#interface-blockheader), [BsvExchangeRate](./
|
|
|
6635
6737
|
}
|
|
6636
6738
|
|
|
6637
6739
|
```ts
|
|
6638
|
-
async getBlockHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6740
|
+
async getBlockHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6639
6741
|
```
|
|
6640
6742
|
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
6641
6743
|
|
|
@@ -6644,7 +6746,7 @@ See also: [BlockHeader](./client.md#interface-blockheader)
|
|
|
6644
6746
|
May return undefined for unmined transactions that are in the mempool.
|
|
6645
6747
|
|
|
6646
6748
|
```ts
|
|
6647
|
-
async getRawTx(txid: string): Promise<string | undefined>
|
|
6749
|
+
async getRawTx(txid: string): Promise<string | undefined>
|
|
6648
6750
|
```
|
|
6649
6751
|
|
|
6650
6752
|
Returns
|
|
@@ -6674,7 +6776,7 @@ result for an unknown txid:
|
|
|
6674
6776
|
[{"txid":"6815f8014db74eab8b7f75925c68929597f1d97efa970109d990824c25e5e62c","error":"unknown"}]
|
|
6675
6777
|
|
|
6676
6778
|
```ts
|
|
6677
|
-
async getStatusForTxids(txids: string[]): Promise<GetStatusForTxidsResult>
|
|
6779
|
+
async getStatusForTxids(txids: string[]): Promise<GetStatusForTxidsResult>
|
|
6678
6780
|
```
|
|
6679
6781
|
See also: [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresult)
|
|
6680
6782
|
|
|
@@ -6683,7 +6785,7 @@ See also: [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresul
|
|
|
6683
6785
|
2025-02-16 throwing internal server error 500.
|
|
6684
6786
|
|
|
6685
6787
|
```ts
|
|
6686
|
-
async getTxPropagation(txid: string): Promise<number>
|
|
6788
|
+
async getTxPropagation(txid: string): Promise<number>
|
|
6687
6789
|
```
|
|
6688
6790
|
|
|
6689
6791
|
###### Method postBeef
|
|
@@ -6693,14 +6795,14 @@ WhatsOnChain does not natively support a postBeef end-point aware of multiple tx
|
|
|
6693
6795
|
Send rawTx in `txids` order from beef.
|
|
6694
6796
|
|
|
6695
6797
|
```ts
|
|
6696
|
-
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
6798
|
+
async postBeef(beef: Beef, txids: string[]): Promise<PostBeefResult>
|
|
6697
6799
|
```
|
|
6698
6800
|
See also: [PostBeefResult](./client.md#interface-postbeefresult)
|
|
6699
6801
|
|
|
6700
6802
|
###### Method postRawTx
|
|
6701
6803
|
|
|
6702
6804
|
```ts
|
|
6703
|
-
async postRawTx(rawTx: HexString): Promise<PostTxResultForTxid>
|
|
6805
|
+
async postRawTx(rawTx: HexString): Promise<PostTxResultForTxid>
|
|
6704
6806
|
```
|
|
6705
6807
|
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
6706
6808
|
|
|
@@ -6720,7 +6822,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6720
6822
|
|
|
6721
6823
|
```ts
|
|
6722
6824
|
export class WhatsOnChainServices {
|
|
6723
|
-
static createWhatsOnChainServicesOptions(chain: Chain): WhatsOnChainServicesOptions
|
|
6825
|
+
static createWhatsOnChainServicesOptions(chain: Chain): WhatsOnChainServicesOptions
|
|
6724
6826
|
static readonly chainInfo: Array<WocChainInfo | undefined> = [];
|
|
6725
6827
|
static readonly chainInfoTime: Array<Date | undefined> = [];
|
|
6726
6828
|
static readonly chainInfoMsecs: number[] = [];
|
|
@@ -6728,13 +6830,13 @@ export class WhatsOnChainServices {
|
|
|
6728
6830
|
chain: Chain;
|
|
6729
6831
|
woc: WhatsOnChain;
|
|
6730
6832
|
public readonly options: WhatsOnChainServicesOptions;
|
|
6731
|
-
constructor(options: WhatsOnChainServicesOptions)
|
|
6732
|
-
async getHeaderByHash(hash: string): Promise<BlockHeader | undefined>
|
|
6733
|
-
async getChainInfo(): Promise<WocChainInfo>
|
|
6734
|
-
async getChainTipHeight(): Promise<number>
|
|
6735
|
-
async getChainTipHash(): Promise<string>
|
|
6736
|
-
async getHeaders(fetch?: ChaintracksFetchApi): Promise<WocGetHeadersHeader[]>
|
|
6737
|
-
async getHeaderByteFileLinks(neededRange: HeightRange, fetch?: ChaintracksFetchApi): Promise<GetHeaderByteFileLinksResult[]>
|
|
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[]>
|
|
6738
6840
|
}
|
|
6739
6841
|
```
|
|
6740
6842
|
|
|
@@ -6743,7 +6845,7 @@ See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#
|
|
|
6743
6845
|
###### Method getHeaders
|
|
6744
6846
|
|
|
6745
6847
|
```ts
|
|
6746
|
-
async getHeaders(fetch?: ChaintracksFetchApi): Promise<WocGetHeadersHeader[]>
|
|
6848
|
+
async getHeaders(fetch?: ChaintracksFetchApi): Promise<WocGetHeadersHeader[]>
|
|
6747
6849
|
```
|
|
6748
6850
|
See also: [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi), [WocGetHeadersHeader](./services.md#interface-wocgetheadersheader)
|
|
6749
6851
|
|
|
@@ -6758,29 +6860,30 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6758
6860
|
|
|
6759
6861
|
| | | |
|
|
6760
6862
|
| --- | --- | --- |
|
|
6761
|
-
| [WocHeadersBulkListener](#function-wocheadersbulklistener) | [
|
|
6762
|
-
| [WocHeadersBulkListener_test](#function-wocheadersbulklistener_test) | [
|
|
6763
|
-
| [WocHeadersLiveListener](#function-wocheaderslivelistener) | [
|
|
6764
|
-
| [WocHeadersLiveListener_test](#function-wocheaderslivelistener_test) | [
|
|
6765
|
-
| [addWork](#function-addwork) | [
|
|
6766
|
-
| [arcDefaultUrl](#function-arcdefaulturl) | [
|
|
6767
|
-
| [arcGorillaPoolUrl](#function-arcgorillapoolurl) | [
|
|
6768
|
-
| [arcadeDefaultUrl](#function-arcadedefaulturl) | [
|
|
6769
|
-
| [authenticateMerklePathResult](#function-authenticatemerklepathresult) | [
|
|
6770
|
-
| [blockHash](#function-blockhash) | [
|
|
6771
|
-
| [buildChaintracksOptionsWithIngestors](#function-buildchaintracksoptionswithingestors) | [
|
|
6772
|
-
| [classifyArcadeRejection](#function-classifyarcaderejection) | [
|
|
6773
|
-
| [classifyMerklePathResponse](#function-classifymerklepathresponse) | [
|
|
6774
|
-
| [classifyOutputUtxo](#function-classifyoutpututxo) | [
|
|
6775
|
-
| [containsControlCharacter](#function-containscontrolcharacter) | [
|
|
6776
|
-
| [convertBitsToTarget](#function-convertbitstotarget) | [
|
|
6777
|
-
| [convertBitsToWork](#function-convertbitstowork) | [
|
|
6778
|
-
| [convertBufferToUint32](#function-convertbuffertouint32) | [
|
|
6779
|
-
| [convertUint32ToBuffer](#function-convertuint32tobuffer) | [
|
|
6780
|
-
| [convertWocToBlockHeaderHex](#function-convertwoctoblockheaderhex) | [
|
|
6781
|
-
| [
|
|
6782
|
-
| [
|
|
6783
|
-
| [
|
|
6863
|
+
| [WocHeadersBulkListener](#function-wocheadersbulklistener) | [getExchangeRatesIo](#function-getexchangeratesio) | [serializeBaseBlockHeader](#function-serializebaseblockheader) |
|
|
6864
|
+
| [WocHeadersBulkListener_test](#function-wocheadersbulklistener_test) | [getWhatsOnChainBlockHeaderByHash](#function-getwhatsonchainblockheaderbyhash) | [serializeBaseBlockHeaders](#function-serializebaseblockheaders) |
|
|
6865
|
+
| [WocHeadersLiveListener](#function-wocheaderslivelistener) | [handlePostRawTxErrorResponse](#function-handlepostrawtxerrorresponse) | [sha256HashOfBinaryFile](#function-sha256hashofbinaryfile) |
|
|
6866
|
+
| [WocHeadersLiveListener_test](#function-wocheaderslivelistener_test) | [handleScriptHashHistoryCatch](#function-handlescripthashhistorycatch) | [snapshotMerklePathResult](#function-snapshotmerklepathresult) |
|
|
6867
|
+
| [addWork](#function-addwork) | [handleScriptHashHistoryResponse](#function-handlescripthashhistoryresponse) | [snapshotPostBeefRequest](#function-snapshotpostbeefrequest) |
|
|
6868
|
+
| [arcDefaultUrl](#function-arcdefaulturl) | [handleUtxoConnReset](#function-handleutxoconnreset) | [startChaintracks](#function-startchaintracks) |
|
|
6869
|
+
| [arcGorillaPoolUrl](#function-arcgorillapoolurl) | [isArcAcceptedTxStatus](#function-isarcacceptedtxstatus) | [stnArcadeUrl](#function-stnarcadeurl) |
|
|
6870
|
+
| [arcadeDefaultUrl](#function-arcadedefaulturl) | [isArcDoubleSpendTxStatus](#function-isarcdoublespendtxstatus) | [stnChaintracksUrl](#function-stnchaintracksurl) |
|
|
6871
|
+
| [authenticateMerklePathResult](#function-authenticatemerklepathresult) | [isArcInvalidTxStatus](#function-isarcinvalidtxstatus) | [subWork](#function-subwork) |
|
|
6872
|
+
| [blockHash](#function-blockhash) | [isArcServiceErrorStatus](#function-isarcserviceerrorstatus) | [swapByteOrder](#function-swapbyteorder) |
|
|
6873
|
+
| [buildChaintracksOptionsWithIngestors](#function-buildchaintracksoptionswithingestors) | [isBaseBlockHeader](#function-isbaseblockheader) | [toBinaryBaseBlockHeader](#function-tobinarybaseblockheader) |
|
|
6874
|
+
| [classifyArcadeRejection](#function-classifyarcaderejection) | [isBlockHeader](#function-isblockheader) | [toDefaultChaintracksArguments](#function-todefaultchaintracksarguments) |
|
|
6875
|
+
| [classifyMerklePathResponse](#function-classifymerklepathresponse) | [isKnownValidBulkHeaderFile](#function-isknownvalidbulkheaderfile) | [toDefaultKnexChaintracksArguments](#function-todefaultknexchaintracksarguments) |
|
|
6876
|
+
| [classifyOutputUtxo](#function-classifyoutpututxo) | [isLive](#function-islive) | [tstnArcadeUrl](#function-tstnarcadeurl) |
|
|
6877
|
+
| [containsControlCharacter](#function-containscontrolcharacter) | [isLiveBlockHeader](#function-isliveblockheader) | [tstnChaintracksUrl](#function-tstnchaintracksurl) |
|
|
6878
|
+
| [convertBitsToTarget](#function-convertbitstotarget) | [isMoreWork](#function-ismorework) | [updateChaintracksFiatExchangeRates](#function-updatechaintracksfiatexchangerates) |
|
|
6879
|
+
| [convertBitsToWork](#function-convertbitstowork) | [isValidFiatRate](#function-isvalidfiatrate) | [updateExchangeratesapi](#function-updateexchangeratesapi) |
|
|
6880
|
+
| [convertBufferToUint32](#function-convertbuffertouint32) | [makeMerklePathNote](#function-makemerklepathnote) | [validBulkHeaderFilesByFileHash](#function-validbulkheaderfilesbyfilehash) |
|
|
6881
|
+
| [convertUint32ToBuffer](#function-convertuint32tobuffer) | [makePostBeefServiceError](#function-makepostbeefserviceerror) | [validateAgainstDirtyHashes](#function-validateagainstdirtyhashes) |
|
|
6882
|
+
| [convertWocToBlockHeaderHex](#function-convertwoctoblockheaderhex) | [mapWithConcurrency](#function-mapwithconcurrency) | [validateArcTxData](#function-validatearctxdata) |
|
|
6883
|
+
| [copyMerklePath](#function-copymerklepath) | [normalizeArcProviderConfig](#function-normalizearcproviderconfig) | [validateBaseBlockHeaderFormat](#function-validatebaseblockheaderformat) |
|
|
6884
|
+
| [copyRawTransactionBytes](#function-copyrawtransactionbytes) | [normalizeBulkFileDataValidationRequest](#function-normalizebulkfiledatavalidationrequest) | [validateBufferOfHeaders](#function-validatebufferofheaders) |
|
|
6885
|
+
| [copyValidatedBlockHeader](#function-copyvalidatedblockheader) | [normalizeBulkHeaderFileInfo](#function-normalizebulkheaderfileinfo) | [validateBulkFileData](#function-validatebulkfiledata) |
|
|
6886
|
+
| [createAndStartDefaultChaintracks](#function-createandstartdefaultchaintracks) | [normalizeBulkHeaderFileSequence](#function-normalizebulkheaderfilesequence) | [validateCanonicalMerklePathResult](#function-validatecanonicalmerklepathresult) |
|
|
6784
6887
|
| [createAndStartDefaultKnexChaintracks](#function-createandstartdefaultknexchaintracks) | [normalizeBulkHeaderFilesInfo](#function-normalizebulkheaderfilesinfo) | [validateGenesisHeader](#function-validategenesisheader) |
|
|
6785
6888
|
| [createChaintracksInitialSchema](#function-createchaintracksinitialschema) | [normalizeFiatCurrencies](#function-normalizefiatcurrencies) | [validateHeaderDifficulty](#function-validateheaderdifficulty) |
|
|
6786
6889
|
| [createDefaultBulkFileDataManager](#function-createdefaultbulkfiledatamanager) | [normalizeFiatCurrency](#function-normalizefiatcurrency) | [validateHeaderFormat](#function-validateheaderformat) |
|
|
@@ -6801,7 +6904,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6801
6904
|
| [genesisBuffer](#function-genesisbuffer) | [resolveDefaultChaintracksArguments](#function-resolvedefaultchaintracksarguments) | [writeUInt32BE](#function-writeuint32be) |
|
|
6802
6905
|
| [genesisHeader](#function-genesisheader) | [resolveDefaultKnexChaintracksArguments](#function-resolvedefaultknexchaintracksarguments) | [writeUInt32LE](#function-writeuint32le) |
|
|
6803
6906
|
| [getBeefForTxid](#function-getbeeffortxid) | [safeDiagnostic](#function-safediagnostic) | |
|
|
6804
|
-
| [
|
|
6907
|
+
| [getCanonicalMerklePath](#function-getcanonicalmerklepath) | [selectBulkHeaderFiles](#function-selectbulkheaderfiles) | |
|
|
6805
6908
|
|
|
6806
6909
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
6807
6910
|
|
|
@@ -6821,7 +6924,7 @@ export async function WocHeadersBulkListener(...[fromHeight, toHeight, enqueue,
|
|
|
6821
6924
|
chain: Chain,
|
|
6822
6925
|
logger?: (...args: any[]) => void,
|
|
6823
6926
|
idleWait?: number
|
|
6824
|
-
]): Promise<boolean>
|
|
6927
|
+
]): Promise<boolean>
|
|
6825
6928
|
```
|
|
6826
6929
|
|
|
6827
6930
|
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [StopListenerToken](./services.md#interface-stoplistenertoken), [logger](./client.md#variable-logger)
|
|
@@ -6865,7 +6968,7 @@ v2
|
|
|
6865
6968
|
}
|
|
6866
6969
|
|
|
6867
6970
|
```ts
|
|
6868
|
-
export async function WocHeadersBulkListener_test(): Promise<void>
|
|
6971
|
+
export async function WocHeadersBulkListener_test(): Promise<void>
|
|
6869
6972
|
```
|
|
6870
6973
|
|
|
6871
6974
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -6876,7 +6979,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6876
6979
|
High speed WebSocket based based new block header listener
|
|
6877
6980
|
|
|
6878
6981
|
```ts
|
|
6879
|
-
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>
|
|
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>
|
|
6880
6983
|
```
|
|
6881
6984
|
|
|
6882
6985
|
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain), [StopListenerToken](./services.md#interface-stoplistenertoken)
|
|
@@ -6904,7 +7007,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6904
7007
|
##### Function: WocHeadersLiveListener_test
|
|
6905
7008
|
|
|
6906
7009
|
```ts
|
|
6907
|
-
export async function WocHeadersLiveListener_test(): Promise<void>
|
|
7010
|
+
export async function WocHeadersLiveListener_test(): Promise<void>
|
|
6908
7011
|
```
|
|
6909
7012
|
|
|
6910
7013
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -6915,7 +7018,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6915
7018
|
Add two Buffer encoded chainwork values
|
|
6916
7019
|
|
|
6917
7020
|
```ts
|
|
6918
|
-
export function addWork(work1: string, work2: string): string
|
|
7021
|
+
export function addWork(work1: string, work2: string): string
|
|
6919
7022
|
```
|
|
6920
7023
|
|
|
6921
7024
|
Returns
|
|
@@ -6928,7 +7031,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6928
7031
|
##### Function: arcDefaultUrl
|
|
6929
7032
|
|
|
6930
7033
|
```ts
|
|
6931
|
-
export function arcDefaultUrl(chain: Chain): string
|
|
7034
|
+
export function arcDefaultUrl(chain: Chain): string
|
|
6932
7035
|
```
|
|
6933
7036
|
|
|
6934
7037
|
See also: [Chain](./client.md#type-chain)
|
|
@@ -6939,7 +7042,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6939
7042
|
##### Function: arcGorillaPoolUrl
|
|
6940
7043
|
|
|
6941
7044
|
```ts
|
|
6942
|
-
export function arcGorillaPoolUrl(chain: Chain): string | undefined
|
|
7045
|
+
export function arcGorillaPoolUrl(chain: Chain): string | undefined
|
|
6943
7046
|
```
|
|
6944
7047
|
|
|
6945
7048
|
See also: [Chain](./client.md#type-chain)
|
|
@@ -6953,7 +7056,7 @@ Default Arcade (bsv-blockchain/arcade) endpoint per chain.
|
|
|
6953
7056
|
Returns undefined when no public default is known for the chain.
|
|
6954
7057
|
|
|
6955
7058
|
```ts
|
|
6956
|
-
export function arcadeDefaultUrl(chain: Chain): string | undefined
|
|
7059
|
+
export function arcadeDefaultUrl(chain: Chain): string | undefined
|
|
6957
7060
|
```
|
|
6958
7061
|
|
|
6959
7062
|
See also: [Chain](./client.md#type-chain)
|
|
@@ -6964,7 +7067,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
6964
7067
|
##### Function: authenticateMerklePathResult
|
|
6965
7068
|
|
|
6966
7069
|
```ts
|
|
6967
|
-
export async function authenticateMerklePathResult(requestedTxid: unknown, result: GetMerklePathResult, validator: MerkleRootValidator, requireProofOfWork = false, requireHeaderFormat = true): Promise<ValidatedMerklePathResult>
|
|
7070
|
+
export async function authenticateMerklePathResult(requestedTxid: unknown, result: GetMerklePathResult, validator: MerkleRootValidator, requireProofOfWork = false, requireHeaderFormat = true): Promise<ValidatedMerklePathResult>
|
|
6968
7071
|
```
|
|
6969
7072
|
|
|
6970
7073
|
See also: [GetMerklePathResult](./client.md#interface-getmerklepathresult), [MerkleRootValidator](./services.md#interface-merklerootvalidator), [ValidatedMerklePathResult](./services.md#interface-validatedmerklepathresult)
|
|
@@ -7006,7 +7109,7 @@ Builds the shared portion of ChaintracksOptions that all storage backends
|
|
|
7006
7109
|
The caller is responsible for providing the storage implementation.
|
|
7007
7110
|
|
|
7008
7111
|
```ts
|
|
7009
|
-
export function buildChaintracksOptionsWithIngestors(params: ChaintracksIngestorParams, storage: ChaintracksOptions["storage"]): ChaintracksOptions
|
|
7112
|
+
export function buildChaintracksOptionsWithIngestors(params: ChaintracksIngestorParams, storage: ChaintracksOptions["storage"]): ChaintracksOptions
|
|
7010
7113
|
```
|
|
7011
7114
|
|
|
7012
7115
|
See also: [ChaintracksIngestorParams](./services.md#interface-chaintracksingestorparams), [ChaintracksOptions](./services.md#interface-chaintracksoptions)
|
|
@@ -7021,7 +7124,7 @@ one place prevents a provider from calling a rejection "unknown" while the
|
|
|
7021
7124
|
monitor's event path calls the same status terminal.
|
|
7022
7125
|
|
|
7023
7126
|
```ts
|
|
7024
|
-
export function classifyArcadeRejection(event: ArcadeLifecycleStatus): ArcadeRejectionClassification
|
|
7127
|
+
export function classifyArcadeRejection(event: ArcadeLifecycleStatus): ArcadeRejectionClassification
|
|
7025
7128
|
```
|
|
7026
7129
|
|
|
7027
7130
|
See also: [ArcadeLifecycleStatus](./services.md#interface-arcadelifecyclestatus), [ArcadeRejectionClassification](./services.md#interface-arcaderejectionclassification)
|
|
@@ -7037,7 +7140,7 @@ Returns `'retry'` when the request was rate-limited and the caller should retry,
|
|
|
7037
7140
|
`'notFound'` for 404, `'badStatus'` for other non-200 codes.
|
|
7038
7141
|
|
|
7039
7142
|
```ts
|
|
7040
|
-
export function classifyMerklePathResponse(status: number, statusText: string, retry: number): "retry" | "notFound" | "badStatus" | "ok"
|
|
7143
|
+
export function classifyMerklePathResponse(status: number, statusText: string, retry: number): "retry" | "notFound" | "badStatus" | "ok"
|
|
7041
7144
|
```
|
|
7042
7145
|
|
|
7043
7146
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7051,7 +7154,7 @@ batch callers can finish classifying every candidate before deciding whether
|
|
|
7051
7154
|
a destructive operation is safe.
|
|
7052
7155
|
|
|
7053
7156
|
```ts
|
|
7054
|
-
export async function classifyOutputUtxo(services: UtxoServices, output: TableOutput): Promise<OutputUtxoClassification>
|
|
7157
|
+
export async function classifyOutputUtxo(services: UtxoServices, output: TableOutput): Promise<OutputUtxoClassification>
|
|
7055
7158
|
```
|
|
7056
7159
|
|
|
7057
7160
|
See also: [OutputUtxoClassification](./services.md#interface-outpututxoclassification), [TableOutput](./storage.md#interface-tableoutput)
|
|
@@ -7062,7 +7165,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7062
7165
|
##### Function: containsControlCharacter
|
|
7063
7166
|
|
|
7064
7167
|
```ts
|
|
7065
|
-
export function containsControlCharacter(value: string): boolean
|
|
7168
|
+
export function containsControlCharacter(value: string): boolean
|
|
7066
7169
|
```
|
|
7067
7170
|
|
|
7068
7171
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7073,7 +7176,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7073
7176
|
Computes "target" value for 4 byte Bitcoin block header "bits" value.
|
|
7074
7177
|
|
|
7075
7178
|
```ts
|
|
7076
|
-
export function convertBitsToTarget(bits: number | number[]): BigNumber
|
|
7179
|
+
export function convertBitsToTarget(bits: number | number[]): BigNumber
|
|
7077
7180
|
```
|
|
7078
7181
|
|
|
7079
7182
|
Returns
|
|
@@ -7093,7 +7196,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7093
7196
|
Computes "chainWork" value for 4 byte Bitcoin block header "bits" value.
|
|
7094
7197
|
|
|
7095
7198
|
```ts
|
|
7096
|
-
export function convertBitsToWork(bits: number | number[]): string
|
|
7199
|
+
export function convertBitsToWork(bits: number | number[]): string
|
|
7097
7200
|
```
|
|
7098
7201
|
|
|
7099
7202
|
Returns
|
|
@@ -7175,18 +7278,31 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7175
7278
|
##### Function: convertWocToBlockHeaderHex
|
|
7176
7279
|
|
|
7177
7280
|
```ts
|
|
7178
|
-
export function convertWocToBlockHeaderHex(woc: WocHeader): BlockHeader
|
|
7281
|
+
export function convertWocToBlockHeaderHex(woc: WocHeader): BlockHeader
|
|
7179
7282
|
```
|
|
7180
7283
|
|
|
7181
7284
|
See also: [BlockHeader](./client.md#interface-blockheader), [WocHeader](./services.md#interface-wocheader)
|
|
7182
7285
|
|
|
7183
7286
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7184
7287
|
|
|
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
|
+
|
|
7185
7301
|
---
|
|
7186
7302
|
##### Function: copyRawTransactionBytes
|
|
7187
7303
|
|
|
7188
7304
|
```ts
|
|
7189
|
-
export function copyRawTransactionBytes(value: unknown, name = "rawTx"): number[]
|
|
7305
|
+
export function copyRawTransactionBytes(value: unknown, name = "rawTx"): number[]
|
|
7190
7306
|
```
|
|
7191
7307
|
|
|
7192
7308
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7195,7 +7311,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7195
7311
|
##### Function: copyValidatedBlockHeader
|
|
7196
7312
|
|
|
7197
7313
|
```ts
|
|
7198
|
-
export function copyValidatedBlockHeader(value: unknown, requireProofOfWork = false, requireHeaderFormat = true): BlockHeader
|
|
7314
|
+
export function copyValidatedBlockHeader(value: unknown, requireProofOfWork = false, requireHeaderFormat = true): BlockHeader
|
|
7199
7315
|
```
|
|
7200
7316
|
|
|
7201
7317
|
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
@@ -7206,7 +7322,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7206
7322
|
##### Function: createAndStartDefaultChaintracks
|
|
7207
7323
|
|
|
7208
7324
|
```ts
|
|
7209
|
-
export function createAndStartDefaultChaintracks<TStorage extends ChaintracksOptions["storage"]>(args: DefaultChaintracksArguments, createOptions: (...args: DefaultChaintracksArguments) => ChaintracksOptions): CreatedChaintracks<TStorage>
|
|
7325
|
+
export function createAndStartDefaultChaintracks<TStorage extends ChaintracksOptions["storage"]>(args: DefaultChaintracksArguments, createOptions: (...args: DefaultChaintracksArguments) => ChaintracksOptions): CreatedChaintracks<TStorage>
|
|
7210
7326
|
```
|
|
7211
7327
|
|
|
7212
7328
|
See also: [ChaintracksOptions](./services.md#interface-chaintracksoptions), [CreatedChaintracks](./services.md#interface-createdchaintracks), [DefaultChaintracksArguments](./services.md#type-defaultchaintracksarguments)
|
|
@@ -7217,7 +7333,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7217
7333
|
##### Function: createAndStartDefaultKnexChaintracks
|
|
7218
7334
|
|
|
7219
7335
|
```ts
|
|
7220
|
-
export function createAndStartDefaultKnexChaintracks<TStorage extends ChaintracksOptions["storage"]>(args: DefaultKnexChaintracksArguments, createOptions: (...args: DefaultKnexChaintracksArguments) => ChaintracksOptions): CreatedChaintracks<TStorage>
|
|
7336
|
+
export function createAndStartDefaultKnexChaintracks<TStorage extends ChaintracksOptions["storage"]>(args: DefaultKnexChaintracksArguments, createOptions: (...args: DefaultKnexChaintracksArguments) => ChaintracksOptions): CreatedChaintracks<TStorage>
|
|
7221
7337
|
```
|
|
7222
7338
|
|
|
7223
7339
|
See also: [ChaintracksOptions](./services.md#interface-chaintracksoptions), [CreatedChaintracks](./services.md#interface-createdchaintracks), [DefaultKnexChaintracksArguments](./services.md#type-defaultknexchaintracksarguments)
|
|
@@ -7230,7 +7346,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7230
7346
|
Builds the current Chaintracks schema. Exported so dialect DDL can be regression-tested without a live server.
|
|
7231
7347
|
|
|
7232
7348
|
```ts
|
|
7233
|
-
export function createChaintracksInitialSchema(knex: Knex): Knex.SchemaBuilder
|
|
7349
|
+
export function createChaintracksInitialSchema(knex: Knex): Knex.SchemaBuilder
|
|
7234
7350
|
```
|
|
7235
7351
|
|
|
7236
7352
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7239,7 +7355,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7239
7355
|
##### Function: createDefaultBulkFileDataManager
|
|
7240
7356
|
|
|
7241
7357
|
```ts
|
|
7242
|
-
export function createDefaultBulkFileDataManager(params: ResolvedDefaultChaintracksParams): BulkFileDataManager
|
|
7358
|
+
export function createDefaultBulkFileDataManager(params: ResolvedDefaultChaintracksParams): BulkFileDataManager
|
|
7243
7359
|
```
|
|
7244
7360
|
|
|
7245
7361
|
See also: [BulkFileDataManager](./services.md#class-bulkfiledatamanager), [ResolvedDefaultChaintracksParams](./services.md#interface-resolveddefaultchaintracksparams)
|
|
@@ -7266,7 +7382,7 @@ check proves it), this branch can be removed and browsers can share the v2
|
|
|
7266
7382
|
default. Node runtimes are unchanged.
|
|
7267
7383
|
|
|
7268
7384
|
```ts
|
|
7269
|
-
export function createDefaultChaintracksClient(chain: Exclude<Chain, "mock">): ChaintracksClientApi
|
|
7385
|
+
export function createDefaultChaintracksClient(chain: Exclude<Chain, "mock">): ChaintracksClientApi
|
|
7270
7386
|
```
|
|
7271
7387
|
|
|
7272
7388
|
See also: [Chain](./client.md#type-chain), [ChaintracksClientApi](./services.md#interface-chaintracksclientapi)
|
|
@@ -7277,7 +7393,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7277
7393
|
##### Function: createDefaultChaintracksStorageOptions
|
|
7278
7394
|
|
|
7279
7395
|
```ts
|
|
7280
|
-
export function createDefaultChaintracksStorageOptions(params: ResolvedDefaultChaintracksParams)
|
|
7396
|
+
export function createDefaultChaintracksStorageOptions(params: ResolvedDefaultChaintracksParams)
|
|
7281
7397
|
```
|
|
7282
7398
|
|
|
7283
7399
|
See also: [ResolvedDefaultChaintracksParams](./services.md#interface-resolveddefaultchaintracksparams)
|
|
@@ -7288,7 +7404,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7288
7404
|
##### Function: createDefaultIdbChaintracksOptions
|
|
7289
7405
|
|
|
7290
7406
|
```ts
|
|
7291
|
-
export function createDefaultIdbChaintracksOptions(...args: DefaultChaintracksArguments): ChaintracksOptions
|
|
7407
|
+
export function createDefaultIdbChaintracksOptions(...args: DefaultChaintracksArguments): ChaintracksOptions
|
|
7292
7408
|
```
|
|
7293
7409
|
|
|
7294
7410
|
See also: [ChaintracksOptions](./services.md#interface-chaintracksoptions), [DefaultChaintracksArguments](./services.md#type-defaultchaintracksarguments)
|
|
@@ -7299,7 +7415,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7299
7415
|
##### Function: createDefaultKnexChaintracksOptions
|
|
7300
7416
|
|
|
7301
7417
|
```ts
|
|
7302
|
-
export function createDefaultKnexChaintracksOptions(...args: DefaultKnexChaintracksArguments): ChaintracksOptions
|
|
7418
|
+
export function createDefaultKnexChaintracksOptions(...args: DefaultKnexChaintracksArguments): ChaintracksOptions
|
|
7303
7419
|
```
|
|
7304
7420
|
|
|
7305
7421
|
See also: [ChaintracksOptions](./services.md#interface-chaintracksoptions), [DefaultKnexChaintracksArguments](./services.md#type-defaultknexchaintracksarguments)
|
|
@@ -7315,7 +7431,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7315
7431
|
##### Function: createDefaultNoDbChaintracksOptions
|
|
7316
7432
|
|
|
7317
7433
|
```ts
|
|
7318
|
-
export function createDefaultNoDbChaintracksOptions(...args: DefaultChaintracksArguments): ChaintracksOptions
|
|
7434
|
+
export function createDefaultNoDbChaintracksOptions(...args: DefaultChaintracksArguments): ChaintracksOptions
|
|
7319
7435
|
```
|
|
7320
7436
|
|
|
7321
7437
|
See also: [ChaintracksOptions](./services.md#interface-chaintracksoptions), [DefaultChaintracksArguments](./services.md#type-defaultchaintracksarguments)
|
|
@@ -7338,7 +7454,7 @@ export function createDefaultWalletServicesOptions(...[chain, arcCallbackUrl, ar
|
|
|
7338
7454
|
arcadeUrl?: string,
|
|
7339
7455
|
arcadeApiKey?: string,
|
|
7340
7456
|
arcadeCallbackToken?: string
|
|
7341
|
-
]): WalletServicesOptions
|
|
7457
|
+
]): WalletServicesOptions
|
|
7342
7458
|
```
|
|
7343
7459
|
|
|
7344
7460
|
See also: [Chain](./client.md#type-chain), [ChaintracksClientApi](./services.md#interface-chaintracksclientapi), [WalletServicesOptions](./client.md#interface-walletservicesoptions)
|
|
@@ -7356,7 +7472,7 @@ export async function createIdbChaintracks(...args: DefaultChaintracksArguments)
|
|
|
7356
7472
|
storage: ChaintracksStorageIdb;
|
|
7357
7473
|
chaintracks: Chaintracks;
|
|
7358
7474
|
available: Promise<void>;
|
|
7359
|
-
}>
|
|
7475
|
+
}>
|
|
7360
7476
|
```
|
|
7361
7477
|
|
|
7362
7478
|
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)
|
|
@@ -7374,7 +7490,7 @@ export async function createKnexChaintracks(...args: DefaultKnexChaintracksArgum
|
|
|
7374
7490
|
storage: ChaintracksStorageKnex;
|
|
7375
7491
|
chaintracks: Chaintracks;
|
|
7376
7492
|
available: Promise<void>;
|
|
7377
|
-
}>
|
|
7493
|
+
}>
|
|
7378
7494
|
```
|
|
7379
7495
|
|
|
7380
7496
|
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)
|
|
@@ -7392,7 +7508,7 @@ export async function createNoDbChaintracks(...args: DefaultChaintracksArguments
|
|
|
7392
7508
|
storage: ChaintracksStorageNoDb;
|
|
7393
7509
|
chaintracks: Chaintracks;
|
|
7394
7510
|
available: Promise<void>;
|
|
7395
|
-
}>
|
|
7511
|
+
}>
|
|
7396
7512
|
```
|
|
7397
7513
|
|
|
7398
7514
|
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)
|
|
@@ -7403,7 +7519,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7403
7519
|
##### Function: createStopHandler
|
|
7404
7520
|
|
|
7405
7521
|
```ts
|
|
7406
|
-
export function createStopHandler(markOk: () => void, isOpen: () => boolean, markClosed: () => void, close: () => void, markDone: () => void): () => void
|
|
7522
|
+
export function createStopHandler(markOk: () => void, isOpen: () => boolean, markClosed: () => void, close: () => void, markDone: () => void): () => void
|
|
7407
7523
|
```
|
|
7408
7524
|
|
|
7409
7525
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7416,7 +7532,7 @@ Deserialize a BaseBlockHeader from an 80 byte buffer
|
|
|
7416
7532
|
```ts
|
|
7417
7533
|
export function deserializeBaseBlockHeader(buffer: number[] | Uint8Array, offset = 0): BaseBlockHeader {
|
|
7418
7534
|
validateByteWindow(buffer, offset, 80);
|
|
7419
|
-
const reader =
|
|
7535
|
+
const reader = ReaderUint8Array.makeReader(buffer, offset);
|
|
7420
7536
|
const header: BaseBlockHeader = {
|
|
7421
7537
|
version: reader.readUInt32LE(),
|
|
7422
7538
|
previousHash: asString(reader.read(32).reverse()),
|
|
@@ -7437,7 +7553,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7437
7553
|
##### Function: deserializeBaseBlockHeaders
|
|
7438
7554
|
|
|
7439
7555
|
```ts
|
|
7440
|
-
export function deserializeBaseBlockHeaders(buffer: number[] | Uint8Array, offset = 0, count?: number | undefined): BaseBlockHeader[]
|
|
7556
|
+
export function deserializeBaseBlockHeaders(buffer: number[] | Uint8Array, offset = 0, count?: number | undefined): BaseBlockHeader[]
|
|
7441
7557
|
```
|
|
7442
7558
|
|
|
7443
7559
|
See also: [BaseBlockHeader](./client.md#interface-baseblockheader)
|
|
@@ -7448,7 +7564,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7448
7564
|
##### Function: deserializeBlockHeader
|
|
7449
7565
|
|
|
7450
7566
|
```ts
|
|
7451
|
-
export function deserializeBlockHeader(buffer: number[] | Uint8Array, height: number, offset = 0): BlockHeader
|
|
7567
|
+
export function deserializeBlockHeader(buffer: number[] | Uint8Array, height: number, offset = 0): BlockHeader
|
|
7452
7568
|
```
|
|
7453
7569
|
|
|
7454
7570
|
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
@@ -7459,7 +7575,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7459
7575
|
##### Function: deserializeBlockHeaders
|
|
7460
7576
|
|
|
7461
7577
|
```ts
|
|
7462
|
-
export function deserializeBlockHeaders(firstHeight: number, buffer: number[] | Uint8Array, offset = 0, count?: number | undefined): BlockHeader[]
|
|
7578
|
+
export function deserializeBlockHeaders(firstHeight: number, buffer: number[] | Uint8Array, offset = 0, count?: number | undefined): BlockHeader[]
|
|
7463
7579
|
```
|
|
7464
7580
|
|
|
7465
7581
|
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
@@ -7558,18 +7674,33 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7558
7674
|
##### Function: getBeefForTxid
|
|
7559
7675
|
|
|
7560
7676
|
```ts
|
|
7561
|
-
export async function getBeefForTxid(services: Services, txid: string): Promise<Beef>
|
|
7677
|
+
export async function getBeefForTxid(services: Services, txid: string): Promise<Beef>
|
|
7562
7678
|
```
|
|
7563
7679
|
|
|
7564
7680
|
See also: [Services](./services.md#class-services)
|
|
7565
7681
|
|
|
7566
7682
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
7567
7683
|
|
|
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
|
+
|
|
7568
7699
|
---
|
|
7569
7700
|
##### Function: getExchangeRatesIo
|
|
7570
7701
|
|
|
7571
7702
|
```ts
|
|
7572
|
-
export async function getExchangeRatesIo(key: string, symbols?: string[], fetchClient?: typeof fetch): Promise<ExchangeRatesIoApi>
|
|
7703
|
+
export async function getExchangeRatesIo(key: string, symbols?: string[], fetchClient?: typeof fetch): Promise<ExchangeRatesIoApi>
|
|
7573
7704
|
```
|
|
7574
7705
|
|
|
7575
7706
|
See also: [ExchangeRatesIoApi](./services.md#interface-exchangeratesioapi)
|
|
@@ -7580,7 +7711,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7580
7711
|
##### Function: getWhatsOnChainBlockHeaderByHash
|
|
7581
7712
|
|
|
7582
7713
|
```ts
|
|
7583
|
-
export async function getWhatsOnChainBlockHeaderByHash(hash: string, chain: Chain = "main", apiKey?: string): Promise<BlockHeader | undefined>
|
|
7714
|
+
export async function getWhatsOnChainBlockHeaderByHash(hash: string, chain: Chain = "main", apiKey?: string): Promise<BlockHeader | undefined>
|
|
7584
7715
|
```
|
|
7585
7716
|
|
|
7586
7717
|
See also: [BlockHeader](./client.md#interface-blockheader), [Chain](./client.md#type-chain)
|
|
@@ -7598,7 +7729,7 @@ export function handlePostRawTxErrorResponse(r: PostTxResultForTxid, nne: () =>
|
|
|
7598
7729
|
statusText?: unknown;
|
|
7599
7730
|
status?: unknown;
|
|
7600
7731
|
ok?: boolean;
|
|
7601
|
-
}): void
|
|
7732
|
+
}): void
|
|
7602
7733
|
```
|
|
7603
7734
|
|
|
7604
7735
|
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
@@ -7612,7 +7743,7 @@ Decide whether a caught error is retryable for script-hash history calls.
|
|
|
7612
7743
|
If not retryable, sets `r.error` and returns false.
|
|
7613
7744
|
|
|
7614
7745
|
```ts
|
|
7615
|
-
export function handleScriptHashHistoryCatch(r: GetScriptHashHistoryResult, error_: unknown, _url: string, methodName: string, retry: number, maxRetry: number): boolean
|
|
7746
|
+
export function handleScriptHashHistoryCatch(r: GetScriptHashHistoryResult, error_: unknown, _url: string, methodName: string, retry: number, maxRetry: number): boolean
|
|
7616
7747
|
```
|
|
7617
7748
|
|
|
7618
7749
|
See also: [GetScriptHashHistoryResult](./client.md#interface-getscripthashhistoryresult)
|
|
@@ -7630,7 +7761,7 @@ Returns:
|
|
|
7630
7761
|
- `'ok'` — response was successful, continue parsing
|
|
7631
7762
|
|
|
7632
7763
|
```ts
|
|
7633
|
-
export function handleScriptHashHistoryResponse(r: GetScriptHashHistoryResult, response: ScriptHashHistoryResponse, methodName: string, retry: number): "continue" | "return" | "ok"
|
|
7764
|
+
export function handleScriptHashHistoryResponse(r: GetScriptHashHistoryResult, response: ScriptHashHistoryResponse, methodName: string, retry: number): "continue" | "return" | "ok"
|
|
7634
7765
|
```
|
|
7635
7766
|
|
|
7636
7767
|
See also: [GetScriptHashHistoryResult](./client.md#interface-getscripthashhistoryresult), [ScriptHashHistoryResponse](./services.md#interface-scripthashhistoryresponse)
|
|
@@ -7644,7 +7775,7 @@ Decide whether the ECONNRESET error is retryable and, if not, set `r.error`.
|
|
|
7644
7775
|
Returns true when the caller should retry, false when it should return.
|
|
7645
7776
|
|
|
7646
7777
|
```ts
|
|
7647
|
-
export function handleUtxoConnReset(r: GetUtxoStatusResult, error_: unknown, _url: string, retry: number, maxRetry: number): boolean
|
|
7778
|
+
export function handleUtxoConnReset(r: GetUtxoStatusResult, error_: unknown, _url: string, retry: number, maxRetry: number): boolean
|
|
7648
7779
|
```
|
|
7649
7780
|
|
|
7650
7781
|
See also: [GetUtxoStatusResult](./client.md#interface-getutxostatusresult)
|
|
@@ -7655,7 +7786,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7655
7786
|
##### Function: isArcAcceptedTxStatus
|
|
7656
7787
|
|
|
7657
7788
|
```ts
|
|
7658
|
-
export function isArcAcceptedTxStatus(txStatus: string | undefined): boolean
|
|
7789
|
+
export function isArcAcceptedTxStatus(txStatus: string | undefined): boolean
|
|
7659
7790
|
```
|
|
7660
7791
|
|
|
7661
7792
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7664,7 +7795,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7664
7795
|
##### Function: isArcDoubleSpendTxStatus
|
|
7665
7796
|
|
|
7666
7797
|
```ts
|
|
7667
|
-
export function isArcDoubleSpendTxStatus(txStatus: string | undefined): boolean
|
|
7798
|
+
export function isArcDoubleSpendTxStatus(txStatus: string | undefined): boolean
|
|
7668
7799
|
```
|
|
7669
7800
|
|
|
7670
7801
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7673,7 +7804,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7673
7804
|
##### Function: isArcInvalidTxStatus
|
|
7674
7805
|
|
|
7675
7806
|
```ts
|
|
7676
|
-
export function isArcInvalidTxStatus(txStatus: string | undefined): boolean
|
|
7807
|
+
export function isArcInvalidTxStatus(txStatus: string | undefined): boolean
|
|
7677
7808
|
```
|
|
7678
7809
|
|
|
7679
7810
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7682,7 +7813,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7682
7813
|
##### Function: isArcServiceErrorStatus
|
|
7683
7814
|
|
|
7684
7815
|
```ts
|
|
7685
|
-
export function isArcServiceErrorStatus(status: number | undefined, detail?: string): boolean
|
|
7816
|
+
export function isArcServiceErrorStatus(status: number | undefined, detail?: string): boolean
|
|
7686
7817
|
```
|
|
7687
7818
|
|
|
7688
7819
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7817,7 +7948,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7817
7948
|
Returns true if work1 is more work (greater than) work2
|
|
7818
7949
|
|
|
7819
7950
|
```ts
|
|
7820
|
-
export function isMoreWork(work1: string, work2: string): boolean
|
|
7951
|
+
export function isMoreWork(work1: string, work2: string): boolean
|
|
7821
7952
|
```
|
|
7822
7953
|
|
|
7823
7954
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7826,7 +7957,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7826
7957
|
##### Function: isValidFiatRate
|
|
7827
7958
|
|
|
7828
7959
|
```ts
|
|
7829
|
-
export function isValidFiatRate(value: unknown): value is number
|
|
7960
|
+
export function isValidFiatRate(value: unknown): value is number
|
|
7830
7961
|
```
|
|
7831
7962
|
|
|
7832
7963
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7835,7 +7966,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7835
7966
|
##### Function: makeMerklePathNote
|
|
7836
7967
|
|
|
7837
7968
|
```ts
|
|
7838
|
-
export function makeMerklePathNote(what: MerklePathNoteWhat, name: string, extra: Partial<MerklePathNote> = {}): MerklePathNote
|
|
7969
|
+
export function makeMerklePathNote(what: MerklePathNoteWhat, name: string, extra: Partial<MerklePathNote> = {}): MerklePathNote
|
|
7839
7970
|
```
|
|
7840
7971
|
|
|
7841
7972
|
See also: [MerklePathNote](./services.md#interface-merklepathnote), [MerklePathNoteWhat](./services.md#type-merklepathnotewhat)
|
|
@@ -7846,7 +7977,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7846
7977
|
##### Function: makePostBeefServiceError
|
|
7847
7978
|
|
|
7848
7979
|
```ts
|
|
7849
|
-
export function makePostBeefServiceError(providerName: string, txids: string[], what: "postBeefServiceError" | "postBeefServiceTimeout", timeoutMs?: number): PostBeefResult
|
|
7980
|
+
export function makePostBeefServiceError(providerName: string, txids: string[], what: "postBeefServiceError" | "postBeefServiceTimeout", timeoutMs?: number): PostBeefResult
|
|
7850
7981
|
```
|
|
7851
7982
|
|
|
7852
7983
|
See also: [PostBeefResult](./client.md#interface-postbeefresult)
|
|
@@ -7857,7 +7988,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7857
7988
|
##### Function: mapWithConcurrency
|
|
7858
7989
|
|
|
7859
7990
|
```ts
|
|
7860
|
-
export async function mapWithConcurrency<T, R>(values: T[], maxConcurrency: number, worker: (value: T, index: number) => Promise<R>): Promise<R[]>
|
|
7991
|
+
export async function mapWithConcurrency<T, R>(values: T[], maxConcurrency: number, worker: (value: T, index: number) => Promise<R>): Promise<R[]>
|
|
7861
7992
|
```
|
|
7862
7993
|
|
|
7863
7994
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7868,7 +7999,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7868
7999
|
Snapshot security-relevant ARC/Arcade constructor configuration exactly once.
|
|
7869
8000
|
|
|
7870
8001
|
```ts
|
|
7871
|
-
export function normalizeArcProviderConfig(config: string | ArcConfig | undefined, defaultDeploymentId: () => string): NormalizedArcProviderConfig
|
|
8002
|
+
export function normalizeArcProviderConfig(config: string | ArcConfig | undefined, defaultDeploymentId: () => string): NormalizedArcProviderConfig
|
|
7872
8003
|
```
|
|
7873
8004
|
|
|
7874
8005
|
See also: [ArcConfig](./services.md#interface-arcconfig), [NormalizedArcProviderConfig](./services.md#interface-normalizedarcproviderconfig)
|
|
@@ -7881,7 +8012,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7881
8012
|
Normalize and snapshot a complete validator request before asynchronous work.
|
|
7882
8013
|
|
|
7883
8014
|
```ts
|
|
7884
|
-
export function normalizeBulkFileDataValidationRequest(request: unknown): BulkFileDataValidationRequest
|
|
8015
|
+
export function normalizeBulkFileDataValidationRequest(request: unknown): BulkFileDataValidationRequest
|
|
7885
8016
|
```
|
|
7886
8017
|
|
|
7887
8018
|
See also: [BulkFileDataValidationRequest](./services.md#interface-bulkfiledatavalidationrequest)
|
|
@@ -7892,7 +8023,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7892
8023
|
##### Function: normalizeBulkHeaderFileInfo
|
|
7893
8024
|
|
|
7894
8025
|
```ts
|
|
7895
|
-
export function normalizeBulkHeaderFileInfo(value: unknown, allowStoredBoolean = false): BulkHeaderFileInfo
|
|
8026
|
+
export function normalizeBulkHeaderFileInfo(value: unknown, allowStoredBoolean = false): BulkHeaderFileInfo
|
|
7896
8027
|
```
|
|
7897
8028
|
|
|
7898
8029
|
See also: [BulkHeaderFileInfo](./services.md#interface-bulkheaderfileinfo)
|
|
@@ -7903,7 +8034,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7903
8034
|
##### Function: normalizeBulkHeaderFileSequence
|
|
7904
8035
|
|
|
7905
8036
|
```ts
|
|
7906
|
-
export function normalizeBulkHeaderFileSequence(files: unknown, allowStoredBoolean = false): BulkHeaderFileInfo[]
|
|
8037
|
+
export function normalizeBulkHeaderFileSequence(files: unknown, allowStoredBoolean = false): BulkHeaderFileInfo[]
|
|
7907
8038
|
```
|
|
7908
8039
|
|
|
7909
8040
|
See also: [BulkHeaderFileInfo](./services.md#interface-bulkheaderfileinfo)
|
|
@@ -7914,7 +8045,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7914
8045
|
##### Function: normalizeBulkHeaderFilesInfo
|
|
7915
8046
|
|
|
7916
8047
|
```ts
|
|
7917
|
-
export function normalizeBulkHeaderFilesInfo(value: unknown): BulkHeaderFilesInfo
|
|
8048
|
+
export function normalizeBulkHeaderFilesInfo(value: unknown): BulkHeaderFilesInfo
|
|
7918
8049
|
```
|
|
7919
8050
|
|
|
7920
8051
|
See also: [BulkHeaderFilesInfo](./services.md#interface-bulkheaderfilesinfo)
|
|
@@ -7925,7 +8056,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7925
8056
|
##### Function: normalizeFiatCurrencies
|
|
7926
8057
|
|
|
7927
8058
|
```ts
|
|
7928
|
-
export function normalizeFiatCurrencies(value: unknown, extras: readonly FiatCurrencyCode[] = []): FiatCurrencyCode[]
|
|
8059
|
+
export function normalizeFiatCurrencies(value: unknown, extras: readonly FiatCurrencyCode[] = []): FiatCurrencyCode[]
|
|
7929
8060
|
```
|
|
7930
8061
|
|
|
7931
8062
|
See also: [FiatCurrencyCode](./client.md#type-fiatcurrencycode)
|
|
@@ -7936,7 +8067,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7936
8067
|
##### Function: normalizeFiatCurrency
|
|
7937
8068
|
|
|
7938
8069
|
```ts
|
|
7939
|
-
export function normalizeFiatCurrency(value: unknown, name = "currency"): FiatCurrencyCode
|
|
8070
|
+
export function normalizeFiatCurrency(value: unknown, name = "currency"): FiatCurrencyCode
|
|
7940
8071
|
```
|
|
7941
8072
|
|
|
7942
8073
|
See also: [FiatCurrencyCode](./client.md#type-fiatcurrencycode)
|
|
@@ -7947,7 +8078,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7947
8078
|
##### Function: normalizeFiatExchangeRates
|
|
7948
8079
|
|
|
7949
8080
|
```ts
|
|
7950
|
-
export function normalizeFiatExchangeRates(value: unknown, required: readonly FiatCurrencyCode[], now = Date.now()): FiatExchangeRates
|
|
8081
|
+
export function normalizeFiatExchangeRates(value: unknown, required: readonly FiatCurrencyCode[], now = Date.now()): FiatExchangeRates
|
|
7951
8082
|
```
|
|
7952
8083
|
|
|
7953
8084
|
See also: [FiatCurrencyCode](./client.md#type-fiatcurrencycode), [FiatExchangeRates](./client.md#interface-fiatexchangerates)
|
|
@@ -7958,7 +8089,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7958
8089
|
##### Function: normalizeFiatRate
|
|
7959
8090
|
|
|
7960
8091
|
```ts
|
|
7961
|
-
export function normalizeFiatRate(value: unknown, currency: string): number
|
|
8092
|
+
export function normalizeFiatRate(value: unknown, currency: string): number
|
|
7962
8093
|
```
|
|
7963
8094
|
|
|
7964
8095
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7967,7 +8098,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7967
8098
|
##### Function: normalizeFiatRateTimestamps
|
|
7968
8099
|
|
|
7969
8100
|
```ts
|
|
7970
|
-
export function normalizeFiatRateTimestamps(value: unknown, now = Date.now()): Record<string, Date> | undefined
|
|
8101
|
+
export function normalizeFiatRateTimestamps(value: unknown, now = Date.now()): Record<string, Date> | undefined
|
|
7971
8102
|
```
|
|
7972
8103
|
|
|
7973
8104
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7976,7 +8107,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7976
8107
|
##### Function: normalizeFiatTimestamp
|
|
7977
8108
|
|
|
7978
8109
|
```ts
|
|
7979
|
-
export function normalizeFiatTimestamp(value: unknown, now = Date.now()): Date
|
|
8110
|
+
export function normalizeFiatTimestamp(value: unknown, now = Date.now()): Date
|
|
7980
8111
|
```
|
|
7981
8112
|
|
|
7982
8113
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7985,7 +8116,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7985
8116
|
##### Function: normalizePostRawHex
|
|
7986
8117
|
|
|
7987
8118
|
```ts
|
|
7988
|
-
export function normalizePostRawHex(value: unknown, maximumBytes: number, name = "rawTx"): string
|
|
8119
|
+
export function normalizePostRawHex(value: unknown, maximumBytes: number, name = "rawTx"): string
|
|
7989
8120
|
```
|
|
7990
8121
|
|
|
7991
8122
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -7994,7 +8125,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7994
8125
|
##### Function: normalizePostTxids
|
|
7995
8126
|
|
|
7996
8127
|
```ts
|
|
7997
|
-
export function normalizePostTxids(value: unknown, name = "txids", allowEmpty = false): string[]
|
|
8128
|
+
export function normalizePostTxids(value: unknown, name = "txids", allowEmpty = false): string[]
|
|
7998
8129
|
```
|
|
7999
8130
|
|
|
8000
8131
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8003,7 +8134,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8003
8134
|
##### Function: normalizeTxid
|
|
8004
8135
|
|
|
8005
8136
|
```ts
|
|
8006
|
-
export function normalizeTxid(value: unknown, name = "txid"): string
|
|
8137
|
+
export function normalizeTxid(value: unknown, name = "txid"): string
|
|
8007
8138
|
```
|
|
8008
8139
|
|
|
8009
8140
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8012,7 +8143,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8012
8143
|
##### Function: normalizeWalletOutpoint
|
|
8013
8144
|
|
|
8014
8145
|
```ts
|
|
8015
|
-
export function normalizeWalletOutpoint(value: unknown): string | undefined
|
|
8146
|
+
export function normalizeWalletOutpoint(value: unknown): string | undefined
|
|
8016
8147
|
```
|
|
8017
8148
|
|
|
8018
8149
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8028,7 +8159,7 @@ export function parseFileLink(file: string): {
|
|
|
8028
8159
|
} | "latest";
|
|
8029
8160
|
sourceUrl: string;
|
|
8030
8161
|
fileName: string;
|
|
8031
|
-
} | undefined
|
|
8162
|
+
} | undefined
|
|
8032
8163
|
```
|
|
8033
8164
|
|
|
8034
8165
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8044,7 +8175,7 @@ export function populateUtxoDetails(r: GetUtxoStatusResult, result: Array<{
|
|
|
8044
8175
|
value: number;
|
|
8045
8176
|
height: number;
|
|
8046
8177
|
tx_pos: number;
|
|
8047
|
-
}>, outpoint?: string): void
|
|
8178
|
+
}>, outpoint?: string): void
|
|
8048
8179
|
```
|
|
8049
8180
|
|
|
8050
8181
|
See also: [GetUtxoStatusResult](./client.md#interface-getutxostatusresult)
|
|
@@ -8057,7 +8188,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8057
8188
|
Credential-free public Arcade host for supported networks.
|
|
8058
8189
|
|
|
8059
8190
|
```ts
|
|
8060
|
-
export function publicArcadeUrl(chain: Chain): string | undefined
|
|
8191
|
+
export function publicArcadeUrl(chain: Chain): string | undefined
|
|
8061
8192
|
```
|
|
8062
8193
|
|
|
8063
8194
|
See also: [Chain](./client.md#type-chain)
|
|
@@ -8068,7 +8199,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8068
8199
|
##### Function: readUInt32BE
|
|
8069
8200
|
|
|
8070
8201
|
```ts
|
|
8071
|
-
export function readUInt32BE(a: number[] | Uint8Array, offset: number): number
|
|
8202
|
+
export function readUInt32BE(a: number[] | Uint8Array, offset: number): number
|
|
8072
8203
|
```
|
|
8073
8204
|
|
|
8074
8205
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8077,7 +8208,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8077
8208
|
##### Function: readUInt32LE
|
|
8078
8209
|
|
|
8079
8210
|
```ts
|
|
8080
|
-
export function readUInt32LE(a: number[] | Uint8Array, offset: number): number
|
|
8211
|
+
export function readUInt32LE(a: number[] | Uint8Array, offset: number): number
|
|
8081
8212
|
```
|
|
8082
8213
|
|
|
8083
8214
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8089,7 +8220,7 @@ Convert an internal tri-state classification to the historical boolean
|
|
|
8089
8220
|
contract only when a provider supplied a conclusive answer.
|
|
8090
8221
|
|
|
8091
8222
|
```ts
|
|
8092
|
-
export function requireConclusiveUtxo(classification: OutputUtxoClassification): boolean
|
|
8223
|
+
export function requireConclusiveUtxo(classification: OutputUtxoClassification): boolean
|
|
8093
8224
|
```
|
|
8094
8225
|
|
|
8095
8226
|
See also: [OutputUtxoClassification](./services.md#interface-outpututxoclassification)
|
|
@@ -8100,7 +8231,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8100
8231
|
##### Function: resolveDefaultChaintracksArguments
|
|
8101
8232
|
|
|
8102
8233
|
```ts
|
|
8103
|
-
export function resolveDefaultChaintracksArguments(args: DefaultChaintracksArguments): ResolvedDefaultChaintracksParams
|
|
8234
|
+
export function resolveDefaultChaintracksArguments(args: DefaultChaintracksArguments): ResolvedDefaultChaintracksParams
|
|
8104
8235
|
```
|
|
8105
8236
|
|
|
8106
8237
|
See also: [DefaultChaintracksArguments](./services.md#type-defaultchaintracksarguments), [ResolvedDefaultChaintracksParams](./services.md#interface-resolveddefaultchaintracksparams)
|
|
@@ -8111,7 +8242,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8111
8242
|
##### Function: resolveDefaultKnexChaintracksArguments
|
|
8112
8243
|
|
|
8113
8244
|
```ts
|
|
8114
|
-
export function resolveDefaultKnexChaintracksArguments(args: DefaultKnexChaintracksArguments): ResolvedDefaultKnexChaintracksParams
|
|
8245
|
+
export function resolveDefaultKnexChaintracksArguments(args: DefaultKnexChaintracksArguments): ResolvedDefaultKnexChaintracksParams
|
|
8115
8246
|
```
|
|
8116
8247
|
|
|
8117
8248
|
See also: [DefaultKnexChaintracksArguments](./services.md#type-defaultknexchaintracksarguments), [ResolvedDefaultKnexChaintracksParams](./services.md#interface-resolveddefaultknexchaintracksparams)
|
|
@@ -8124,7 +8255,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8124
8255
|
Convert an untrusted diagnostic to bounded, single-line text suitable for logs and status APIs.
|
|
8125
8256
|
|
|
8126
8257
|
```ts
|
|
8127
|
-
export function safeDiagnostic(value: unknown, maximum = 512): string
|
|
8258
|
+
export function safeDiagnostic(value: unknown, maximum = 512): string
|
|
8128
8259
|
```
|
|
8129
8260
|
|
|
8130
8261
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8133,7 +8264,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8133
8264
|
##### Function: selectBulkHeaderFiles
|
|
8134
8265
|
|
|
8135
8266
|
```ts
|
|
8136
|
-
export function selectBulkHeaderFiles(files: BulkHeaderFileInfo[], chain: Chain, maxPerFile: number): BulkHeaderFileInfo[]
|
|
8267
|
+
export function selectBulkHeaderFiles(files: BulkHeaderFileInfo[], chain: Chain, maxPerFile: number): BulkHeaderFileInfo[]
|
|
8137
8268
|
```
|
|
8138
8269
|
|
|
8139
8270
|
See also: [BulkHeaderFileInfo](./services.md#interface-bulkheaderfileinfo), [Chain](./client.md#type-chain)
|
|
@@ -8152,7 +8283,7 @@ the block hash for the header.
|
|
|
8152
8283
|
export function serializeBaseBlockHeader(header: BaseBlockHeader, buffer?: number[], offset?: number): number[] {
|
|
8153
8284
|
const validated = copyBaseHeaderData(header);
|
|
8154
8285
|
validateBaseBlockHeaderFormat(validated);
|
|
8155
|
-
const writer = new
|
|
8286
|
+
const writer = new Writer();
|
|
8156
8287
|
writer.writeUInt32LE(validated.version);
|
|
8157
8288
|
writer.write(asArray(validated.previousHash).reverse());
|
|
8158
8289
|
writer.write(asArray(validated.merkleRoot).reverse());
|
|
@@ -8187,7 +8318,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8187
8318
|
##### Function: serializeBaseBlockHeaders
|
|
8188
8319
|
|
|
8189
8320
|
```ts
|
|
8190
|
-
export function serializeBaseBlockHeaders(headers: BlockHeader[]): Uint8Array
|
|
8321
|
+
export function serializeBaseBlockHeaders(headers: BlockHeader[]): Uint8Array
|
|
8191
8322
|
```
|
|
8192
8323
|
|
|
8193
8324
|
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
@@ -8203,7 +8334,7 @@ Computes sha256 hash of file contents read as bytes with no encoding.
|
|
|
8203
8334
|
export async function sha256HashOfBinaryFile(fs: ChaintracksFsApi, filepath: string, bufferSize = 80000): Promise<{
|
|
8204
8335
|
hash: string;
|
|
8205
8336
|
length: number;
|
|
8206
|
-
}>
|
|
8337
|
+
}>
|
|
8207
8338
|
```
|
|
8208
8339
|
|
|
8209
8340
|
See also: [ChaintracksFsApi](./services.md#interface-chaintracksfsapi)
|
|
@@ -8229,7 +8360,7 @@ diagnostics. The optional legacy array mode is bounded for older custom
|
|
|
8229
8360
|
WalletServices implementations; ordinary providers return one path.
|
|
8230
8361
|
|
|
8231
8362
|
```ts
|
|
8232
|
-
export function snapshotMerklePathResult(value: unknown, allowLegacyArray = false, providerName?: string): SnapshotMerklePathResult
|
|
8363
|
+
export function snapshotMerklePathResult(value: unknown, allowLegacyArray = false, providerName?: string): SnapshotMerklePathResult
|
|
8233
8364
|
```
|
|
8234
8365
|
|
|
8235
8366
|
See also: [SnapshotMerklePathResult](./services.md#interface-snapshotmerklepathresult)
|
|
@@ -8240,7 +8371,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8240
8371
|
##### Function: snapshotPostBeefRequest
|
|
8241
8372
|
|
|
8242
8373
|
```ts
|
|
8243
|
-
export function snapshotPostBeefRequest(beef: Beef, txids: string[]): ValidatedPostBeefRequest
|
|
8374
|
+
export function snapshotPostBeefRequest(beef: Beef, txids: string[]): ValidatedPostBeefRequest
|
|
8244
8375
|
```
|
|
8245
8376
|
|
|
8246
8377
|
See also: [ValidatedPostBeefRequest](./services.md#interface-validatedpostbeefrequest)
|
|
@@ -8251,7 +8382,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8251
8382
|
##### Function: startChaintracks
|
|
8252
8383
|
|
|
8253
8384
|
```ts
|
|
8254
|
-
export function startChaintracks<TStorage extends ChaintracksOptions["storage"]>(params: ResolvedDefaultChaintracksParams, options: ChaintracksOptions): CreatedChaintracks<TStorage>
|
|
8385
|
+
export function startChaintracks<TStorage extends ChaintracksOptions["storage"]>(params: ResolvedDefaultChaintracksParams, options: ChaintracksOptions): CreatedChaintracks<TStorage>
|
|
8255
8386
|
```
|
|
8256
8387
|
|
|
8257
8388
|
See also: [ChaintracksOptions](./services.md#interface-chaintracksoptions), [CreatedChaintracks](./services.md#interface-createdchaintracks), [ResolvedDefaultChaintracksParams](./services.md#interface-resolveddefaultchaintracksparams)
|
|
@@ -8264,7 +8395,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8264
8395
|
Arcade broadcaster / ARC endpoint for stn, or `undefined` when unset.
|
|
8265
8396
|
|
|
8266
8397
|
```ts
|
|
8267
|
-
export function stnArcadeUrl(): string | undefined
|
|
8398
|
+
export function stnArcadeUrl(): string | undefined
|
|
8268
8399
|
```
|
|
8269
8400
|
|
|
8270
8401
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8276,7 +8407,7 @@ ChainTracks service URL for stn. Falls back to the configured Arcade host's
|
|
|
8276
8407
|
legacy-compatible path when STN_CHAINTRACKS_URL is unset.
|
|
8277
8408
|
|
|
8278
8409
|
```ts
|
|
8279
|
-
export function stnChaintracksUrl(): string
|
|
8410
|
+
export function stnChaintracksUrl(): string
|
|
8280
8411
|
```
|
|
8281
8412
|
|
|
8282
8413
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8287,7 +8418,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8287
8418
|
Subtract Buffer encoded chainwork values
|
|
8288
8419
|
|
|
8289
8420
|
```ts
|
|
8290
|
-
export function subWork(work1: string, work2: string): string
|
|
8421
|
+
export function subWork(work1: string, work2: string): string
|
|
8291
8422
|
```
|
|
8292
8423
|
|
|
8293
8424
|
Returns
|
|
@@ -8323,7 +8454,7 @@ the block hash for the header.
|
|
|
8323
8454
|
|
|
8324
8455
|
```ts
|
|
8325
8456
|
export function toBinaryBaseBlockHeader(header: BaseBlockHeader): number[] {
|
|
8326
|
-
const writer = new
|
|
8457
|
+
const writer = new Writer();
|
|
8327
8458
|
writer.writeUInt32LE(header.version);
|
|
8328
8459
|
writer.writeReverse(asArray(header.previousHash));
|
|
8329
8460
|
writer.writeReverse(asArray(header.merkleRoot));
|
|
@@ -8347,7 +8478,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8347
8478
|
##### Function: toDefaultChaintracksArguments
|
|
8348
8479
|
|
|
8349
8480
|
```ts
|
|
8350
|
-
export function toDefaultChaintracksArguments(params: ResolvedDefaultChaintracksParams): DefaultChaintracksArguments
|
|
8481
|
+
export function toDefaultChaintracksArguments(params: ResolvedDefaultChaintracksParams): DefaultChaintracksArguments
|
|
8351
8482
|
```
|
|
8352
8483
|
|
|
8353
8484
|
See also: [DefaultChaintracksArguments](./services.md#type-defaultchaintracksarguments), [ResolvedDefaultChaintracksParams](./services.md#interface-resolveddefaultchaintracksparams)
|
|
@@ -8358,7 +8489,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8358
8489
|
##### Function: toDefaultKnexChaintracksArguments
|
|
8359
8490
|
|
|
8360
8491
|
```ts
|
|
8361
|
-
export function toDefaultKnexChaintracksArguments(params: ResolvedDefaultKnexChaintracksParams): DefaultKnexChaintracksArguments
|
|
8492
|
+
export function toDefaultKnexChaintracksArguments(params: ResolvedDefaultKnexChaintracksParams): DefaultKnexChaintracksArguments
|
|
8362
8493
|
```
|
|
8363
8494
|
|
|
8364
8495
|
See also: [DefaultKnexChaintracksArguments](./services.md#type-defaultknexchaintracksarguments), [ResolvedDefaultKnexChaintracksParams](./services.md#interface-resolveddefaultknexchaintracksparams)
|
|
@@ -8371,7 +8502,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8371
8502
|
Arcade broadcaster / ARC endpoint for tstn, or `undefined` when `TSTN_ARCADE_URL` is unset.
|
|
8372
8503
|
|
|
8373
8504
|
```ts
|
|
8374
|
-
export function tstnArcadeUrl(): string | undefined
|
|
8505
|
+
export function tstnArcadeUrl(): string | undefined
|
|
8375
8506
|
```
|
|
8376
8507
|
|
|
8377
8508
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8383,7 +8514,7 @@ ChainTracks service URL for tstn. Falls back to `${TSTN_ARCADE_URL}/chaintracks/
|
|
|
8383
8514
|
`TSTN_CHAINTRACKS_URL` is unset (mirrors the ttn layout). Throws when neither is configured.
|
|
8384
8515
|
|
|
8385
8516
|
```ts
|
|
8386
|
-
export function tstnChaintracksUrl(): string
|
|
8517
|
+
export function tstnChaintracksUrl(): string
|
|
8387
8518
|
```
|
|
8388
8519
|
|
|
8389
8520
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8392,7 +8523,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8392
8523
|
##### Function: updateChaintracksFiatExchangeRates
|
|
8393
8524
|
|
|
8394
8525
|
```ts
|
|
8395
|
-
export async function updateChaintracksFiatExchangeRates(targetCurrencies: string[], options: WalletServicesOptions): Promise<FiatExchangeRates>
|
|
8526
|
+
export async function updateChaintracksFiatExchangeRates(targetCurrencies: string[], options: WalletServicesOptions): Promise<FiatExchangeRates>
|
|
8396
8527
|
```
|
|
8397
8528
|
|
|
8398
8529
|
See also: [FiatExchangeRates](./client.md#interface-fiatexchangerates), [WalletServicesOptions](./client.md#interface-walletservicesoptions)
|
|
@@ -8403,7 +8534,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8403
8534
|
##### Function: updateExchangeratesapi
|
|
8404
8535
|
|
|
8405
8536
|
```ts
|
|
8406
|
-
export async function updateExchangeratesapi(targetCurrencies: string[], options: WalletServicesOptions): Promise<FiatExchangeRates>
|
|
8537
|
+
export async function updateExchangeratesapi(targetCurrencies: string[], options: WalletServicesOptions): Promise<FiatExchangeRates>
|
|
8407
8538
|
```
|
|
8408
8539
|
|
|
8409
8540
|
See also: [FiatExchangeRates](./client.md#interface-fiatexchangerates), [WalletServicesOptions](./client.md#interface-walletservicesoptions)
|
|
@@ -8416,7 +8547,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8416
8547
|
Hash map of known valid bulk header files by their `fileHash`.
|
|
8417
8548
|
|
|
8418
8549
|
```ts
|
|
8419
|
-
export function validBulkHeaderFilesByFileHash(): Record<string, BulkHeaderFileInfo>
|
|
8550
|
+
export function validBulkHeaderFilesByFileHash(): Record<string, BulkHeaderFileInfo>
|
|
8420
8551
|
```
|
|
8421
8552
|
|
|
8422
8553
|
See also: [BulkHeaderFileInfo](./services.md#interface-bulkheaderfileinfo)
|
|
@@ -8433,7 +8564,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8433
8564
|
Throws Error if blockHash is in the dirtyHashes list.
|
|
8434
8565
|
|
|
8435
8566
|
```ts
|
|
8436
|
-
export function validateAgainstDirtyHashes(blockHash: string): void
|
|
8567
|
+
export function validateAgainstDirtyHashes(blockHash: string): void
|
|
8437
8568
|
```
|
|
8438
8569
|
|
|
8439
8570
|
See also: [blockHash](./services.md#function-blockhash)
|
|
@@ -8441,12 +8572,12 @@ See also: [blockHash](./services.md#function-blockhash)
|
|
|
8441
8572
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8442
8573
|
|
|
8443
8574
|
---
|
|
8444
|
-
##### Function:
|
|
8575
|
+
##### Function: validateArcTxData
|
|
8445
8576
|
|
|
8446
|
-
Validate and snapshot
|
|
8577
|
+
Validate and snapshot an untrusted ARC-compatible `GET /tx/{txid}` response.
|
|
8447
8578
|
|
|
8448
8579
|
```ts
|
|
8449
|
-
export function
|
|
8580
|
+
export function validateArcTxData(value: unknown, expectedTxid: string, responseStatus = 200): ArcMinerGetTxData
|
|
8450
8581
|
```
|
|
8451
8582
|
|
|
8452
8583
|
See also: [ArcMinerGetTxData](./services.md#interface-arcminergettxdata)
|
|
@@ -8460,7 +8591,7 @@ Validates the exact data representation of an unpositioned 80-byte block
|
|
|
8460
8591
|
header before it reaches a chain lookup, queue, or serializer.
|
|
8461
8592
|
|
|
8462
8593
|
```ts
|
|
8463
|
-
export function validateBaseBlockHeaderFormat(header: BaseBlockHeader): void
|
|
8594
|
+
export function validateBaseBlockHeaderFormat(header: BaseBlockHeader): void
|
|
8464
8595
|
```
|
|
8465
8596
|
|
|
8466
8597
|
See also: [BaseBlockHeader](./client.md#interface-baseblockheader)
|
|
@@ -8477,7 +8608,7 @@ Validate headers contained in an array of bytes. The headers must be consecutive
|
|
|
8477
8608
|
export function validateBufferOfHeaders(buffer: Uint8Array, previousHash: string, offset = 0, count = -1, previousChainWork?: string): {
|
|
8478
8609
|
lastHeaderHash: string;
|
|
8479
8610
|
lastChainWork: string | undefined;
|
|
8480
|
-
}
|
|
8611
|
+
}
|
|
8481
8612
|
```
|
|
8482
8613
|
|
|
8483
8614
|
Returns
|
|
@@ -8503,7 +8634,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8503
8634
|
Validates the contents of a bulk header file.
|
|
8504
8635
|
|
|
8505
8636
|
```ts
|
|
8506
|
-
export async function validateBulkFileData(bf: BulkHeaderFileInfo, prevHash: string, prevChainWork: string, fetch?: ChaintracksFetchApi): Promise<BulkHeaderFileInfo>
|
|
8637
|
+
export async function validateBulkFileData(bf: BulkHeaderFileInfo, prevHash: string, prevChainWork: string, fetch?: ChaintracksFetchApi): Promise<BulkHeaderFileInfo>
|
|
8507
8638
|
```
|
|
8508
8639
|
|
|
8509
8640
|
See also: [BulkHeaderFileInfo](./services.md#interface-bulkheaderfileinfo), [ChaintracksFetchApi](./services.md#interface-chaintracksfetchapi)
|
|
@@ -8525,13 +8656,28 @@ Argument Details
|
|
|
8525
8656
|
|
|
8526
8657
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
8527
8658
|
|
|
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
|
+
|
|
8528
8674
|
---
|
|
8529
8675
|
##### Function: validateGenesisHeader
|
|
8530
8676
|
|
|
8531
8677
|
Verifies that buffer begins with valid genesis block header for the specified chain.
|
|
8532
8678
|
|
|
8533
8679
|
```ts
|
|
8534
|
-
export function validateGenesisHeader(buffer: Uint8Array, chain: Chain): void
|
|
8680
|
+
export function validateGenesisHeader(buffer: Uint8Array, chain: Chain): void
|
|
8535
8681
|
```
|
|
8536
8682
|
|
|
8537
8683
|
See also: [Chain](./client.md#type-chain)
|
|
@@ -8544,7 +8690,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8544
8690
|
Ensures that a header has a valid proof-of-work target and hash.
|
|
8545
8691
|
|
|
8546
8692
|
```ts
|
|
8547
|
-
export function validateHeaderDifficulty(hash: number[] | Uint8Array, bits: number)
|
|
8693
|
+
export function validateHeaderDifficulty(hash: number[] | Uint8Array, bits: number)
|
|
8548
8694
|
```
|
|
8549
8695
|
|
|
8550
8696
|
Returns
|
|
@@ -8562,7 +8708,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8562
8708
|
##### Function: validateHeaderFormat
|
|
8563
8709
|
|
|
8564
8710
|
```ts
|
|
8565
|
-
export function validateHeaderFormat(header: BlockHeader): void
|
|
8711
|
+
export function validateHeaderFormat(header: BlockHeader): void
|
|
8566
8712
|
```
|
|
8567
8713
|
|
|
8568
8714
|
See also: [BlockHeader](./client.md#interface-blockheader)
|
|
@@ -8599,7 +8745,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8599
8745
|
##### Function: validateMerklePathResult
|
|
8600
8746
|
|
|
8601
8747
|
```ts
|
|
8602
|
-
export function validateMerklePathResult(requestedTxid: unknown, result: GetMerklePathResult, requireProofOfWork = false, requireHeaderFormat = true): ValidatedMerklePathResult
|
|
8748
|
+
export function validateMerklePathResult(requestedTxid: unknown, result: GetMerklePathResult, requireProofOfWork = false, requireHeaderFormat = true): ValidatedMerklePathResult
|
|
8603
8749
|
```
|
|
8604
8750
|
|
|
8605
8751
|
See also: [GetMerklePathResult](./client.md#interface-getmerklepathresult), [ValidatedMerklePathResult](./services.md#interface-validatedmerklepathresult)
|
|
@@ -8610,7 +8756,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8610
8756
|
##### Function: validatePostBeefResult
|
|
8611
8757
|
|
|
8612
8758
|
```ts
|
|
8613
|
-
export function validatePostBeefResult(value: unknown, expectedTxids: string[], configuredProviderName: string, allowInternalTimeoutNote = false): PostBeefResult
|
|
8759
|
+
export function validatePostBeefResult(value: unknown, expectedTxids: string[], configuredProviderName: string, allowInternalTimeoutNote = false): PostBeefResult
|
|
8614
8760
|
```
|
|
8615
8761
|
|
|
8616
8762
|
See also: [PostBeefResult](./client.md#interface-postbeefresult)
|
|
@@ -8621,7 +8767,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8621
8767
|
##### Function: validatePostBeefResultOrServiceError
|
|
8622
8768
|
|
|
8623
8769
|
```ts
|
|
8624
|
-
export function validatePostBeefResultOrServiceError(value: unknown, expectedTxids: string[], configuredProviderName: string): PostBeefResult
|
|
8770
|
+
export function validatePostBeefResultOrServiceError(value: unknown, expectedTxids: string[], configuredProviderName: string): PostBeefResult
|
|
8625
8771
|
```
|
|
8626
8772
|
|
|
8627
8773
|
See also: [PostBeefResult](./client.md#interface-postbeefresult)
|
|
@@ -8632,7 +8778,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8632
8778
|
##### Function: validatePostTxResult
|
|
8633
8779
|
|
|
8634
8780
|
```ts
|
|
8635
|
-
export function validatePostTxResult(value: unknown, expectedTxid: string, configuredProviderName: string): PostTxResultForTxid
|
|
8781
|
+
export function validatePostTxResult(value: unknown, expectedTxid: string, configuredProviderName: string): PostTxResultForTxid
|
|
8636
8782
|
```
|
|
8637
8783
|
|
|
8638
8784
|
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
@@ -8643,7 +8789,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8643
8789
|
##### Function: validatePostTxResultOrServiceError
|
|
8644
8790
|
|
|
8645
8791
|
```ts
|
|
8646
|
-
export function validatePostTxResultOrServiceError(value: unknown, expectedTxid: string, configuredProviderName: string): PostTxResultForTxid
|
|
8792
|
+
export function validatePostTxResultOrServiceError(value: unknown, expectedTxid: string, configuredProviderName: string): PostTxResultForTxid
|
|
8647
8793
|
```
|
|
8648
8794
|
|
|
8649
8795
|
See also: [PostTxResultForTxid](./client.md#interface-posttxresultfortxid)
|
|
@@ -8656,7 +8802,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8656
8802
|
Snapshot and bind a raw-transaction provider result to its requested txid.
|
|
8657
8803
|
|
|
8658
8804
|
```ts
|
|
8659
|
-
export function validateRawTxResult(value: unknown, expectedTxid: string, providerName?: string): GetRawTxResult
|
|
8805
|
+
export function validateRawTxResult(value: unknown, expectedTxid: string, providerName?: string): GetRawTxResult
|
|
8660
8806
|
```
|
|
8661
8807
|
|
|
8662
8808
|
See also: [GetRawTxResult](./client.md#interface-getrawtxresult)
|
|
@@ -8667,7 +8813,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8667
8813
|
##### Function: validateScriptHash
|
|
8668
8814
|
|
|
8669
8815
|
```ts
|
|
8670
|
-
export function validateScriptHash(output: string, outputFormat?: GetUtxoStatusOutputFormat): string
|
|
8816
|
+
export function validateScriptHash(output: string, outputFormat?: GetUtxoStatusOutputFormat): string
|
|
8671
8817
|
```
|
|
8672
8818
|
|
|
8673
8819
|
See also: [GetUtxoStatusOutputFormat](./client.md#type-getutxostatusoutputformat)
|
|
@@ -8680,7 +8826,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8680
8826
|
Validate and own a script-history result before it contributes competing transaction IDs.
|
|
8681
8827
|
|
|
8682
8828
|
```ts
|
|
8683
|
-
export function validateScriptHashHistoryResult(value: unknown, configuredProviderName?: string): GetScriptHashHistoryResult
|
|
8829
|
+
export function validateScriptHashHistoryResult(value: unknown, configuredProviderName?: string): GetScriptHashHistoryResult
|
|
8684
8830
|
```
|
|
8685
8831
|
|
|
8686
8832
|
See also: [GetScriptHashHistoryResult](./client.md#interface-getscripthashhistoryresult)
|
|
@@ -8695,7 +8841,7 @@ can influence wallet transaction state. Provider names may be replaced with
|
|
|
8695
8841
|
a locally configured name so remote data cannot forge durable attribution.
|
|
8696
8842
|
|
|
8697
8843
|
```ts
|
|
8698
|
-
export function validateStatusForTxidsResult(value: unknown, requestedTxids: readonly string[], providerName?: string): GetStatusForTxidsResult
|
|
8844
|
+
export function validateStatusForTxidsResult(value: unknown, requestedTxids: readonly string[], providerName?: string): GetStatusForTxidsResult
|
|
8699
8845
|
```
|
|
8700
8846
|
|
|
8701
8847
|
See also: [GetStatusForTxidsResult](./client.md#interface-getstatusfortxidsresult)
|
|
@@ -8708,7 +8854,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8708
8854
|
Validate, bind, and own a UTXO-oracle result before wallet state uses it.
|
|
8709
8855
|
|
|
8710
8856
|
```ts
|
|
8711
|
-
export function validateUtxoStatusResult(value: unknown, expectedOutpoint?: string, configuredProviderName?: string): GetUtxoStatusResult
|
|
8857
|
+
export function validateUtxoStatusResult(value: unknown, expectedOutpoint?: string, configuredProviderName?: string): GetUtxoStatusResult
|
|
8712
8858
|
```
|
|
8713
8859
|
|
|
8714
8860
|
See also: [GetUtxoStatusResult](./client.md#interface-getutxostatusresult)
|
|
@@ -8719,7 +8865,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8719
8865
|
##### Function: validateWocChainInfo
|
|
8720
8866
|
|
|
8721
8867
|
```ts
|
|
8722
|
-
export function validateWocChainInfo(value: unknown, expectedChain: Chain): WocChainInfo
|
|
8868
|
+
export function validateWocChainInfo(value: unknown, expectedChain: Chain): WocChainInfo
|
|
8723
8869
|
```
|
|
8724
8870
|
|
|
8725
8871
|
See also: [Chain](./client.md#type-chain), [WocChainInfo](./services.md#interface-wocchaininfo)
|
|
@@ -8730,7 +8876,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8730
8876
|
##### Function: wocGetHeadersHeaderToBlockHeader
|
|
8731
8877
|
|
|
8732
8878
|
```ts
|
|
8733
|
-
export function wocGetHeadersHeaderToBlockHeader(h: WocGetHeadersHeader): BlockHeader
|
|
8879
|
+
export function wocGetHeadersHeaderToBlockHeader(h: WocGetHeadersHeader): BlockHeader
|
|
8734
8880
|
```
|
|
8735
8881
|
|
|
8736
8882
|
See also: [BlockHeader](./client.md#interface-blockheader), [WocGetHeadersHeader](./services.md#interface-wocgetheadersheader)
|
|
@@ -8741,7 +8887,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8741
8887
|
##### Function: workBNtoBuffer
|
|
8742
8888
|
|
|
8743
8889
|
```ts
|
|
8744
|
-
export function workBNtoBuffer(work: BigNumber): string
|
|
8890
|
+
export function workBNtoBuffer(work: BigNumber): string
|
|
8745
8891
|
```
|
|
8746
8892
|
|
|
8747
8893
|
Returns
|
|
@@ -8759,7 +8905,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8759
8905
|
##### Function: writeUInt32BE
|
|
8760
8906
|
|
|
8761
8907
|
```ts
|
|
8762
|
-
export function writeUInt32BE(n: number, a: number[] | Uint8Array, offset: number): number
|
|
8908
|
+
export function writeUInt32BE(n: number, a: number[] | Uint8Array, offset: number): number
|
|
8763
8909
|
```
|
|
8764
8910
|
|
|
8765
8911
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -8768,7 +8914,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8768
8914
|
##### Function: writeUInt32LE
|
|
8769
8915
|
|
|
8770
8916
|
```ts
|
|
8771
|
-
export function writeUInt32LE(n: number, a: number[] | Uint8Array, offset: number): number
|
|
8917
|
+
export function writeUInt32LE(n: number, a: number[] | Uint8Array, offset: number): number
|
|
8772
8918
|
```
|
|
8773
8919
|
|
|
8774
8920
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
@@ -9033,7 +9179,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
9033
9179
|
##### Variable: MAX_POST_BEEF_TXIDS
|
|
9034
9180
|
|
|
9035
9181
|
```ts
|
|
9036
|
-
MAX_POST_BEEF_TXIDS =
|
|
9182
|
+
MAX_POST_BEEF_TXIDS = MAXIMUM_SEND_WITH_TRANSACTIONS
|
|
9037
9183
|
```
|
|
9038
9184
|
|
|
9039
9185
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|