@odatano/core 2.0.0-rc.19 → 2.0.0-rc.20

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.
Files changed (119) hide show
  1. package/@cds-models/CardanoAgentService/index.d.ts +1 -5
  2. package/@cds-models/CardanoIndexerService/index.d.ts +51 -2
  3. package/@cds-models/CardanoIndexerService/index.js +7 -0
  4. package/package.json +1 -1
  5. package/src/index.d.ts +4 -10
  6. package/src/index.js +6 -16
  7. package/src/plugin.js +11 -27
  8. package/srv/blockchain/backends/blockfrost-backend.d.ts +29 -131
  9. package/srv/blockchain/backends/blockfrost-backend.js +39 -150
  10. package/srv/blockchain/backends/cardano-backend.d.ts +53 -171
  11. package/srv/blockchain/backends/cardano-backend.js +1 -5
  12. package/srv/blockchain/backends/koios-backend.d.ts +26 -71
  13. package/srv/blockchain/backends/koios-backend.js +50 -132
  14. package/srv/blockchain/backends/ogmios-backend.d.ts +43 -124
  15. package/srv/blockchain/backends/ogmios-backend.js +71 -179
  16. package/srv/blockchain/backends/ogmios-frame-guard.d.ts +12 -57
  17. package/srv/blockchain/backends/ogmios-frame-guard.js +27 -66
  18. package/srv/blockchain/cardano-client.d.ts +43 -216
  19. package/srv/blockchain/cardano-client.js +49 -234
  20. package/srv/blockchain/cardano-indexer.d.ts +79 -357
  21. package/srv/blockchain/cardano-indexer.js +98 -406
  22. package/srv/blockchain/cardano-tx-builder.d.ts +19 -84
  23. package/srv/blockchain/cardano-tx-builder.js +21 -107
  24. package/srv/blockchain/crawler/certificate-backfill.d.ts +45 -0
  25. package/srv/blockchain/crawler/certificate-backfill.js +150 -0
  26. package/srv/blockchain/crawler/crawler.d.ts +41 -145
  27. package/srv/blockchain/crawler/crawler.js +57 -172
  28. package/srv/blockchain/crawler/hooks.d.ts +3 -14
  29. package/srv/blockchain/crawler/index.d.ts +2 -6
  30. package/srv/blockchain/crawler/index.js +4 -9
  31. package/srv/blockchain/crawler/sync-state.d.ts +17 -39
  32. package/srv/blockchain/crawler/sync-state.js +23 -55
  33. package/srv/blockchain/crawler/utxo-set-import.d.ts +5 -22
  34. package/srv/blockchain/crawler/utxo-set-import.js +8 -28
  35. package/srv/blockchain/ledger-state.d.ts +3 -12
  36. package/srv/blockchain/signing/cose-verifier.d.ts +5 -12
  37. package/srv/blockchain/signing/cose-verifier.js +6 -12
  38. package/srv/blockchain/signing/external-signer.d.ts +16 -113
  39. package/srv/blockchain/signing/external-signer.js +19 -122
  40. package/srv/blockchain/signing/hsm-signer.d.ts +13 -45
  41. package/srv/blockchain/signing/hsm-signer.js +23 -63
  42. package/srv/blockchain/signing/signature-verifier.d.ts +8 -44
  43. package/srv/blockchain/signing/signature-verifier.js +13 -54
  44. package/srv/blockchain/signing/submission-finalizer.d.ts +9 -36
  45. package/srv/blockchain/signing/submission-finalizer.js +16 -48
  46. package/srv/blockchain/transaction-building/buildooor-tx.d.ts +65 -174
  47. package/srv/blockchain/transaction-building/buildooor-tx.js +107 -266
  48. package/srv/blockchain/transaction-building/cardano-tx.d.ts +8 -34
  49. package/srv/blockchain/wallet-worker/build-request.d.ts +4 -17
  50. package/srv/blockchain/wallet-worker/build-request.js +9 -22
  51. package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +12 -35
  52. package/srv/blockchain/wallet-worker/confirmation-tracker.js +16 -32
  53. package/srv/blockchain/wallet-worker/index.js +2 -8
  54. package/srv/blockchain/wallet-worker/job-store.d.ts +33 -111
  55. package/srv/blockchain/wallet-worker/job-store.js +0 -0
  56. package/srv/blockchain/wallet-worker/lease-heartbeat.d.ts +4 -20
  57. package/srv/blockchain/wallet-worker/lease-heartbeat.js +4 -20
  58. package/srv/blockchain/wallet-worker/signers.d.ts +6 -19
  59. package/srv/blockchain/wallet-worker/signers.js +3 -8
  60. package/srv/blockchain/wallet-worker/wallet-worker.d.ts +15 -71
  61. package/srv/blockchain/wallet-worker/wallet-worker.js +34 -90
  62. package/srv/cardano-agent-service.cds +1 -5
  63. package/srv/cardano-agent-service.js +3 -7
  64. package/srv/cardano-indexer-service.cds +32 -4
  65. package/srv/cardano-indexer-service.js +83 -15
  66. package/srv/cardano-service.js +36 -98
  67. package/srv/cardano-sign-service.cds +1 -1
  68. package/srv/cardano-sign-service.js +55 -173
  69. package/srv/cardano-tx-service.cds +1 -1
  70. package/srv/cardano-tx-service.js +54 -174
  71. package/srv/cardano-worker-service.js +7 -15
  72. package/srv/server.d.ts +27 -86
  73. package/srv/server.js +52 -148
  74. package/srv/utils/agent-grants-config.d.ts +11 -50
  75. package/srv/utils/agent-grants-config.js +12 -45
  76. package/srv/utils/agent-grants.d.ts +34 -123
  77. package/srv/utils/agent-grants.js +57 -156
  78. package/srv/utils/agent-token-auth.d.ts +2 -5
  79. package/srv/utils/agent-token-auth.js +2 -5
  80. package/srv/utils/backend-request-handler.d.ts +2 -16
  81. package/srv/utils/backend-request-handler.js +3 -18
  82. package/srv/utils/collections.d.ts +4 -8
  83. package/srv/utils/collections.js +4 -8
  84. package/srv/utils/const.d.ts +19 -68
  85. package/srv/utils/const.js +20 -69
  86. package/srv/utils/crypto.d.ts +3 -12
  87. package/srv/utils/crypto.js +5 -18
  88. package/srv/utils/db-indexes.d.ts +2 -7
  89. package/srv/utils/db-indexes.js +7 -34
  90. package/srv/utils/db-sanitize.d.ts +5 -18
  91. package/srv/utils/db-sanitize.js +6 -19
  92. package/srv/utils/error-codes.d.ts +18 -73
  93. package/srv/utils/error-codes.js +17 -70
  94. package/srv/utils/errors.d.ts +29 -191
  95. package/srv/utils/errors.js +44 -229
  96. package/srv/utils/liveness.d.ts +2 -9
  97. package/srv/utils/liveness.js +3 -11
  98. package/srv/utils/mappers.d.ts +50 -298
  99. package/srv/utils/mappers.js +80 -386
  100. package/srv/utils/network-context.js +2 -11
  101. package/srv/utils/pg-order-nulls.js +4 -23
  102. package/srv/utils/plutus-placeholders.d.ts +6 -18
  103. package/srv/utils/plutus-placeholders.js +6 -20
  104. package/srv/utils/rate-limiter.d.ts +6 -17
  105. package/srv/utils/rate-limiter.js +5 -15
  106. package/srv/utils/service-events.d.ts +2 -22
  107. package/srv/utils/service-events.js +3 -23
  108. package/srv/utils/signing-helper.d.ts +3 -18
  109. package/srv/utils/signing-helper.js +10 -32
  110. package/srv/utils/tx-build-helper.d.ts +18 -92
  111. package/srv/utils/tx-build-helper.js +32 -123
  112. package/srv/utils/tx-request-parsers.d.ts +7 -26
  113. package/srv/utils/tx-request-parsers.js +7 -26
  114. package/srv/utils/tx-utils.d.ts +4 -23
  115. package/srv/utils/tx-utils.js +12 -41
  116. package/srv/utils/types.d.ts +67 -206
  117. package/srv/utils/types.js +2 -6
  118. package/srv/utils/validators.d.ts +19 -89
  119. package/srv/utils/validators.js +31 -138
@@ -6,26 +6,18 @@ const backend_request_handler_1 = require("../../utils/backend-request-handler")
6
6
  const errors_1 = require("../../utils/errors");
7
7
  const mappers_1 = require("../../utils/mappers");
8
8
  const tx_build_helper_1 = require("../../utils/tx-build-helper");
9
- /**
10
- * BlockfrostBackend Implementation for CardanoBackend Interface
11
- * Implements the CardanoBackend interface using Blockfrost API SDK
12
- */
9
+ /** CardanoBackend + PaginatingBackend implementation on the Blockfrost API SDK. */
13
10
  class BlockfrostBackend {
14
11
  name = 'blockfrost';
15
12
  api;
16
13
  network;
17
14
  timeoutMs;
18
- /**
19
- * Constructor
20
- */
21
15
  constructor(network, timeoutMs, projectId, customBackend) {
22
16
  if (!projectId && !customBackend) {
23
17
  throw new errors_1.BackendInitError('blockfrost', new Error('Either projectId (BLOCKFROST_API_KEY) or customBackend (BLOCKFROST_CUSTOM_BACKEND) is required'));
24
18
  }
25
- // Dolos and some other self-hosted Blockfrost-compatible nodes reject empty
26
- // project_id headers even when they don't authenticate against them. The upstream
27
- // SDK validator accepts customBackend OR projectId — this substitution is purely
28
- // for the runtime HTTP header.
19
+ // Self-hosted Blockfrost-compatible nodes reject an empty project_id header
20
+ // even without authentication — placeholder for the runtime HTTP header only.
29
21
  const effectiveProjectId = projectId || 'self-hosted';
30
22
  this.api = new blockfrost_js_1.BlockFrostAPI({
31
23
  projectId: effectiveProjectId,
@@ -35,9 +27,6 @@ class BlockfrostBackend {
35
27
  this.network = network;
36
28
  this.timeoutMs = timeoutMs;
37
29
  }
38
- /**
39
- * Initialize the backend
40
- */
41
30
  async init() {
42
31
  this.api.options.requestTimeout = this.timeoutMs;
43
32
  // Test connection by fetching latest block
@@ -49,10 +38,7 @@ class BlockfrostBackend {
49
38
  }
50
39
  return true;
51
40
  }
52
- /**
53
- * Get Network Information
54
- * @returns {Promise<NetworkInformation>} network information
55
- */
41
+ /** Network information (supply, stake). */
56
42
  async getNetworkInformation() {
57
43
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
58
44
  const networkInfo = await this.api.network();
@@ -62,19 +48,11 @@ class BlockfrostBackend {
62
48
  };
63
49
  }, this.name);
64
50
  }
65
- /**
66
- * Get Block Data
67
- * @param blockHash block hash (hex)
68
- * @returns {Promise<BlockData>} block data
69
- */
51
+ /** Block by hash (hex). */
70
52
  async getBlock(blockHash) {
71
53
  return (0, backend_request_handler_1.handleBackendRequest)(async () => this.toBlockData(await this.api.blocks(blockHash)), this.name);
72
54
  }
73
- /**
74
- * Get Epoch Data
75
- * @param epochNumber epoch number
76
- * @returns {Promise<EpochData>} epoch data
77
- */
55
+ /** Epoch by number. */
78
56
  async getEpoch(epochNumber) {
79
57
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
80
58
  const epochData = await this.api.epochs(epochNumber);
@@ -92,11 +70,7 @@ class BlockfrostBackend {
92
70
  };
93
71
  }, this.name);
94
72
  }
95
- /**
96
- * Get Transaction Data
97
- * @param hash transaction hash (hex)
98
- * @returns {Promise<Transaction>} transaction data
99
- */
73
+ /** Transaction by hash (hex), with UTxOs and metadata. */
100
74
  async getTransaction(hash) {
101
75
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
102
76
  // independent endpoints — fetch in parallel instead of 3 sequential roundtrips
@@ -131,8 +105,6 @@ class BlockfrostBackend {
131
105
  dataHash: input.data_hash,
132
106
  inlineDatum: (0, tx_build_helper_1.inlineDatumToHex)(input.inline_datum),
133
107
  referenceScriptHash: input.reference_script_hash,
134
- // TxInputLine's names — these were mapped as `collateral`/`reference` before,
135
- // which nothing reads, so every consumer saw a reference input as a consumed one.
136
108
  isCollateral: input.collateral === true,
137
109
  isReference: input.reference === true,
138
110
  })),
@@ -150,11 +122,7 @@ class BlockfrostBackend {
150
122
  };
151
123
  }, this.name);
152
124
  }
153
- /**
154
- * Get Transaction Metadata
155
- * @param tx_hash transaction hash (hex)
156
- * @returns {Promise<MetadataLabelTx[]>} transaction metadata list
157
- */
125
+ /** Metadata labels of a transaction (hash hex); NotFoundError when it has none. */
158
126
  async getTransactionMetadata(tx_hash) {
159
127
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
160
128
  const txMetadata = await this.api.txsMetadata(tx_hash);
@@ -168,16 +136,11 @@ class BlockfrostBackend {
168
136
  }));
169
137
  }, this.name);
170
138
  }
171
- /**
172
- * Get Address Data (without transactions - use getAddressTransactions() separately)
173
- * @param address bech32 address string
174
- * @returns {Promise<Address>} address data
175
- */
139
+ /** Address data with UTxOs (no transactions — see getAddressTransactions()). */
176
140
  async getAddress(address) {
177
141
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
178
142
  const address_data = await this.api.addresses(address);
179
- // *All variant paginates internally — addressesUtxos caps at 100 entries,
180
- // silently truncating larger wallets (wrong balances / spurious InsufficientFunds)
143
+ // *All variant paginates internally — plain addressesUtxos caps at 100 entries and silently truncates
181
144
  const address_utxos = await this.api.addressesUtxosAll(address);
182
145
  return {
183
146
  address: address_data.address,
@@ -198,11 +161,7 @@ class BlockfrostBackend {
198
161
  };
199
162
  }, this.name);
200
163
  }
201
- /**
202
- * Get Address Transactions
203
- * @param address bech32 address string
204
- * @returns {Promise<Transaction[]>} list of transactions for this address
205
- */
164
+ /** Transactions of an address, most recent first, with full details (batched). */
206
165
  async getAddressTransactions(address, limit) {
207
166
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
208
167
  // Blockfrost rejects count > 100 with a 400 — clamp instead
@@ -221,11 +180,7 @@ class BlockfrostBackend {
221
180
  return transactions;
222
181
  }, this.name);
223
182
  }
224
- /**
225
- * Get Address UTxOs
226
- * @param address bech32 address string
227
- * @returns {Promise<UTxO[]>} list of UTxOs
228
- */
183
+ /** UTxOs of an address. */
229
184
  async getAddressUtxos(address) {
230
185
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
231
186
  // *All variant paginates internally (plain addressesUtxos caps at 100 entries)
@@ -242,11 +197,7 @@ class BlockfrostBackend {
242
197
  }));
243
198
  }, this.name);
244
199
  }
245
- /**
246
- * Get Pool Data
247
- * @param poolId stake pool id (hex)
248
- * @return {Promise<PoolData>} pool data
249
- */
200
+ /** Stake pool by id. */
250
201
  async getPool(poolId) {
251
202
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
252
203
  const poolData = await this.api.poolsById(poolId);
@@ -258,8 +209,7 @@ class BlockfrostBackend {
258
209
  liveStake: poolData.live_stake || '0',
259
210
  liveSize: poolData.live_size,
260
211
  liveDelegators: poolData.live_delegators,
261
- // Blockfrost already reports a fraction (0.7542 = 75.42 %), which is the
262
- // canonical unit — see the conversion in KoiosBackend._mapKoiosPool.
212
+ // Blockfrost reports saturation as a fraction (0.7542 = 75.42 %), the canonical unit
263
213
  liveSaturation: poolData.live_saturation,
264
214
  activeStake: poolData.active_stake || '0',
265
215
  activeSize: poolData.active_size,
@@ -271,11 +221,8 @@ class BlockfrostBackend {
271
221
  }, this.name);
272
222
  }
273
223
  /**
274
- * Get Asset Info (supply, mint history, CIP-25 + CIP-26 metadata).
275
- * Blockfrost does NOT expose initial-mint timestamp in this endpoint —
276
- * `initialMintTime` is left null. Filling it would cost an extra tx fetch.
277
- * @param unit policyId + assetNameHex (concatenated hex)
278
- * @return {Promise<AssetInfo>} canonical asset info
224
+ * Asset info (supply, mint history, CIP-25 + CIP-26 metadata); unit = policyId + assetNameHex.
225
+ * Blockfrost does not expose the initial-mint timestamp here, so `initialMintTime` stays null.
279
226
  */
280
227
  async getAssetInfo(unit) {
281
228
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
@@ -303,14 +250,9 @@ class BlockfrostBackend {
303
250
  }, this.name);
304
251
  }
305
252
  /**
306
- * Get latest mint/burn events for an asset, with backfilled block metadata.
307
- * Blockfrost's `assetsHistory` returns tx_hash + action + amount only; we
308
- * backfill `blockTime` and `blockHeight` via concurrent `api.txs(...)` calls.
309
- * Cost: 1 extra API call per history entry. Failed tx fetches leave the
310
- * timestamp fields null instead of failing the whole call (best-effort).
311
- * @param unit policyId + assetNameHex (concatenated hex)
312
- * @param limit max number of events (default 100, max 100 per Blockfrost page)
313
- * @return {Promise<AssetHistoryEntry[]>} list of mint/burn events (most recent first)
253
+ * Mint/burn events of an asset, most recent first (max 100 per Blockfrost page).
254
+ * `assetsHistory` carries no block metadata; blockTime/blockHeight are backfilled with one
255
+ * best-effort `txs()` call per entry (a failed fetch leaves them null).
314
256
  */
315
257
  async getAssetHistory(unit, limit = 100) {
316
258
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
@@ -348,11 +290,7 @@ class BlockfrostBackend {
348
290
  });
349
291
  }, this.name);
350
292
  }
351
- /**
352
- * Get Drep Data
353
- * @param drepId drep id (bech32)
354
- * @return {Promise<DrepData>} drep data
355
- */
293
+ /** DRep by id (bech32). */
356
294
  async getDrep(drepId) {
357
295
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
358
296
  const drepData = await this.api.governance.drepsById(drepId);
@@ -367,11 +305,7 @@ class BlockfrostBackend {
367
305
  };
368
306
  }, this.name);
369
307
  }
370
- /**
371
- * Get Account Data
372
- * @param stakeAddress bech32 stake address
373
- * @return {Promise<AccountData>} account data
374
- */
308
+ /** Account by stake address (bech32), with all its addresses and their UTxOs. */
375
309
  async getAccount(stakeAddress) {
376
310
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
377
311
  const accountData = await this.api.accounts(stakeAddress);
@@ -400,11 +334,7 @@ class BlockfrostBackend {
400
334
  };
401
335
  }, this.name);
402
336
  }
403
- /**
404
- * Submit Transaction
405
- * @param signedTxCbor hex-encoded signed transaction CBOR
406
- * @returns {Promise<string>} transaction hash
407
- */
337
+ /** Submit a signed transaction (CBOR hex); returns the tx hash. */
408
338
  async submitTransaction(signedTxCbor) {
409
339
  const txBytes = Buffer.from(signedTxCbor, "hex");
410
340
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
@@ -412,10 +342,7 @@ class BlockfrostBackend {
412
342
  return txHash;
413
343
  }, this.name);
414
344
  }
415
- /**
416
- * Get Protocol Parameters
417
- * @returns {Promise<LedgerProtocolParameters>} protocol parameters
418
- */
345
+ /** Protocol parameters of the latest epoch. */
419
346
  async getProtocolParameters() {
420
347
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
421
348
  const protocolParams = await this.api.epochsLatestParameters();
@@ -457,10 +384,7 @@ class BlockfrostBackend {
457
384
  };
458
385
  }, this.name);
459
386
  }
460
- /**
461
- * Get Latest Epoch Data
462
- * @returns {Promise<EpochData>} latest epoch data
463
- */
387
+ /** Latest epoch. */
464
388
  async getLatestEpoch() {
465
389
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
466
390
  const epochData = await this.api.epochsLatest();
@@ -478,10 +402,7 @@ class BlockfrostBackend {
478
402
  };
479
403
  }, this.name);
480
404
  }
481
- /**
482
- * Get Latest Block Data
483
- * @returns {Promise<BlockData>} latest block data
484
- */
405
+ /** Latest block. */
485
406
  async getLatestBlock() {
486
407
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
487
408
  const blockdata = await this.api.blocksLatest();
@@ -499,10 +420,7 @@ class BlockfrostBackend {
499
420
  };
500
421
  }, this.name);
501
422
  }
502
- /**
503
- * Get the latest chain tip slot.
504
- * @returns {Promise<number>} current chain slot
505
- */
423
+ /** Latest chain tip slot; ProviderUnavailableError when the latest block has no slot. */
506
424
  async getCurrentSlot() {
507
425
  const block = await this.getLatestBlock();
508
426
  if (block.slot == null) {
@@ -510,12 +428,7 @@ class BlockfrostBackend {
510
428
  }
511
429
  return block.slot;
512
430
  }
513
- /**
514
- * Check whether a UTxO is still unspent via Blockfrost's `consumed_by_tx` field.
515
- * @param txHash 64-char lowercase hex
516
- * @param outputIndex non-negative integer
517
- * @returns {Promise<boolean>} true iff the UTxO exists and is unspent
518
- */
431
+ /** Whether a UTxO is unspent, via Blockfrost's `consumed_by_tx`; false for unknown tx or out-of-range index. */
519
432
  async isUtxoUnspent(txHash, outputIndex) {
520
433
  if (!Number.isInteger(outputIndex) || outputIndex < 0)
521
434
  return false;
@@ -525,9 +438,8 @@ class BlockfrostBackend {
525
438
  const out = utxos?.outputs?.find(o => o.output_index === outputIndex);
526
439
  if (!out)
527
440
  return false;
528
- // consumed_by_tx is optional on the openapi type (added in Blockfrost
529
- // server v0.1.59). If absent we cannot prove unspent — escalate so the
530
- // router falls through to another backend rather than silently lying.
441
+ // consumed_by_tx is optional on the openapi type (Blockfrost server >= 0.1.59); without it
442
+ // unspent cannot be proven — escalate so the router falls through to another backend.
531
443
  const consumed = out.consumed_by_tx;
532
444
  if (consumed === undefined) {
533
445
  throw new errors_1.ProviderUnavailableError(`${this.name}: server does not expose consumed_by_tx — cannot determine UTxO status`, this.name);
@@ -546,12 +458,7 @@ class BlockfrostBackend {
546
458
  //-----------------------------------------------------------------------------
547
459
  /** Max concurrent Blockfrost API calls (free tier: ~10 req/s) */
548
460
  static MAX_CONCURRENT = 10;
549
- /**
550
- * Get transaction hashes for an address (lightweight — no full tx details).
551
- * @param address bech32 address
552
- * @param limit maximum number of hashes
553
- * @returns {Promise<string[]>} most recent tx hashes
554
- */
461
+ /** Most recent tx hashes of an address (no details). */
555
462
  async getAddressTransactionHashes(address, limit) {
556
463
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
557
464
  // Blockfrost rejects count > 100 with a 400 — clamp instead
@@ -560,12 +467,7 @@ class BlockfrostBackend {
560
467
  return txs.map(tx => tx.tx_hash);
561
468
  }, this.name);
562
469
  }
563
- /**
564
- * Batch fetch multiple transactions by hash.
565
- * Blockfrost has no batch endpoint — uses concurrency-limited parallel calls.
566
- * @param txHashes array of transaction hashes
567
- * @returns {Promise<Map<string, Transaction>>} map of hash -> Transaction
568
- */
470
+ /** Transactions by hash (map hash -> Transaction); no batch endpoint, so concurrency-limited parallel calls. */
569
471
  async getTransactionsBatch(txHashes) {
570
472
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
571
473
  const result = new Map();
@@ -581,12 +483,9 @@ class BlockfrostBackend {
581
483
  }, this.name);
582
484
  }
583
485
  // ---------------------------------------------------------------------------
584
- // PaginatingBackend — forward iteration for the chain crawler (v2.0)
486
+ // PaginatingBackend — forward iteration for the chain crawler
585
487
  // ---------------------------------------------------------------------------
586
- /**
587
- * Map a Blockfrost block summary (from blocks()/blocksNext()) to our BlockData.
588
- * Same shape getBlock() maps inline — kept private to avoid touching getBlock().
589
- */
488
+ /** Map a Blockfrost block summary (blocks()/blocksNext()) to BlockData. */
590
489
  toBlockData(b) {
591
490
  return {
592
491
  time: b.time,
@@ -601,16 +500,11 @@ class BlockfrostBackend {
601
500
  fees: b.fees,
602
501
  };
603
502
  }
604
- /**
605
- * Get a block by its height. Blockfrost's `blocks` endpoint accepts a height as
606
- * well as a hash.
607
- */
503
+ /** Block by height; Blockfrost's `blocks` endpoint accepts a height as well as a hash. */
608
504
  async getBlockByHeight(height) {
609
505
  return (0, backend_request_handler_1.handleBackendRequest)(async () => this.toBlockData(await this.api.blocks(height)), this.name);
610
506
  }
611
- /**
612
- * Get up to `count` blocks immediately following `afterHash`, in ascending chain order.
613
- */
507
+ /** Up to `count` blocks immediately following `afterHash`, in ascending chain order. */
614
508
  async getNextBlocks(afterHash, count) {
615
509
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
616
510
  let blocks;
@@ -618,11 +512,9 @@ class BlockfrostBackend {
618
512
  blocks = await this.api.blocksNext(afterHash, { count });
619
513
  }
620
514
  catch (err) {
621
- // Blockfrost only knows canonical blocks — a 404 on the anchor means the
622
- // cursor block was orphaned by a reorg. Emit the crawler's explicit
623
- // mismatch signal (same contract as KoiosBackend.getNextBlocks); a plain
624
- // NotFoundError would be treated as transient and the crawler would halt
625
- // with an error streak instead of entering reorg recovery.
515
+ // Blockfrost only knows canonical blocks: a 404 on the anchor means the cursor block was
516
+ // orphaned by a reorg. Signal CHAIN_POINT_MISMATCH so the crawler enters reorg recovery;
517
+ // a plain NotFoundError would count as transient and halt it with an error streak.
626
518
  const normalized = (0, errors_1.normalizeBackendError)(err, this.name);
627
519
  if (normalized.statusCode === 404) {
628
520
  throw new errors_1.ProviderUnavailableError(`CHAIN_POINT_MISMATCH: cursor block ${afterHash} is unknown to ${this.name} — likely orphaned by a reorg`, this.name);
@@ -632,10 +524,7 @@ class BlockfrostBackend {
632
524
  return blocks.map(b => this.toBlockData(b));
633
525
  }, this.name);
634
526
  }
635
- /**
636
- * Get the full transaction list of a block in block order. Blockfrost returns tx
637
- * hashes; details are batched via getTransactionsBatch. Order is preserved.
638
- */
527
+ /** Full transaction list of a block in block order (hashes from blocksTxsAll, details batched). */
639
528
  async getBlockTransactions(blockHash) {
640
529
  return (0, backend_request_handler_1.handleBackendRequest)(async () => {
641
530
  const hashes = await this.api.blocksTxsAll(blockHash);