@odatano/core 2.0.0-rc.44 → 2.0.0-rc.45
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/@cds-models/CardanoAgentService/index.d.ts +0 -46
- package/@cds-models/CardanoBackendService/index.d.ts +0 -10
- package/@cds-models/CardanoIndexerService/index.d.ts +5 -20
- package/@cds-models/CardanoODataService/index.d.ts +18 -47
- package/@cds-models/CardanoSignService/index.d.ts +3 -18
- package/@cds-models/CardanoTransactionService/index.d.ts +9 -31
- package/@cds-models/CardanoWorkerService/index.d.ts +3 -19
- package/@cds-models/index.d.ts +17 -0
- package/@cds-models/index.js +2 -0
- package/@cds-models/odatano/cardano/index.d.ts +0 -34
- package/README.md +6 -6
- package/db/schema.cds +25 -44
- package/db/types.cds +22 -5
- package/package.json +3 -1
- package/scripts/migrate-slot-leader.mjs +3 -11
- package/scripts/migrate-txseq.mjs +3 -12
- package/src/index.d.ts +0 -4
- package/src/index.js +3 -5
- package/src/plugin.js +4 -8
- package/srv/blockchain/asset-decimals.d.ts +0 -9
- package/srv/blockchain/asset-decimals.js +21 -16
- package/srv/blockchain/backends/blockfrost-backend.d.ts +2 -10
- package/srv/blockchain/backends/blockfrost-backend.js +15 -21
- package/srv/blockchain/backends/cardano-backend.d.ts +12 -71
- package/srv/blockchain/backends/koios-backend.d.ts +14 -147
- package/srv/blockchain/backends/koios-backend.js +40 -164
- package/srv/blockchain/backends/odatano-backend.d.ts +1 -11
- package/srv/blockchain/backends/odatano-backend.js +11 -12
- package/srv/blockchain/backends/ogmios-backend.d.ts +13 -160
- package/srv/blockchain/backends/ogmios-backend.js +48 -175
- package/srv/blockchain/backends/ogmios-frame-guard.d.ts +2 -18
- package/srv/blockchain/backends/ogmios-frame-guard.js +8 -20
- package/srv/blockchain/cardano-client.d.ts +12 -80
- package/srv/blockchain/cardano-client.js +36 -88
- package/srv/blockchain/cardano-indexer.d.ts +12 -192
- package/srv/blockchain/cardano-indexer.js +126 -222
- package/srv/blockchain/cardano-tx-builder.d.ts +1 -28
- package/srv/blockchain/cardano-tx-builder.js +17 -34
- package/srv/blockchain/circuit-breaker.d.ts +1 -13
- package/srv/blockchain/circuit-breaker.js +5 -15
- package/srv/blockchain/crawler/asset-decimals-backfill.d.ts +0 -5
- package/srv/blockchain/crawler/asset-decimals-backfill.js +2 -5
- package/srv/blockchain/crawler/certificate-backfill.d.ts +0 -17
- package/srv/blockchain/crawler/certificate-backfill.js +8 -22
- package/srv/blockchain/crawler/crawler.d.ts +16 -93
- package/srv/blockchain/crawler/crawler.js +85 -160
- package/srv/blockchain/crawler/credential-backfill.d.ts +0 -10
- package/srv/blockchain/crawler/credential-backfill.js +2 -4
- package/srv/blockchain/crawler/hooks.d.ts +1 -5
- package/srv/blockchain/crawler/index.d.ts +0 -12
- package/srv/blockchain/crawler/index.js +6 -20
- package/srv/blockchain/crawler/sync-state.d.ts +6 -44
- package/srv/blockchain/crawler/sync-state.js +18 -53
- package/srv/blockchain/crawler/transaction-backfill.d.ts +0 -11
- package/srv/blockchain/crawler/transaction-backfill.js +11 -30
- package/srv/blockchain/crawler/utxo-set-import.d.ts +1 -30
- package/srv/blockchain/crawler/utxo-set-import.js +27 -53
- package/srv/blockchain/ledger-state.d.ts +10 -54
- package/srv/blockchain/ledger-state.js +11 -27
- package/srv/blockchain/pending-spends.d.ts +0 -12
- package/srv/blockchain/pending-spends.js +4 -12
- package/srv/blockchain/request-coalescer.d.ts +2 -16
- package/srv/blockchain/request-coalescer.js +2 -16
- package/srv/blockchain/signing/cose-verifier.d.ts +0 -9
- package/srv/blockchain/signing/cose-verifier.js +4 -10
- package/srv/blockchain/signing/external-signer.d.ts +1 -4
- package/srv/blockchain/signing/external-signer.js +2 -8
- package/srv/blockchain/signing/hsm-signer.d.ts +6 -18
- package/srv/blockchain/signing/hsm-signer.js +16 -28
- package/srv/blockchain/signing/signature-verifier.d.ts +1 -8
- package/srv/blockchain/signing/signature-verifier.js +9 -19
- package/srv/blockchain/signing/submission-finalizer.d.ts +10 -16
- package/srv/blockchain/signing/submission-finalizer.js +48 -19
- package/srv/blockchain/stored-chain.d.ts +1 -14
- package/srv/blockchain/stored-chain.js +3 -8
- package/srv/blockchain/transaction-building/buildooor-fee-patch.d.ts +0 -4
- package/srv/blockchain/transaction-building/buildooor-fee-patch.js +4 -9
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts +7 -150
- package/srv/blockchain/transaction-building/buildooor-tx.js +91 -196
- package/srv/blockchain/transaction-building/caller-datums.d.ts +0 -14
- package/srv/blockchain/transaction-building/caller-datums.js +3 -9
- package/srv/blockchain/transaction-building/cardano-tx.d.ts +1 -4
- package/srv/blockchain/wallet-worker/build-request.d.ts +0 -5
- package/srv/blockchain/wallet-worker/build-request.js +6 -9
- package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +5 -23
- package/srv/blockchain/wallet-worker/confirmation-tracker.js +16 -20
- package/srv/blockchain/wallet-worker/index.d.ts +1 -1
- package/srv/blockchain/wallet-worker/index.js +3 -5
- package/srv/blockchain/wallet-worker/job-store.d.ts +15 -65
- package/srv/blockchain/wallet-worker/job-store.js +0 -0
- package/srv/blockchain/wallet-worker/lease-heartbeat.d.ts +2 -10
- package/srv/blockchain/wallet-worker/lease-heartbeat.js +6 -12
- package/srv/blockchain/wallet-worker/signers.d.ts +3 -11
- package/srv/blockchain/wallet-worker/signers.js +3 -6
- package/srv/blockchain/wallet-worker/wallet-worker.d.ts +3 -21
- package/srv/blockchain/wallet-worker/wallet-worker.js +47 -54
- package/srv/cardano-agent-service.cds +123 -146
- package/srv/cardano-agent-service.js +2 -5
- package/srv/cardano-backend-service.cds +10 -17
- package/srv/cardano-backend-service.js +7 -12
- package/srv/cardano-indexer-service.cds +16 -37
- package/srv/cardano-indexer-service.d.ts +5 -1
- package/srv/cardano-indexer-service.js +44 -35
- package/srv/cardano-service.cds +56 -40
- package/srv/cardano-service.js +42 -69
- package/srv/cardano-sign-service.cds +14 -23
- package/srv/cardano-sign-service.js +18 -24
- package/srv/cardano-tx-service.cds +27 -29
- package/srv/cardano-tx-service.js +60 -122
- package/srv/cardano-worker-service.cds +109 -125
- package/srv/cardano-worker-service.js +21 -31
- package/srv/cbor/cip68.d.ts +0 -4
- package/srv/cbor/cip68.js +2 -4
- package/srv/cbor/parse.d.ts +3 -18
- package/srv/cbor/parse.js +2 -7
- package/srv/cbor/plutus-data-json.d.ts +0 -4
- package/srv/server.d.ts +5 -36
- package/srv/server.js +30 -51
- package/srv/utils/agent-grants-config.d.ts +0 -18
- package/srv/utils/agent-grants-config.js +6 -13
- package/srv/utils/agent-grants.d.ts +14 -68
- package/srv/utils/agent-grants.js +42 -60
- package/srv/utils/agent-token-auth.d.ts +0 -5
- package/srv/utils/agent-token-auth.js +2 -5
- package/srv/utils/backend-request-handler.d.ts +1 -1
- package/srv/utils/collections.d.ts +1 -4
- package/srv/utils/collections.js +1 -4
- package/srv/utils/const.d.ts +0 -18
- package/srv/utils/const.js +7 -18
- package/srv/utils/crypto.js +3 -5
- package/srv/utils/db-indexes.d.ts +2 -0
- package/srv/utils/db-indexes.js +22 -9
- package/srv/utils/db-sanitize.d.ts +1 -8
- package/srv/utils/db-sanitize.js +3 -8
- package/srv/utils/epoch-slots.d.ts +1 -8
- package/srv/utils/epoch-slots.js +3 -8
- package/srv/utils/error-codes.d.ts +0 -4
- package/srv/utils/error-codes.js +2 -4
- package/srv/utils/errors.d.ts +2 -22
- package/srv/utils/errors.js +13 -27
- package/srv/utils/liveness.d.ts +0 -4
- package/srv/utils/liveness.js +2 -4
- package/srv/utils/mappers.d.ts +0 -37
- package/srv/utils/mappers.js +19 -39
- package/srv/utils/network-context.js +2 -4
- package/srv/utils/paging.d.ts +31 -0
- package/srv/utils/paging.js +43 -0
- package/srv/utils/pg-inline-json.js +3 -7
- package/srv/utils/pg-order-nulls.js +2 -5
- package/srv/utils/plutus-placeholders.d.ts +0 -13
- package/srv/utils/plutus-placeholders.js +6 -13
- package/srv/utils/rate-limiter.d.ts +0 -8
- package/srv/utils/rate-limiter.js +2 -4
- package/srv/utils/reference-script.d.ts +0 -18
- package/srv/utils/reference-script.js +8 -19
- package/srv/utils/service-events.d.ts +0 -4
- package/srv/utils/service-events.js +2 -4
- package/srv/utils/signing-helper.d.ts +1 -8
- package/srv/utils/signing-helper.js +3 -8
- package/srv/utils/tx-build-helper.d.ts +2 -32
- package/srv/utils/tx-build-helper.js +26 -40
- package/srv/utils/tx-request-parsers.d.ts +1 -25
- package/srv/utils/tx-request-parsers.js +10 -25
- package/srv/utils/tx-utils.d.ts +0 -8
- package/srv/utils/tx-utils.js +10 -13
- package/srv/utils/types.d.ts +2 -37
- package/srv/utils/validators.d.ts +0 -4
- package/srv/utils/validators.js +2 -4
|
@@ -28,10 +28,7 @@ export declare function ogmiosScriptHash(script: unknown): string | null;
|
|
|
28
28
|
export declare function ogmiosPlutusScriptCbor(script: unknown): string | null;
|
|
29
29
|
/** Bech32 pool id of a block issuer: blake2b-224 of its cold verification key. */
|
|
30
30
|
export declare function issuerKeyToPoolId(verificationKeyHex: string): string;
|
|
31
|
-
/**
|
|
32
|
-
* Ogmios v6 `queryLedgerState/delegateRepresentatives` summary (local wire type; the schema
|
|
33
|
-
* package is only a transitive dependency). Only the `registered` variant carries an id.
|
|
34
|
-
*/
|
|
31
|
+
/** Ogmios `queryLedgerState/delegateRepresentatives` entry. Only the `registered` variant has an id. */
|
|
35
32
|
interface OgmiosDrepSummary {
|
|
36
33
|
type: 'registered' | 'noConfidence' | 'abstain';
|
|
37
34
|
id?: string;
|
|
@@ -51,7 +48,7 @@ interface OgmiosDrepSummary {
|
|
|
51
48
|
};
|
|
52
49
|
delegators?: unknown[];
|
|
53
50
|
}
|
|
54
|
-
/** Ogmios `stakePoolsPerformances
|
|
51
|
+
/** Ogmios `stakePoolsPerformances`. Only nOpt is used, because its stake figures are live, not active. */
|
|
55
52
|
interface OgmiosStakePoolsPerformances {
|
|
56
53
|
desiredNumberOfStakePools?: number;
|
|
57
54
|
}
|
|
@@ -74,17 +71,7 @@ export interface OgmiosEpochStateRaw {
|
|
|
74
71
|
};
|
|
75
72
|
} | null;
|
|
76
73
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Ogmios ledger answers -> EpochLedgerState. Saturation follows the ledger: live stake over
|
|
79
|
-
* (max supply - reserves) / nOpt. Figures the ledger view does not carry stay 0 / null: active
|
|
80
|
-
* stake (the indexer derives it from the previous snapshot), block counts, delegator counts,
|
|
81
|
-
* DRep last activity.
|
|
82
|
-
*/
|
|
83
74
|
export declare function mapOgmiosEpochState(raw: OgmiosEpochStateRaw): EpochLedgerState;
|
|
84
|
-
/**
|
|
85
|
-
* Decode a CIP-129 DRep ID (`drep1…`, 29 bytes) into credential hash and type. Header byte:
|
|
86
|
-
* high nibble 0x2 = DRep, low nibble 0x2 = key hash / 0x3 = script hash.
|
|
87
|
-
*/
|
|
88
75
|
export declare function decodeDrepId(drepId: string): {
|
|
89
76
|
hashHex: string;
|
|
90
77
|
isScript: boolean;
|
|
@@ -102,10 +89,7 @@ export declare function resolveOgmiosHeight(height: 'origin' | number): number;
|
|
|
102
89
|
/** CardanoBackend implementation over an Ogmios WebSocket (local node). */
|
|
103
90
|
export declare class OgmiosBackend implements EvaluatingBackend, ChainSyncBackend, LedgerStateBackend, EpochStateBackend {
|
|
104
91
|
readonly name = "ogmios";
|
|
105
|
-
/**
|
|
106
|
-
* Capability declaration — the orchestrator skips Ogmios for these without counting
|
|
107
|
-
* circuit failures. Historic queries are out of protocol scope.
|
|
108
|
-
*/
|
|
92
|
+
/** Ogmios cannot answer historic queries. The orchestrator skips it for these. */
|
|
109
93
|
readonly unsupportedMethods: ReadonlySet<string>;
|
|
110
94
|
private stateQueryClient;
|
|
111
95
|
private txSubmissionClient;
|
|
@@ -120,157 +104,49 @@ export declare class OgmiosBackend implements EvaluatingBackend, ChainSyncBacken
|
|
|
120
104
|
private timeoutMs;
|
|
121
105
|
private ogmiosUrl;
|
|
122
106
|
constructor(network: Network, timeoutMs: number, ogmiosUrl: string);
|
|
123
|
-
/**
|
|
124
|
-
* Force non-keep-alive HTTP for the Ogmios `/health` probe: node-fetch v2 uses `http.globalAgent`,
|
|
125
|
-
* whose pooled sockets (kept alive since Node 19) fail with "Premature close" once Ogmios' Warp server
|
|
126
|
-
* half-closes them. No agent hook exists, so keep-alive is disabled process-wide for `http://` only.
|
|
127
|
-
*/
|
|
128
107
|
private static keepAliveDisabled;
|
|
129
108
|
private static disableHttpKeepAlive;
|
|
130
109
|
/** Validate Ogmios URL scheme and reject dangerous protocols */
|
|
131
110
|
private static validateOgmiosUrl;
|
|
132
|
-
/**
|
|
133
|
-
* Bound an init step in time: the WebSocket connect/handshake has no built-in timeout and
|
|
134
|
-
* can hang when the node is busy. The rejection message contains "timeout" so the
|
|
135
|
-
* orchestrator's transient-error retry picks it up.
|
|
136
|
-
*/
|
|
137
111
|
private withInitTimeout;
|
|
138
|
-
/**
|
|
139
|
-
* Force-release an interaction socket after a failed/expired open or close. The runtime
|
|
140
|
-
* socket is `ws` (has `terminate`); the `close` fallback keeps test doubles working.
|
|
141
|
-
*/
|
|
112
|
+
/** Force-release a socket after a failed open or close. Test doubles without `terminate` get `close`. */
|
|
142
113
|
private forceCloseContext;
|
|
143
114
|
/** Open the interaction context and the query/submission clients. */
|
|
144
115
|
init(): Promise<boolean>;
|
|
145
|
-
/**
|
|
146
|
-
* Query client for address queries. The node answers them by scanning its whole UTxO set (seconds
|
|
147
|
-
* each), and Ogmios serves the queries of one connection in order; on their own connection they no
|
|
148
|
-
* longer hold up tip, epoch and protocol parameters. Opened on first use, reopened after a close.
|
|
149
|
-
*/
|
|
150
116
|
private scanQueryClient;
|
|
151
|
-
/**
|
|
152
|
-
* Reconnect when the WebSocket died since the last init. No-op when never initialized
|
|
153
|
-
* (test-injected clients); concurrent callers share one reconnect attempt.
|
|
154
|
-
*/
|
|
117
|
+
/** Reconnect a dead WebSocket. Concurrent callers share one attempt. No-op before the first init. */
|
|
155
118
|
private ensureConnected;
|
|
156
|
-
/**
|
|
157
|
-
* Get specific Block Data (not supported)
|
|
158
|
-
* @param _hash block hash (hex)
|
|
159
|
-
* @returns {Promise<BlockData>} block data
|
|
160
|
-
*/
|
|
161
119
|
getBlock(_hash: string): Promise<BlockData>;
|
|
162
|
-
/**
|
|
163
|
-
* Get specific Epoch Data (not supported)
|
|
164
|
-
* @param _epochNumber epoch number
|
|
165
|
-
* @returns {Promise<EpochData>} epoch data
|
|
166
|
-
*/
|
|
120
|
+
/** Only the current epoch. */
|
|
167
121
|
getEpoch(epochNumber: number): Promise<EpochData>;
|
|
168
|
-
/**
|
|
169
|
-
* Get specific Transaction Data (not supported)
|
|
170
|
-
* @param _hash transaction hash (hex)
|
|
171
|
-
* @returns {Promise<Transaction>} transaction data
|
|
172
|
-
*/
|
|
173
122
|
getTransaction(_hash: string): Promise<Transaction>;
|
|
174
|
-
/**
|
|
175
|
-
* Get specific Transaction Metadata (not supported)
|
|
176
|
-
* @param _tx_hash transaction hash (hex)
|
|
177
|
-
* @returns {Promise<MetadataLabelTx[]>} transaction metadata list
|
|
178
|
-
*/
|
|
179
123
|
getTransactionMetadata(_tx_hash: string): Promise<MetadataLabelTx[]>;
|
|
180
|
-
/**
|
|
181
|
-
* DRep data from the live ledger state (`queryLedgerState/delegateRepresentatives`) via the
|
|
182
|
-
* raw `Method()` primitive, since the client ships no wrapper. Ogmios lists only REGISTERED
|
|
183
|
-
* DReps: retired/unknown → NotFoundError; `expired` is derived from the mandate epoch.
|
|
184
|
-
* @param drepId CIP-129 bech32 DRep ID (`drep1…`)
|
|
185
|
-
*/
|
|
186
124
|
getDrep(drepId: string): Promise<DrepData>;
|
|
187
|
-
/**
|
|
188
|
-
* Get Asset Info (not supported for Ogmios — no aggregate-supply query in the protocol)
|
|
189
|
-
* @param _unit asset unit (policyId + assetNameHex)
|
|
190
|
-
* @returns {Promise<AssetInfo>} asset info
|
|
191
|
-
*/
|
|
125
|
+
/** Not supported. The protocol has no aggregate-supply query. */
|
|
192
126
|
getAssetInfo(_unit: string): Promise<AssetInfo>;
|
|
193
|
-
/**
|
|
194
|
-
* Supply figures from `queryLedgerState/treasuryAndReserves`: total = max − reserves.
|
|
195
|
-
* Circulating, locked and stake totals are not in the ledger state and stay '0'.
|
|
196
|
-
*/
|
|
127
|
+
/** Total supply is max supply minus reserves. Circulating, locked and stake totals stay '0'. */
|
|
197
128
|
getNetworkInformation(): Promise<NetworkInformation>;
|
|
198
|
-
/**
|
|
199
|
-
* Address at the tip: type, script flag and stake address decoded from the address itself,
|
|
200
|
-
* UTxOs from the ledger, balance summed over them. No transaction history (getAddressTransactions).
|
|
201
|
-
*/
|
|
129
|
+
/** Address at the tip, decoded locally, with UTxOs and balance from the ledger. No tx history. */
|
|
202
130
|
getAddress(address: string): Promise<Address>;
|
|
203
|
-
/** get current specific Address UTxOs
|
|
204
|
-
* @param address bech32 address
|
|
205
|
-
* @returns {Promise<UTxO[]>} address UTxOs
|
|
206
|
-
*/
|
|
207
131
|
getAddressUtxos(address: string): Promise<UTxO[]>;
|
|
208
132
|
/** Ogmios `Utxo` entry → normalized UTxO line (shared by the address query and the set import). */
|
|
209
133
|
private mapOgmiosUtxo;
|
|
210
|
-
/**
|
|
211
|
-
* Run `fn` against the ledger state acquired at `point` on a SEPARATE WebSocket: local-state-query
|
|
212
|
-
* holds one acquired point per connection, so the shared socket would pin live queries to the past.
|
|
213
|
-
* The point must be inside the node's volatile window (k blocks) or acquisition is refused.
|
|
214
|
-
*/
|
|
215
134
|
private withLedgerStateAt;
|
|
216
135
|
/** Whole UTxO set as of `point` (crawler snapshot import). */
|
|
217
136
|
queryUtxoSetAt(point: ChainPoint): Promise<UTxO[]>;
|
|
218
|
-
/**
|
|
219
|
-
* Pools, DReps and pots as of `point` (crawler epoch snapshot), all read from one acquired
|
|
220
|
-
* ledger state. Performances are optional: without them (no nOpt) saturation stays 0.
|
|
221
|
-
*/
|
|
137
|
+
/** Pools, DReps and pots at `point` from one ledger state. Without nOpt saturation stays 0. */
|
|
222
138
|
epochStateAt(point: ChainPoint): Promise<EpochLedgerState>;
|
|
223
|
-
/** Not supported
|
|
139
|
+
/** Not supported. Ogmios only queries live state. */
|
|
224
140
|
getAddressTransactions(_address: string): Promise<Transaction[]>;
|
|
225
|
-
/**
|
|
226
|
-
* Get current specific Pool Data
|
|
227
|
-
* @param poolId pool id
|
|
228
|
-
* @returns {Promise<PoolData>} pool data
|
|
229
|
-
*/
|
|
230
141
|
getPool(poolId: string): Promise<PoolData>;
|
|
231
|
-
/**
|
|
232
|
-
* Get Account Data for specified stake address
|
|
233
|
-
* @param stakeAddress stake address
|
|
234
|
-
* @returns {Promise<AccountData>} account data
|
|
235
|
-
*/
|
|
236
142
|
getAccount(stakeAddress: string): Promise<AccountData>;
|
|
237
|
-
/**
|
|
238
|
-
* Submit Transaction to the network
|
|
239
|
-
* @param signedTxCbor signed transaction in CBOR hex format
|
|
240
|
-
* @returns {Promise<string>} transaction hash
|
|
241
|
-
*/
|
|
242
143
|
submitTransaction(signedTxCbor: string): Promise<string>;
|
|
243
|
-
/**
|
|
244
|
-
* Evaluate transaction script execution units
|
|
245
|
-
* @param unsignedTxCbor unsigned transaction in CBOR hex format
|
|
246
|
-
* @returns {Promise<ScriptEvaluationResult[]>} evaluation results
|
|
247
|
-
*/
|
|
248
144
|
evaluateTransaction(unsignedTxCbor: string): Promise<ScriptEvaluationResult[]>;
|
|
249
|
-
/**
|
|
250
|
-
* Get current Protocol Parameters
|
|
251
|
-
* @returns {Promise<LedgerProtocolParameters>} protocol parameters
|
|
252
|
-
*/
|
|
253
145
|
getProtocolParameters(): Promise<LedgerProtocolParameters>;
|
|
254
|
-
/**
|
|
255
|
-
* Get Latest Epoch Data
|
|
256
|
-
* @returns {Promise<EpochData>} latest epoch data
|
|
257
|
-
*/
|
|
258
146
|
getLatestEpoch(): Promise<EpochData>;
|
|
259
|
-
/**
|
|
260
|
-
* Get current Latest Block Data
|
|
261
|
-
* @returns {Promise<BlockData>} latest block data
|
|
262
|
-
*/
|
|
263
147
|
getLatestBlock(): Promise<BlockData>;
|
|
264
|
-
/**
|
|
265
|
-
* Get the latest chain tip slot.
|
|
266
|
-
* @returns {Promise<number>} current chain slot
|
|
267
|
-
*/
|
|
268
148
|
getCurrentSlot(): Promise<number>;
|
|
269
|
-
/**
|
|
270
|
-
* Unspent check via `queryLedgerState/utxo` with an outputReferences filter; empty = spent or nonexistent.
|
|
271
|
-
* @param txHash 64-char lowercase hex
|
|
272
|
-
* @param outputIndex non-negative integer
|
|
273
|
-
*/
|
|
149
|
+
/** Unspent check via `queryLedgerState/utxo`. An empty answer means spent or unknown. */
|
|
274
150
|
isUtxoUnspent(txHash: string, outputIndex: number): Promise<boolean>;
|
|
275
151
|
/** Outputs among `refs` that are unspent in the live ledger; spent or unknown references are absent. */
|
|
276
152
|
getUnspentOutputs(refs: Array<{
|
|
@@ -281,34 +157,11 @@ export declare class OgmiosBackend implements EvaluatingBackend, ChainSyncBacken
|
|
|
281
157
|
shutdown(): Promise<void>;
|
|
282
158
|
isConnected(): boolean;
|
|
283
159
|
private ensureNotShutdown;
|
|
284
|
-
/**
|
|
285
|
-
* Ogmios value `{ ada: { lovelace }, policyId: { assetName: qty } }` →
|
|
286
|
-
* `[{ unit: 'lovelace', quantity }, { unit: policyId+assetName, quantity }]`.
|
|
287
|
-
*/
|
|
160
|
+
/** Ogmios value `{ ada: { lovelace }, policyId: { assetName: qty } }` to a list of units and quantities. */
|
|
288
161
|
private convertOgmiosValue;
|
|
289
|
-
/**
|
|
290
|
-
* Open a long-lived chain-sync stream on its own WebSocket. `sequential: true` + `inFlight: 1`
|
|
291
|
-
* deliver blocks strictly in order (required by reorg detection and serial persist). Inputs arrive
|
|
292
|
-
* as bare references (resolved by the indexer from indexed outputs); per-tx size/deposit are not surfaced.
|
|
293
|
-
*/
|
|
294
162
|
openChainSync(from: ChainPoint[] | 'origin', callbacks: ChainSyncCallbacks): Promise<ChainSyncHandle>;
|
|
295
|
-
/**
|
|
296
|
-
* Map an Ogmios Praos block to BlockData + transactions. Block fees are the sum of per-tx
|
|
297
|
-
* fees; epoch/epochSlot derive from the slot via the Shelley anchor. A phase-2 failure without
|
|
298
|
-
* `total_collateral` still carries its declared fee here; applyCollateralFees() corrects it.
|
|
299
|
-
*/
|
|
300
163
|
private mapOgmiosBlock;
|
|
301
|
-
/**
|
|
302
|
-
* Map one chain-sync transaction. Inputs stay bare references (resolved by the indexer).
|
|
303
|
-
* `spends` selects the ledger-applied partition: a phase-2-invalid tx consumes collaterals
|
|
304
|
-
* and creates only its collateral-return output; the fee follows that partition too.
|
|
305
|
-
*/
|
|
306
164
|
private mapOgmiosTx;
|
|
307
|
-
/**
|
|
308
|
-
* Normalize Ogmios certificates onto the shared `CertificateKind` vocabulary. A `stakeDelegation`
|
|
309
|
-
* with both pool and DRep target is split into two entries with the same index (as db-sync
|
|
310
|
-
* reports it); bare credential hashes are re-encoded as bech32 to match the other tables.
|
|
311
|
-
*/
|
|
312
165
|
private mapOgmiosCertificates;
|
|
313
166
|
}
|
|
314
167
|
export {};
|