@odatano/core 2.0.0-rc.5 → 2.0.0-rc.51

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 (239) hide show
  1. package/@cds-models/CardanoAgentService/index.d.ts +99 -51
  2. package/@cds-models/CardanoAgentService/index.js +15 -0
  3. package/@cds-models/CardanoBackendService/index.d.ts +358 -0
  4. package/@cds-models/CardanoBackendService/index.js +41 -0
  5. package/@cds-models/CardanoIndexerService/index.d.ts +594 -11
  6. package/@cds-models/CardanoIndexerService/index.js +74 -0
  7. package/@cds-models/CardanoODataService/index.d.ts +417 -57
  8. package/@cds-models/CardanoODataService/index.js +42 -0
  9. package/@cds-models/CardanoSignService/index.d.ts +45 -19
  10. package/@cds-models/CardanoSignService/index.js +4 -0
  11. package/@cds-models/CardanoTransactionService/index.d.ts +70 -44
  12. package/@cds-models/CardanoTransactionService/index.js +5 -0
  13. package/@cds-models/CardanoWorkerService/index.d.ts +35 -22
  14. package/@cds-models/CardanoWorkerService/index.js +2 -0
  15. package/@cds-models/index.d.ts +114 -4
  16. package/@cds-models/index.js +20 -4
  17. package/@cds-models/odatano/cardano/index.d.ts +451 -32
  18. package/@cds-models/odatano/cardano/index.js +48 -0
  19. package/README.md +103 -167
  20. package/db/schema.cds +2455 -1705
  21. package/db/types.cds +456 -295
  22. package/package.json +41 -53
  23. package/scripts/deploy-schema.mjs +113 -0
  24. package/scripts/migrate-schema.mjs +528 -0
  25. package/scripts/migrate-slot-leader.mjs +96 -0
  26. package/src/index.d.ts +20 -21
  27. package/src/index.js +45 -31
  28. package/src/plugin.js +17 -35
  29. package/srv/blockchain/asset-decimals.d.ts +7 -0
  30. package/srv/blockchain/asset-decimals.js +91 -0
  31. package/srv/blockchain/backends/blockfrost-backend.d.ts +25 -137
  32. package/srv/blockchain/backends/blockfrost-backend.js +125 -215
  33. package/srv/blockchain/backends/call-signal.d.ts +7 -0
  34. package/srv/blockchain/backends/call-signal.js +22 -0
  35. package/srv/blockchain/backends/cardano-backend.d.ts +100 -189
  36. package/srv/blockchain/backends/cardano-backend.js +29 -5
  37. package/srv/blockchain/backends/koios-backend.d.ts +108 -170
  38. package/srv/blockchain/backends/koios-backend.js +488 -482
  39. package/srv/blockchain/backends/odatano-backend.d.ts +55 -0
  40. package/srv/blockchain/backends/odatano-backend.js +211 -0
  41. package/srv/blockchain/backends/ogmios-backend.d.ts +122 -190
  42. package/srv/blockchain/backends/ogmios-backend.js +683 -327
  43. package/srv/blockchain/backends/ogmios-frame-guard.d.ts +14 -0
  44. package/srv/blockchain/backends/ogmios-frame-guard.js +89 -0
  45. package/srv/blockchain/cardano-client.d.ts +71 -241
  46. package/srv/blockchain/cardano-client.js +354 -322
  47. package/srv/blockchain/cardano-indexer.d.ts +295 -283
  48. package/srv/blockchain/cardano-indexer.js +1690 -502
  49. package/srv/blockchain/cardano-tx-builder.d.ts +25 -89
  50. package/srv/blockchain/cardano-tx-builder.js +164 -140
  51. package/srv/blockchain/circuit-breaker.d.ts +2 -13
  52. package/srv/blockchain/circuit-breaker.js +11 -15
  53. package/srv/blockchain/crawler/account-snapshots.d.ts +29 -0
  54. package/srv/blockchain/crawler/account-snapshots.js +173 -0
  55. package/srv/blockchain/crawler/asset-decimals-backfill.d.ts +17 -0
  56. package/srv/blockchain/crawler/asset-decimals-backfill.js +56 -0
  57. package/srv/blockchain/crawler/asset-registry-backfill.d.ts +46 -0
  58. package/srv/blockchain/crawler/asset-registry-backfill.js +157 -0
  59. package/srv/blockchain/crawler/asset-slice-backfill.d.ts +35 -0
  60. package/srv/blockchain/crawler/asset-slice-backfill.js +149 -0
  61. package/srv/blockchain/crawler/certificate-backfill.d.ts +56 -0
  62. package/srv/blockchain/crawler/certificate-backfill.js +174 -0
  63. package/srv/blockchain/crawler/crawler.d.ts +125 -81
  64. package/srv/blockchain/crawler/crawler.js +738 -167
  65. package/srv/blockchain/crawler/credential-backfill.d.ts +30 -0
  66. package/srv/blockchain/crawler/credential-backfill.js +101 -0
  67. package/srv/blockchain/crawler/hooks.d.ts +2 -17
  68. package/srv/blockchain/crawler/index.d.ts +1 -8
  69. package/srv/blockchain/crawler/index.js +31 -17
  70. package/srv/blockchain/crawler/input-asset-copies.d.ts +34 -0
  71. package/srv/blockchain/crawler/input-asset-copies.js +161 -0
  72. package/srv/blockchain/crawler/key-pages.d.ts +12 -0
  73. package/srv/blockchain/crawler/key-pages.js +48 -0
  74. package/srv/blockchain/crawler/metadata-position-backfill.d.ts +22 -0
  75. package/srv/blockchain/crawler/metadata-position-backfill.js +59 -0
  76. package/srv/blockchain/crawler/output-datum-backfill.d.ts +41 -0
  77. package/srv/blockchain/crawler/output-datum-backfill.js +100 -0
  78. package/srv/blockchain/crawler/sync-state.d.ts +31 -47
  79. package/srv/blockchain/crawler/sync-state.js +135 -128
  80. package/srv/blockchain/crawler/transaction-backfill.d.ts +46 -0
  81. package/srv/blockchain/crawler/transaction-backfill.js +271 -0
  82. package/srv/blockchain/crawler/utxo-set-import.d.ts +66 -0
  83. package/srv/blockchain/crawler/utxo-set-import.js +399 -0
  84. package/srv/blockchain/crawler/window-plan.d.ts +31 -0
  85. package/srv/blockchain/crawler/window-plan.js +59 -0
  86. package/srv/blockchain/ledger-state.d.ts +62 -0
  87. package/srv/blockchain/ledger-state.js +521 -0
  88. package/srv/blockchain/pending-spends.d.ts +16 -0
  89. package/srv/blockchain/pending-spends.js +81 -0
  90. package/srv/blockchain/pool-metadata.d.ts +15 -0
  91. package/srv/blockchain/pool-metadata.js +132 -0
  92. package/srv/blockchain/request-coalescer.d.ts +2 -16
  93. package/srv/blockchain/request-coalescer.js +2 -16
  94. package/srv/blockchain/signing/cose-verifier.d.ts +3 -17
  95. package/srv/blockchain/signing/cose-verifier.js +146 -70
  96. package/srv/blockchain/signing/external-signer.d.ts +15 -115
  97. package/srv/blockchain/signing/external-signer.js +22 -131
  98. package/srv/blockchain/signing/failed-recheck.d.ts +17 -0
  99. package/srv/blockchain/signing/failed-recheck.js +135 -0
  100. package/srv/blockchain/signing/hsm-signer.d.ts +10 -54
  101. package/srv/blockchain/signing/hsm-signer.js +28 -79
  102. package/srv/blockchain/signing/landing-proof.d.ts +60 -0
  103. package/srv/blockchain/signing/landing-proof.js +224 -0
  104. package/srv/blockchain/signing/signature-verifier.d.ts +9 -47
  105. package/srv/blockchain/signing/signature-verifier.js +71 -87
  106. package/srv/blockchain/signing/submission-finalizer.d.ts +37 -45
  107. package/srv/blockchain/signing/submission-finalizer.js +280 -86
  108. package/srv/blockchain/stored-chain.d.ts +19 -0
  109. package/srv/blockchain/stored-chain.js +258 -0
  110. package/srv/blockchain/transaction-building/buildooor-tx.d.ts +31 -229
  111. package/srv/blockchain/transaction-building/buildooor-tx.js +663 -421
  112. package/srv/blockchain/transaction-building/cardano-tx.d.ts +9 -37
  113. package/srv/blockchain/transaction-presence.d.ts +12 -0
  114. package/srv/blockchain/transaction-presence.js +29 -0
  115. package/srv/blockchain/transaction-rows.d.ts +12 -0
  116. package/srv/blockchain/transaction-rows.js +44 -0
  117. package/srv/blockchain/wallet-worker/build-request.d.ts +8 -23
  118. package/srv/blockchain/wallet-worker/build-request.js +40 -353
  119. package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +27 -47
  120. package/srv/blockchain/wallet-worker/confirmation-tracker.js +158 -61
  121. package/srv/blockchain/wallet-worker/index.d.ts +1 -1
  122. package/srv/blockchain/wallet-worker/index.js +3 -11
  123. package/srv/blockchain/wallet-worker/invalidation.d.ts +35 -0
  124. package/srv/blockchain/wallet-worker/invalidation.js +128 -0
  125. package/srv/blockchain/wallet-worker/job-store.d.ts +58 -150
  126. package/srv/blockchain/wallet-worker/job-store.js +200 -273
  127. package/srv/blockchain/wallet-worker/lease-heartbeat.d.ts +2 -26
  128. package/srv/blockchain/wallet-worker/lease-heartbeat.js +6 -28
  129. package/srv/blockchain/wallet-worker/signers.d.ts +5 -24
  130. package/srv/blockchain/wallet-worker/signers.js +4 -12
  131. package/srv/blockchain/wallet-worker/wallet-worker.d.ts +29 -82
  132. package/srv/blockchain/wallet-worker/wallet-worker.js +334 -198
  133. package/srv/cardano-agent-service.cds +122 -84
  134. package/srv/cardano-agent-service.js +12 -9
  135. package/srv/cardano-backend-service.cds +81 -0
  136. package/srv/cardano-backend-service.d.ts +2 -0
  137. package/srv/cardano-backend-service.js +259 -0
  138. package/srv/cardano-indexer-service.cds +393 -18
  139. package/srv/cardano-indexer-service.d.ts +5 -1
  140. package/srv/cardano-indexer-service.js +477 -16
  141. package/srv/cardano-service.cds +426 -269
  142. package/srv/cardano-service.js +640 -217
  143. package/srv/cardano-sign-service.cds +211 -180
  144. package/srv/cardano-sign-service.js +210 -287
  145. package/srv/cardano-tx-service.cds +462 -370
  146. package/srv/cardano-tx-service.js +283 -800
  147. package/srv/cardano-ui.cds +16 -16
  148. package/srv/cardano-worker-service.cds +141 -125
  149. package/srv/cardano-worker-service.js +104 -61
  150. package/srv/cbor/cip68.d.ts +13 -0
  151. package/srv/cbor/cip68.js +56 -0
  152. package/srv/cbor/index.d.ts +3 -1
  153. package/srv/cbor/index.js +9 -1
  154. package/srv/cbor/parse.d.ts +30 -18
  155. package/srv/cbor/parse.js +44 -9
  156. package/srv/cbor/plutus-data-json.d.ts +20 -0
  157. package/srv/cbor/plutus-data-json.js +32 -0
  158. package/srv/config.d.ts +117 -0
  159. package/srv/config.js +419 -0
  160. package/srv/server.d.ts +15 -110
  161. package/srv/server.js +83 -405
  162. package/srv/utils/agent-access.d.ts +11 -0
  163. package/srv/utils/agent-access.js +86 -0
  164. package/srv/utils/agent-grants-config.d.ts +0 -46
  165. package/srv/utils/agent-grants-config.js +17 -85
  166. package/srv/utils/agent-grants.d.ts +106 -122
  167. package/srv/utils/agent-grants.js +538 -237
  168. package/srv/utils/agent-token-auth.d.ts +4 -99
  169. package/srv/utils/agent-token-auth.js +62 -186
  170. package/srv/utils/backend-request-handler.d.ts +3 -17
  171. package/srv/utils/backend-request-handler.js +3 -18
  172. package/srv/utils/build-request.d.ts +52 -0
  173. package/srv/utils/build-request.js +487 -0
  174. package/srv/utils/collections.d.ts +4 -10
  175. package/srv/utils/collections.js +14 -10
  176. package/srv/utils/const.d.ts +32 -75
  177. package/srv/utils/const.js +40 -80
  178. package/srv/utils/crypto.d.ts +3 -12
  179. package/srv/utils/crypto.js +11 -25
  180. package/srv/utils/db-indexes.d.ts +31 -0
  181. package/srv/utils/db-indexes.js +185 -0
  182. package/srv/utils/db-kind.d.ts +23 -0
  183. package/srv/utils/db-kind.js +42 -0
  184. package/srv/utils/db-sanitize.d.ts +20 -0
  185. package/srv/utils/db-sanitize.js +80 -0
  186. package/srv/utils/deep-json.d.ts +6 -0
  187. package/srv/utils/deep-json.js +240 -0
  188. package/srv/utils/detached-run.d.ts +41 -0
  189. package/srv/utils/detached-run.js +101 -0
  190. package/srv/utils/epoch-slots.d.ts +14 -0
  191. package/srv/utils/epoch-slots.js +45 -0
  192. package/srv/utils/error-codes.d.ts +26 -75
  193. package/srv/utils/error-codes.js +27 -72
  194. package/srv/utils/errors.d.ts +55 -187
  195. package/srv/utils/errors.js +161 -235
  196. package/srv/utils/lease.d.ts +20 -0
  197. package/srv/utils/lease.js +62 -0
  198. package/srv/utils/liveness.d.ts +12 -0
  199. package/srv/utils/liveness.js +35 -0
  200. package/srv/utils/mappers.d.ts +111 -223
  201. package/srv/utils/mappers.js +432 -371
  202. package/srv/utils/navigation.d.ts +17 -0
  203. package/srv/utils/navigation.js +52 -0
  204. package/srv/utils/network-context.d.ts +0 -1
  205. package/srv/utils/network-context.js +9 -15
  206. package/srv/utils/paging.d.ts +31 -0
  207. package/srv/utils/paging.js +43 -0
  208. package/srv/utils/pg-inline-json.d.ts +8 -0
  209. package/srv/utils/pg-inline-json.js +58 -0
  210. package/srv/utils/pg-order-nulls.d.ts +14 -0
  211. package/srv/utils/pg-order-nulls.js +54 -0
  212. package/srv/utils/plutus-placeholders.d.ts +16 -22
  213. package/srv/utils/plutus-placeholders.js +62 -33
  214. package/srv/utils/rate-limiter.d.ts +2 -21
  215. package/srv/utils/rate-limiter.js +5 -17
  216. package/srv/utils/readiness.d.ts +12 -0
  217. package/srv/utils/readiness.js +29 -0
  218. package/srv/utils/reference-script.d.ts +19 -0
  219. package/srv/utils/reference-script.js +84 -0
  220. package/srv/utils/resolution.d.ts +13 -0
  221. package/srv/utils/resolution.js +47 -0
  222. package/srv/utils/result-numbers.d.ts +15 -0
  223. package/srv/utils/result-numbers.js +61 -0
  224. package/srv/utils/row-values.d.ts +7 -0
  225. package/srv/utils/row-values.js +27 -0
  226. package/srv/utils/service-events.d.ts +0 -24
  227. package/srv/utils/service-events.js +3 -25
  228. package/srv/utils/signing-helper.d.ts +3 -20
  229. package/srv/utils/signing-helper.js +35 -64
  230. package/srv/utils/tx-build-helper.d.ts +25 -105
  231. package/srv/utils/tx-build-helper.js +108 -156
  232. package/srv/utils/tx-request-parsers.d.ts +82 -33
  233. package/srv/utils/tx-request-parsers.js +401 -49
  234. package/srv/utils/tx-utils.d.ts +3 -27
  235. package/srv/utils/tx-utils.js +32 -50
  236. package/srv/utils/types.d.ts +294 -232
  237. package/srv/utils/types.js +2 -22
  238. package/srv/utils/validators.d.ts +22 -92
  239. package/srv/utils/validators.js +60 -170
@@ -0,0 +1,55 @@
1
+ import { CardanoBackend, EvaluatingBackend, PaginatingBackend, EnumeratingBackend } from './cardano-backend';
2
+ import type { Transaction, Address, UTxO, NetworkInformation, EpochData, MetadataLabelTx, BlockData, PoolData, DrepData, AccountData, AssetInfo, AssetHistoryEntry, LedgerProtocolParameters, ScriptEvaluationResult } from '../../utils/types';
3
+ import { Network } from '../cardano-client';
4
+ /** Public ODATANO API per network; mainnet has no default and needs `odatanoUrl`. */
5
+ export declare const ODATANO_API_URLS: Partial<Record<Network, string>>;
6
+ export declare class OdatanoBackend implements CardanoBackend, EvaluatingBackend, PaginatingBackend, EnumeratingBackend {
7
+ readonly name = "odatano";
8
+ private readonly api;
9
+ /** Units left on the key, from the gateway's `x-access-units-left` header; null when not reported. */
10
+ unitsLeft: number | null;
11
+ constructor(network: Network, timeoutMs: number, url: string | undefined, apiKey: string | undefined);
12
+ /** Probe the remote instance with its cheapest call. */
13
+ init(): Promise<boolean>;
14
+ getTransaction(txHash: string): Promise<Transaction>;
15
+ getAddress(address: string): Promise<Address>;
16
+ getAddressUtxos(address: string): Promise<UTxO[]>;
17
+ getAddressTransactions(address: string, limit: number): Promise<Transaction[]>;
18
+ getAddressTransactionHashes(address: string, limit: number): Promise<string[]>;
19
+ getTransactionsBatch(txHashes: string[]): Promise<Map<string, Transaction>>;
20
+ getCredentialUtxos(credHash: string): Promise<UTxO[]>;
21
+ /** Unspent outputs among `refs`, from the remote's node (with reference-script bytes). */
22
+ getUnspentOutputs(refs: Array<{
23
+ txHash: string;
24
+ outputIndex: number;
25
+ }>): Promise<UTxO[]>;
26
+ getNetworkInformation(): Promise<NetworkInformation>;
27
+ getTransactionMetadata(txHash: string): Promise<MetadataLabelTx[]>;
28
+ getBlock(blockHash: string): Promise<BlockData>;
29
+ getEpoch(epochNumber: number): Promise<EpochData>;
30
+ getLatestEpoch(): Promise<EpochData>;
31
+ getLatestBlock(): Promise<BlockData>;
32
+ getCurrentSlot(): Promise<number>;
33
+ isUtxoUnspent(txHash: string, outputIndex: number): Promise<boolean>;
34
+ getPool(poolId: string): Promise<PoolData>;
35
+ getDrep(drepId: string): Promise<DrepData>;
36
+ getAccount(stakeAddress: string): Promise<AccountData>;
37
+ isRewardAccountRegistered(stakeAddress: string): Promise<boolean | null>;
38
+ getAssetInfo(unit: string): Promise<AssetInfo>;
39
+ getAssetHistory(unit: string, limit?: number): Promise<AssetHistoryEntry[]>;
40
+ getProtocolParameters(): Promise<LedgerProtocolParameters>;
41
+ submitTransaction(signedTxCbor: string): Promise<string>;
42
+ evaluateTransaction(unsignedTxCbor: string): Promise<ScriptEvaluationResult[]>;
43
+ getBlockByHeight(height: number): Promise<BlockData>;
44
+ getNextBlocks(afterHash: string, count: number, afterHeight?: number): Promise<BlockData[]>;
45
+ getBlockTransactions(blockHash: string, txCount?: number): Promise<Transaction[]>;
46
+ getPoolIds(): Promise<string[]>;
47
+ getPools(poolIds: string[]): Promise<PoolData[]>;
48
+ getDrepIds(): Promise<string[]>;
49
+ getDreps(drepIds: string[]): Promise<DrepData[]>;
50
+ shutdown(): Promise<void>;
51
+ private batched;
52
+ private call;
53
+ private mapError;
54
+ }
55
+ //# sourceMappingURL=odatano-backend.d.ts.map
@@ -0,0 +1,211 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.OdatanoBackend = exports.ODATANO_API_URLS = void 0;
7
+ const cds_1 = __importDefault(require("@sap/cds"));
8
+ const axios_1 = __importDefault(require("axios"));
9
+ const deep_json_1 = require("../../utils/deep-json");
10
+ const errors_1 = require("../../utils/errors");
11
+ const error_codes_1 = require("../../utils/error-codes");
12
+ const call_signal_1 = require("./call-signal");
13
+ const logger = cds_1.default.log('OdatanoBackend');
14
+ // `scriptRef` is the script hash. An older remote fed by Koios sends the script CBOR there instead;
15
+ // that moves to `scriptRefCbor`, and the hash stays unknown.
16
+ function scriptRefAsHash(u) {
17
+ if (!u.scriptRef || u.scriptRef.length <= 56)
18
+ return u;
19
+ return { ...u, scriptRef: null, scriptRefCbor: u.scriptRefCbor ?? u.scriptRef };
20
+ }
21
+ /** Public ODATANO API per network; mainnet has no default and needs `odatanoUrl`. */
22
+ exports.ODATANO_API_URLS = {
23
+ preview: 'https://api.preview.odatano.dev',
24
+ preprod: 'https://api.preprod.odatano.dev',
25
+ };
26
+ const SERVICE_PATH = '/odata/v4/cardano-backend';
27
+ /** Ids per GetPools / GetDreps call, below the service's list cap. */
28
+ const ENUMERATION_BATCH = 200;
29
+ // Backend over another ODATANO instance via its `CardanoBackendService`.
30
+ // Answers arrive in the provider shape, so callers treat it like Koios.
31
+ class OdatanoBackend {
32
+ name = 'odatano';
33
+ api;
34
+ /** Units left on the key, from the gateway's `x-access-units-left` header; null when not reported. */
35
+ unitsLeft = null;
36
+ constructor(network, timeoutMs, url, apiKey) {
37
+ const baseURL = (url || exports.ODATANO_API_URLS[network] || '').replace(/\/+$/, '');
38
+ if (!baseURL) {
39
+ throw new errors_1.BackendInitError('odatano', new Error(`odatanoUrl is required on ${network}`));
40
+ }
41
+ if (!/^https?:\/\//i.test(baseURL)) {
42
+ throw new errors_1.BackendInitError('odatano', new Error(`odatanoUrl must be an http(s) URL, got "${baseURL}"`));
43
+ }
44
+ this.api = axios_1.default.create({
45
+ baseURL: baseURL + SERVICE_PATH,
46
+ timeout: timeoutMs,
47
+ headers: {
48
+ 'Content-Type': 'application/json',
49
+ ...(apiKey ? { Authorization: `Bearer ${apiKey}` } : {}),
50
+ },
51
+ });
52
+ }
53
+ /** Probe the remote instance with its cheapest call. */
54
+ async init() {
55
+ await this.call('GetCurrentSlot');
56
+ return true;
57
+ }
58
+ // --- CardanoBackend ------------------------------------------------------------------------
59
+ getTransaction(txHash) { return this.call('GetTransaction', { hash: txHash }); }
60
+ getAddress(address) { return this.call('GetAddress', { address }); }
61
+ async getAddressUtxos(address) { return (await this.call('GetAddressUtxos', { address })).map(scriptRefAsHash); }
62
+ getAddressTransactions(address, limit) {
63
+ return this.call('GetAddressTransactions', { address, limit });
64
+ }
65
+ getAddressTransactionHashes(address, limit) {
66
+ return this.call('GetAddressTransactionHashes', { address, limit });
67
+ }
68
+ async getTransactionsBatch(txHashes) {
69
+ const out = new Map();
70
+ for (let i = 0; i < txHashes.length; i += ENUMERATION_BATCH) {
71
+ (0, call_signal_1.throwIfCallAborted)();
72
+ const found = await this.call('GetTransactionsBatch', {
73
+ hashes: JSON.stringify(txHashes.slice(i, i + ENUMERATION_BATCH)),
74
+ });
75
+ for (const [hash, tx] of Object.entries(found ?? {}))
76
+ out.set(hash, tx);
77
+ }
78
+ return out;
79
+ }
80
+ async getCredentialUtxos(credHash) {
81
+ return (await this.call('GetCredentialUtxos', { credential: credHash })).map(scriptRefAsHash);
82
+ }
83
+ /** Unspent outputs among `refs`, from the remote's node (with reference-script bytes). */
84
+ async getUnspentOutputs(refs) {
85
+ const out = [];
86
+ for (let i = 0; i < refs.length; i += ENUMERATION_BATCH) {
87
+ (0, call_signal_1.throwIfCallAborted)();
88
+ out.push(...(await this.call('GetUnspentOutputs', { refs: JSON.stringify(refs.slice(i, i + ENUMERATION_BATCH)) })).map(scriptRefAsHash));
89
+ }
90
+ return out;
91
+ }
92
+ getNetworkInformation() { return this.call('GetNetworkInformation'); }
93
+ getTransactionMetadata(txHash) { return this.call('GetTransactionMetadata', { hash: txHash }); }
94
+ getBlock(blockHash) { return this.call('GetBlock', { hash: blockHash }); }
95
+ getEpoch(epochNumber) { return this.call('GetEpoch', { epoch: epochNumber }); }
96
+ getLatestEpoch() { return this.call('GetLatestEpoch'); }
97
+ getLatestBlock() { return this.call('GetLatestBlock'); }
98
+ getCurrentSlot() { return this.call('GetCurrentSlot'); }
99
+ isUtxoUnspent(txHash, outputIndex) {
100
+ return this.call('IsUtxoUnspent', { txHash, outputIndex });
101
+ }
102
+ getPool(poolId) { return this.call('GetPool', { poolId }); }
103
+ getDrep(drepId) { return this.call('GetDrep', { drepId }); }
104
+ async getAccount(stakeAddress) {
105
+ const account = await this.call('GetAccount', { stakeAddress });
106
+ // an older remote lists the addresses as objects
107
+ const addresses = (account.addresses ?? [])
108
+ .map(a => (typeof a === 'string' ? a : a?.address))
109
+ .filter((a) => typeof a === 'string' && a.length > 0);
110
+ return { ...account, addresses };
111
+ }
112
+ // The remote's own verdict. A remote without the operation answers 404, which says nothing about the account.
113
+ async isRewardAccountRegistered(stakeAddress) {
114
+ try {
115
+ return await this.call('IsRewardAccountRegistered', { stakeAddress });
116
+ }
117
+ catch (err) {
118
+ if (err instanceof errors_1.NotFoundError)
119
+ return null;
120
+ throw err;
121
+ }
122
+ }
123
+ getAssetInfo(unit) { return this.call('GetAssetInfo', { unit }); }
124
+ getAssetHistory(unit, limit = 100) { return this.call('GetAssetHistory', { unit, limit }); }
125
+ getProtocolParameters() { return this.call('GetProtocolParameters'); }
126
+ submitTransaction(signedTxCbor) { return this.call('SubmitTransaction', { cbor: signedTxCbor }); }
127
+ // --- EvaluatingBackend -----------------------------------------------------------------------
128
+ evaluateTransaction(unsignedTxCbor) {
129
+ return this.call('EvaluateTransaction', { cbor: unsignedTxCbor });
130
+ }
131
+ // --- PaginatingBackend (crawler source) ------------------------------------------------------
132
+ getBlockByHeight(height) { return this.call('GetBlockByHeight', { height }); }
133
+ getNextBlocks(afterHash, count, afterHeight) {
134
+ return this.call('GetNextBlocks', { afterHash, count, afterHeight: afterHeight ?? null });
135
+ }
136
+ // The count is checked here, not sent: a remote of an earlier version refuses a parameter it does not know.
137
+ async getBlockTransactions(blockHash, txCount) {
138
+ const txs = await this.call('GetBlockTransactions', { blockHash });
139
+ if (txCount !== undefined && txs.length !== txCount) {
140
+ throw new errors_1.ProviderUnavailableError(`Incomplete transaction list for block ${blockHash}: ${txs.length}/${txCount} transaction(s)`, this.name);
141
+ }
142
+ return txs;
143
+ }
144
+ // --- EnumeratingBackend (epoch snapshots) -----------------------------------------------------
145
+ getPoolIds() { return this.call('GetPoolIds'); }
146
+ getPools(poolIds) { return this.batched('GetPools', poolIds); }
147
+ getDrepIds() { return this.call('GetDrepIds'); }
148
+ getDreps(drepIds) { return this.batched('GetDreps', drepIds); }
149
+ async shutdown() { }
150
+ async batched(operation, ids) {
151
+ const out = [];
152
+ for (let i = 0; i < ids.length; i += ENUMERATION_BATCH) {
153
+ (0, call_signal_1.throwIfCallAborted)();
154
+ out.push(...await this.call(operation, { ids: JSON.stringify(ids.slice(i, i + ENUMERATION_BATCH)) }));
155
+ }
156
+ return out;
157
+ }
158
+ // POSTs one operation and parses the JSON answer with exact big integers.
159
+ // The remote error message stays verbatim, so `CHAIN_POINT_MISMATCH:` reaches the crawler.
160
+ async call(operation, body = {}) {
161
+ try {
162
+ // the request stops when the client gives up the call it belongs to
163
+ const signal = (0, call_signal_1.callSignal)();
164
+ const res = signal ? await this.api.post(`/${operation}`, body, { signal }) : await this.api.post(`/${operation}`, body);
165
+ const left = Number(res.headers?.['x-access-units-left']);
166
+ if (Number.isFinite(left))
167
+ this.unitsLeft = left;
168
+ const value = res.data?.value;
169
+ return (typeof value === 'string' ? (0, deep_json_1.parseJson)(value) : value);
170
+ }
171
+ catch (err) {
172
+ throw this.mapError(operation, err);
173
+ }
174
+ }
175
+ mapError(operation, err) {
176
+ const ax = err;
177
+ if (!ax?.isAxiosError)
178
+ return err instanceof Error ? err : new Error(String(err));
179
+ const status = ax.response?.status;
180
+ const message = ax.response?.data?.error?.message ?? ax.message;
181
+ // older instances carry the code only as a `[CODE]` prefix of the message
182
+ const code = ax.response?.data?.error?.code ?? message;
183
+ // the remote prefixes `[CODE] Operation: `; the crawler recognises the reorg marker at the start
184
+ const marker = message.indexOf('CHAIN_POINT_MISMATCH:');
185
+ if (marker >= 0)
186
+ return new errors_1.ProviderUnavailableError(message.slice(marker), this.name);
187
+ // NotFoundError appends " not found" itself; the remote message already ends with it
188
+ if (status === 404)
189
+ return new errors_1.NotFoundError(message.replace(/ not found$/, ''), this.name);
190
+ if (status === 429) {
191
+ const retryAfter = Number(ax.response?.headers?.['retry-after']);
192
+ return new errors_1.RateLimitError(message, this.name, Number.isFinite(retryAfter) ? retryAfter : undefined);
193
+ }
194
+ if (status === 409 && code.includes(error_codes_1.ERROR_CODES.TX_ALREADY_SUBMITTED)) {
195
+ return new errors_1.TransactionAlreadySubmittedError(/[0-9a-f]{64}/.exec(message)?.[0] ?? '', message);
196
+ }
197
+ if (status === 400) {
198
+ if (code.includes(error_codes_1.ERROR_CODES.SCRIPT_VALIDATION_FAILURE))
199
+ return new errors_1.ScriptValidationError(message);
200
+ // the remote names a node refusal with its JSON-RPC code; it is kept so the refusal is classified alike
201
+ const rpc = /node rejected the transaction \((3\d{3})\)/.exec(message);
202
+ return new errors_1.TransactionValidationError(message, rpc ? Object.assign(new Error(message), { code: Number(rpc[1]) }) : undefined);
203
+ }
204
+ if (status === 401 || status === 402 || status === 403) {
205
+ logger.error(`${operation}: the remote ODATANO refused the key (${status}): ${message}`);
206
+ }
207
+ return new errors_1.ProviderUnavailableError(message, this.name);
208
+ }
209
+ }
210
+ exports.OdatanoBackend = OdatanoBackend;
211
+ //# sourceMappingURL=odatano-backend.js.map
@@ -1,6 +1,85 @@
1
1
  import { Transaction, BlockData, Address, UTxO, NetworkInformation, EpochData, MetadataLabelTx, PoolData, AccountData, DrepData, AssetInfo, LedgerProtocolParameters, ScriptEvaluationResult } from '../../utils/types';
2
- import { EvaluatingBackend, ChainSyncBackend, ChainSyncCallbacks, ChainSyncHandle, ChainPoint } from './cardano-backend';
2
+ import { EvaluatingBackend, ChainSyncBackend, ChainSyncCallbacks, ChainSyncHandle, ChainPoint, LedgerStateBackend, EpochStateBackend, EpochLedgerState, RewardAccountStateBackend, AskRewardAccounts } from './cardano-backend';
3
3
  import { Network } from '../cardano-client';
4
+ /** Ogmios response shapes not fully typed in @cardano-ogmios/client. */
5
+ interface OgmiosStakePool {
6
+ vrfVerificationKeyHash?: string;
7
+ stake?: {
8
+ ada?: {
9
+ lovelace?: number | bigint;
10
+ };
11
+ };
12
+ pledge?: {
13
+ ada?: {
14
+ lovelace?: number | bigint;
15
+ };
16
+ } | number | bigint;
17
+ margin?: number | string;
18
+ cost?: {
19
+ ada?: {
20
+ lovelace?: number | bigint;
21
+ };
22
+ } | number | bigint;
23
+ rewardAccount?: string;
24
+ metadata?: {
25
+ url?: string;
26
+ hash?: string;
27
+ };
28
+ }
29
+ /** Hash of an Ogmios `Script`: blake2b-224 over the language tag byte followed by the script CBOR. */
30
+ export declare function ogmiosScriptHash(script: unknown): string | null;
31
+ /** Full CBOR of a Plutus reference script as Ogmios delivers it; null for native or absent scripts. */
32
+ export declare function ogmiosPlutusScriptCbor(script: unknown): string | null;
33
+ /** Bech32 pool id of a block issuer: blake2b-224 of its cold verification key. */
34
+ export declare function issuerKeyToPoolId(verificationKeyHex: string): string;
35
+ /** Ogmios `queryLedgerState/delegateRepresentatives` entry. Only the `registered` variant has an id. */
36
+ interface OgmiosDrepSummary {
37
+ type: 'registered' | 'noConfidence' | 'abstain';
38
+ id?: string;
39
+ from?: 'verificationKey' | 'script';
40
+ mandate?: {
41
+ epoch?: number;
42
+ };
43
+ stake?: {
44
+ ada?: {
45
+ lovelace?: number | bigint;
46
+ };
47
+ };
48
+ deposit?: {
49
+ ada?: {
50
+ lovelace?: number | bigint;
51
+ };
52
+ };
53
+ delegators?: unknown[];
54
+ }
55
+ /** Ogmios `stakePoolsPerformances`. Only nOpt is used, because its stake figures are live, not active. */
56
+ interface OgmiosStakePoolsPerformances {
57
+ desiredNumberOfStakePools?: number;
58
+ }
59
+ /** Raw Ogmios answers for one epoch snapshot, all read at the same acquired block. */
60
+ export interface OgmiosEpochStateRaw {
61
+ epoch: number;
62
+ stakePools: Record<string, OgmiosStakePool>;
63
+ performances: OgmiosStakePoolsPerformances | null;
64
+ dreps: OgmiosDrepSummary[];
65
+ pots: {
66
+ treasury?: {
67
+ ada?: {
68
+ lovelace?: number | bigint;
69
+ };
70
+ };
71
+ reserves?: {
72
+ ada?: {
73
+ lovelace?: number | bigint;
74
+ };
75
+ };
76
+ } | null;
77
+ }
78
+ export declare function mapOgmiosEpochState(raw: OgmiosEpochStateRaw): EpochLedgerState;
79
+ export declare function decodeDrepId(drepId: string): {
80
+ hashHex: string;
81
+ isScript: boolean;
82
+ };
4
83
  /** Resolve Ogmios ledger tip which may be 'origin' (genesis block) or a point */
5
84
  export declare function resolveOgmiosTip(tip: 'origin' | {
6
85
  slot: number;
@@ -11,237 +90,90 @@ export declare function resolveOgmiosTip(tip: 'origin' | {
11
90
  };
12
91
  /** Resolve Ogmios block height which may be 'origin' (genesis block) or a number */
13
92
  export declare function resolveOgmiosHeight(height: 'origin' | number): number;
14
- export declare class OgmiosBackend implements EvaluatingBackend, ChainSyncBackend {
93
+ export declare class OgmiosBackend implements EvaluatingBackend, ChainSyncBackend, LedgerStateBackend, EpochStateBackend, RewardAccountStateBackend {
15
94
  readonly name = "ogmios";
16
- /**
17
- * Capability declaration — the orchestrator skips Ogmios for these without
18
- * counting circuit failures. Historic queries are out of protocol scope;
19
- * getAddress/getNetworkInformation previously FABRICATED placeholder data
20
- * (type:'base'/isScript:false/stakeAddress:null resp. maxSupply as
21
- * total/circulating) which preferLive routing then preferred over correct
22
- * Blockfrost/Koios data.
23
- */
95
+ /** Ogmios cannot answer historic queries. The orchestrator skips it for these. */
24
96
  readonly unsupportedMethods: ReadonlySet<string>;
25
97
  private stateQueryClient;
26
98
  private txSubmissionClient;
27
99
  private context;
100
+ /** Second connection for address queries (see scanQueryClient). */
101
+ private scanClient;
102
+ private scanContext;
103
+ private scanConnecting;
28
104
  private isShutdown;
29
105
  private reconnectPromise;
30
106
  private network;
31
107
  private timeoutMs;
32
108
  private ogmiosUrl;
33
- /**
34
- * Constructor
35
- */
36
109
  constructor(network: Network, timeoutMs: number, ogmiosUrl: string);
37
- /**
38
- * Force fresh (non-keep-alive) HTTP connections for the Ogmios `/health` probe.
39
- *
40
- * createInteractionContext() opens the WebSocket, but FIRST probes
41
- * `GET http://<ogmios>/health` via the library's `cross-fetch` → node-fetch v2
42
- * → Node-core `http`. Since Node 19, `http.globalAgent` defaults to
43
- * keepAlive:true, so node-fetch reuses pooled sockets. Against Ogmios' Warp
44
- * server on Node 22/24 a reused socket the server has already half-closed
45
- * yields "Invalid response body … Premature close" the instant the body is
46
- * read — deterministically (Node 20's older http client tolerated it; `curl`
47
- * does too, so the /health response itself is well-formed and the node is
48
- * healthy). The lib pins cross-fetch even in 7.0 and exposes no way to inject
49
- * an agent into that internal fetch, so we neutralise keep-alive process-wide
50
- * for `http://`. Blast radius is tiny: the only `http://` consumer is the local
51
- * Ogmios probe — Blockfrost/Koios run over `https` with their own axios agents
52
- * and are unaffected. Runs once, lazily, only when Ogmios is actually used.
53
- */
54
110
  private static keepAliveDisabled;
55
111
  private static disableHttpKeepAlive;
56
112
  /** Validate Ogmios URL scheme and reject dangerous protocols */
57
113
  private static validateOgmiosUrl;
58
- /**
59
- * Bound an init step in time. A hung WebSocket connect/handshake (e.g. the
60
- * node is alive but too busy catching up to answer) would otherwise block
61
- * forever — there is no built-in connect timeout — hanging the whole
62
- * app-context bootstrap (seen as a 6h CI job timeout). On timeout we reject
63
- * with a message containing "timeout" so the orchestrator's transient-error
64
- * retry picks it up instead of dying.
65
- */
66
114
  private withInitTimeout;
67
- /**
68
- * Force-release an Ogmios interaction socket after a failed/expired open or
69
- * close step. The runtime uses `ws` (and therefore supports `terminate`), but
70
- * the close fallback keeps the helper compatible with the public structural
71
- * InteractionContext type and lightweight test doubles.
72
- */
115
+ /** Force-release a socket after a failed open or close. Test doubles without `terminate` get `close`. */
73
116
  private forceCloseContext;
74
- /**
75
- * Initialize the Ogmios backend connection
76
- */
117
+ /** Open the interaction context and the query/submission clients. */
77
118
  init(): Promise<boolean>;
78
- /**
79
- * Reconnect when the WebSocket has died since the last successful init.
80
- * No-op when never initialized (test-injected clients) — startup-init
81
- * recovery is the orchestrator's job (lazy init retry in CardanoClient).
82
- * Concurrent callers share one reconnect attempt.
83
- */
119
+ private scanQueryClient;
120
+ /** Reconnect a dead WebSocket. Concurrent callers share one attempt. No-op before the first init. */
84
121
  private ensureConnected;
85
- /**
86
- * Get specific Block Data (not supported)
87
- * @param _hash block hash (hex)
88
- * @returns {Promise<BlockData>} block data
89
- */
90
122
  getBlock(_hash: string): Promise<BlockData>;
91
- /**
92
- * Get specific Epoch Data (not supported)
93
- * @param _epochNumber epoch number
94
- * @returns {Promise<EpochData>} epoch data
95
- */
123
+ /** Only the current epoch. */
96
124
  getEpoch(epochNumber: number): Promise<EpochData>;
97
- /**
98
- * Get specific Transaction Data (not supported)
99
- * @param _hash transaction hash (hex)
100
- * @returns {Promise<Transaction>} transaction data
101
- */
102
125
  getTransaction(_hash: string): Promise<Transaction>;
103
- /**
104
- * Get specific Transaction Metadata (not supported)
105
- * @param _tx_hash transaction hash (hex)
106
- * @returns {Promise<MetadataLabelTx[]>} transaction metadata list
107
- */
108
126
  getTransactionMetadata(_tx_hash: string): Promise<MetadataLabelTx[]>;
109
- /**
110
- * Get specific Drep Data (not supported for Ogmios)
111
- * @param _drepId drep id
112
- * @returns {Promise<DrepData>} drep data
113
- */
114
- getDrep(_drepId: string): Promise<DrepData>;
115
- /**
116
- * Get Asset Info (not supported for Ogmios — no aggregate-supply query in the protocol)
117
- * @param _unit asset unit (policyId + assetNameHex)
118
- * @returns {Promise<AssetInfo>} asset info
119
- */
127
+ getDrep(drepId: string): Promise<DrepData>;
128
+ /** Not supported. The protocol has no aggregate-supply query. */
120
129
  getAssetInfo(_unit: string): Promise<AssetInfo>;
121
- /**
122
- * Get specific Network Information (not supported — Ogmios state queries
123
- * expose no supply/stake aggregates; the previous implementation fabricated
124
- * maxSupply as total/circulating, which preferLive routing then preferred
125
- * over correct Blockfrost/Koios data)
126
- */
130
+ /** Total supply is max supply minus reserves. Circulating, locked and stake totals stay '0'. */
127
131
  getNetworkInformation(): Promise<NetworkInformation>;
128
- /**
129
- * Get current specific Address Data (not supported — address type, script
130
- * flag and stake address are not derivable from Ogmios state queries; the
131
- * previous implementation fabricated type:'base'/isScript:false/
132
- * stakeAddress:null. UTxOs remain available via getAddressUtxos.)
133
- */
134
- getAddress(_address: string): Promise<Address>;
135
- /** get current specific Address UTxOs
136
- * @param address bech32 address
137
- * @returns {Promise<UTxO[]>} address UTxOs
138
- */
132
+ /** Address at the tip, decoded locally, with UTxOs and balance from the ledger. No tx history. */
133
+ getAddress(address: string): Promise<Address>;
139
134
  getAddressUtxos(address: string): Promise<UTxO[]>;
140
- /**
141
- * Get Address Transactions (not supported by Ogmios - use historical backend)
142
- * Ogmios is a live state query backend and does not provide historical transaction data
143
- * @param _address bech32 address
144
- * @returns {Promise<Transaction[]>} always throws - use historical backend instead
145
- */
135
+ /** Ogmios `Utxo` entry → normalized UTxO line (shared by the address query and the set import). */
136
+ private mapOgmiosUtxo;
137
+ private withLedgerStateAt;
138
+ private openLedgerStateAt;
139
+ rewardAccountsAt<T>(point: ChainPoint, read: (ask: AskRewardAccounts) => Promise<T>): Promise<T>;
140
+ /** Whole UTxO set as of `point` (crawler snapshot import). */
141
+ queryUtxoSetAt(point: ChainPoint): Promise<UTxO[]>;
142
+ /** Pools, DReps and pots at `point` from one ledger state. Without nOpt saturation stays 0. */
143
+ epochStateAt(point: ChainPoint): Promise<EpochLedgerState>;
144
+ /** Not supported. Ogmios only queries live state. */
146
145
  getAddressTransactions(_address: string): Promise<Transaction[]>;
147
- /**
148
- * Get current specific Pool Data
149
- * @param poolId pool id
150
- * @returns {Promise<PoolData>} pool data
151
- */
152
146
  getPool(poolId: string): Promise<PoolData>;
153
- /**
154
- * Get Account Data for specified stake address
155
- * @param stakeAddress stake address
156
- * @returns {Promise<AccountData>} account data
157
- */
158
147
  getAccount(stakeAddress: string): Promise<AccountData>;
159
- /**
160
- * Submit Transaction to the network
161
- * @param signedTxCbor signed transaction in CBOR hex format
162
- * @returns {Promise<string>} transaction hash
163
- */
164
148
  submitTransaction(signedTxCbor: string): Promise<string>;
165
- /**
166
- * Evaluate transaction script execution units
167
- * @param unsignedTxCbor unsigned transaction in CBOR hex format
168
- * @returns {Promise<ScriptEvaluationResult[]>} evaluation results
169
- */
149
+ /** Hash of a signed transaction, or null when the CBOR does not parse. */
150
+ private txHashOrNull;
151
+ /** Whether the node holds the transaction: in its mempool, or on chain with its first output unspent. Null when the lookup failed. */
152
+ private isKnownTransaction;
153
+ /** Mempool lookup on its own short connection, since an acquired mempool snapshot blocks the session. */
154
+ private mempoolHas;
170
155
  evaluateTransaction(unsignedTxCbor: string): Promise<ScriptEvaluationResult[]>;
171
- /**
172
- * Get current Protocol Parameters
173
- * @returns {Promise<LedgerProtocolParameters>} protocol parameters
174
- */
175
156
  getProtocolParameters(): Promise<LedgerProtocolParameters>;
176
- /**
177
- * Get Latest Epoch Data
178
- * @returns {Promise<EpochData>} latest epoch data
179
- */
180
157
  getLatestEpoch(): Promise<EpochData>;
181
- /**
182
- * Get current Latest Block Data
183
- * @returns {Promise<BlockData>} latest block data
184
- */
185
158
  getLatestBlock(): Promise<BlockData>;
186
- /**
187
- * Get the latest chain tip slot.
188
- * @returns {Promise<number>} current chain slot
189
- */
190
159
  getCurrentSlot(): Promise<number>;
191
- /**
192
- * Check whether a UTxO is still unspent via Ogmios `queryLedgerState/utxo`
193
- * with an outputReferences filter. Empty result means spent or nonexistent.
194
- * @param txHash 64-char lowercase hex
195
- * @param outputIndex non-negative integer
196
- * @returns {Promise<boolean>} true iff the UTxO exists and is unspent
197
- */
160
+ /** Unspent check via `queryLedgerState/utxo`. An empty answer means spent or unknown. */
198
161
  isUtxoUnspent(txHash: string, outputIndex: number): Promise<boolean>;
199
- /**
200
- * Shutdown the Ogmios Backend
201
- * Closes all connections and marks as shutdown
202
- */
162
+ /** Outputs among `refs` that are unspent in the live ledger; spent or unknown references are absent. */
163
+ getUnspentOutputs(refs: Array<{
164
+ txHash: string;
165
+ outputIndex: number;
166
+ }>): Promise<UTxO[]>;
167
+ /** Close the WebSocket and mark the backend as shut down. */
203
168
  shutdown(): Promise<void>;
204
- /**
205
- * Check if backend is connected
206
- */
207
169
  isConnected(): boolean;
208
- /**
209
- * Ensure the client is not shutdown before operations
210
- */
211
170
  private ensureNotShutdown;
212
- /**
213
- * Convert Ogmios value format to odatano amount array
214
- * Ogmios: { ada: { lovelace: 1000000 }, policyId: { assetName: quantity } }
215
- * Standard: [{ unit: 'lovelace', quantity: '1000000' }, { unit: 'policyId.assetName', quantity: 'N' }]
216
- */
171
+ /** Ogmios value `{ ada: { lovelace }, policyId: { assetName: qty } }` to a list of units and quantities. */
217
172
  private convertOgmiosValue;
218
- /**
219
- * Open a dedicated chain-synchronization stream. Uses its own InteractionContext
220
- * (a separate WebSocket) from the query/submission clients, because it is a
221
- * long-lived stream. `sequential: true` + `inFlight: 1` deliver blocks one at a
222
- * time in order, which the crawler needs for reorg detection and serial persist.
223
- *
224
- * KNOWN LIMITATIONS (documented, to harden against a live node — see CRAWLER_DESIGN.md):
225
- * - Input address/amount are left empty: Ogmios chain-sync inputs are bare
226
- * references ({txId,index}); the indexer resolves them from already-indexed
227
- * outputs (indexBlockFull, C3).
228
- * - Per-tx `size` and `deposit` are not surfaced by chain-sync (set 0).
229
- * - Output `referenceScriptHash` is not derived from the inline script yet.
230
- */
231
173
  openChainSync(from: ChainPoint[] | 'origin', callbacks: ChainSyncCallbacks): Promise<ChainSyncHandle>;
232
- /**
233
- * Map an Ogmios Praos block into our BlockData + its transactions. Block-level
234
- * fees are the sum of per-tx fees; epoch/epochSlot are derived from the slot via
235
- * the network's Shelley anchor (same config the tx-builder uses).
236
- */
237
174
  private mapOgmiosBlock;
238
- /**
239
- * Map a single Ogmios chain-sync transaction into our Transaction. Outputs, fee
240
- * and metadata are mapped fully; inputs are kept as bare references (address/amount
241
- * resolved downstream by the indexer). `spends` selects the ledger-applied
242
- * partition: a phase-2-invalid transaction consumes collaterals and creates only
243
- * its collateral-return output, never its declared regular inputs/outputs.
244
- */
245
175
  private mapOgmiosTx;
176
+ private mapOgmiosCertificates;
246
177
  }
178
+ export {};
247
179
  //# sourceMappingURL=ogmios-backend.d.ts.map