@odatano/core 2.0.0-rc.5 → 2.0.0-rc.50
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 +99 -51
- package/@cds-models/CardanoAgentService/index.js +15 -0
- package/@cds-models/CardanoBackendService/index.d.ts +347 -0
- package/@cds-models/CardanoBackendService/index.js +40 -0
- package/@cds-models/CardanoIndexerService/index.d.ts +496 -11
- package/@cds-models/CardanoIndexerService/index.js +64 -0
- package/@cds-models/CardanoODataService/index.d.ts +414 -57
- package/@cds-models/CardanoODataService/index.js +42 -0
- package/@cds-models/CardanoSignService/index.d.ts +32 -19
- package/@cds-models/CardanoSignService/index.js +3 -0
- package/@cds-models/CardanoTransactionService/index.d.ts +58 -44
- package/@cds-models/CardanoTransactionService/index.js +4 -0
- package/@cds-models/CardanoWorkerService/index.d.ts +7 -22
- package/@cds-models/index.d.ts +101 -1
- package/@cds-models/index.js +16 -1
- package/@cds-models/odatano/cardano/index.d.ts +437 -32
- package/@cds-models/odatano/cardano/index.js +48 -0
- package/README.md +207 -167
- package/db/schema.cds +2402 -1705
- package/db/types.cds +446 -295
- package/package.json +41 -16
- package/scripts/migrate-schema.mjs +334 -0
- package/scripts/migrate-slot-leader.mjs +96 -0
- package/src/index.d.ts +20 -21
- package/src/index.js +45 -31
- package/src/plugin.js +17 -35
- package/srv/blockchain/asset-decimals.d.ts +7 -0
- package/srv/blockchain/asset-decimals.js +91 -0
- package/srv/blockchain/backends/blockfrost-backend.d.ts +25 -135
- package/srv/blockchain/backends/blockfrost-backend.js +66 -172
- package/srv/blockchain/backends/cardano-backend.d.ts +94 -186
- package/srv/blockchain/backends/cardano-backend.js +29 -5
- package/srv/blockchain/backends/koios-backend.d.ts +103 -168
- package/srv/blockchain/backends/koios-backend.js +428 -360
- package/srv/blockchain/backends/odatano-backend.d.ts +54 -0
- package/srv/blockchain/backends/odatano-backend.js +169 -0
- package/srv/blockchain/backends/ogmios-backend.d.ts +123 -190
- package/srv/blockchain/backends/ogmios-backend.js +637 -315
- package/srv/blockchain/backends/ogmios-frame-guard.d.ts +14 -0
- package/srv/blockchain/backends/ogmios-frame-guard.js +89 -0
- package/srv/blockchain/cardano-client.d.ts +61 -241
- package/srv/blockchain/cardano-client.js +253 -293
- package/srv/blockchain/cardano-indexer.d.ts +282 -281
- package/srv/blockchain/cardano-indexer.js +1551 -484
- package/srv/blockchain/cardano-tx-builder.d.ts +25 -89
- package/srv/blockchain/cardano-tx-builder.js +164 -140
- package/srv/blockchain/circuit-breaker.d.ts +1 -13
- package/srv/blockchain/circuit-breaker.js +5 -15
- package/srv/blockchain/crawler/account-snapshots.d.ts +29 -0
- package/srv/blockchain/crawler/account-snapshots.js +153 -0
- package/srv/blockchain/crawler/asset-decimals-backfill.d.ts +15 -0
- package/srv/blockchain/crawler/asset-decimals-backfill.js +56 -0
- package/srv/blockchain/crawler/asset-registry-backfill.d.ts +43 -0
- package/srv/blockchain/crawler/asset-registry-backfill.js +153 -0
- package/srv/blockchain/crawler/certificate-backfill.d.ts +52 -0
- package/srv/blockchain/crawler/certificate-backfill.js +162 -0
- package/srv/blockchain/crawler/crawler.d.ts +104 -81
- package/srv/blockchain/crawler/crawler.js +532 -160
- package/srv/blockchain/crawler/credential-backfill.d.ts +28 -0
- package/srv/blockchain/crawler/credential-backfill.js +124 -0
- package/srv/blockchain/crawler/hooks.d.ts +2 -17
- package/srv/blockchain/crawler/index.d.ts +1 -8
- package/srv/blockchain/crawler/index.js +31 -17
- package/srv/blockchain/crawler/input-asset-copies.d.ts +34 -0
- package/srv/blockchain/crawler/input-asset-copies.js +171 -0
- package/srv/blockchain/crawler/metadata-position-backfill.d.ts +16 -0
- package/srv/blockchain/crawler/metadata-position-backfill.js +55 -0
- package/srv/blockchain/crawler/output-datum-backfill.d.ts +39 -0
- package/srv/blockchain/crawler/output-datum-backfill.js +110 -0
- package/srv/blockchain/crawler/sync-state.d.ts +27 -47
- package/srv/blockchain/crawler/sync-state.js +113 -63
- package/srv/blockchain/crawler/transaction-backfill.d.ts +44 -0
- package/srv/blockchain/crawler/transaction-backfill.js +278 -0
- package/srv/blockchain/crawler/utxo-set-import.d.ts +66 -0
- package/srv/blockchain/crawler/utxo-set-import.js +399 -0
- package/srv/blockchain/ledger-state.d.ts +62 -0
- package/srv/blockchain/ledger-state.js +419 -0
- package/srv/blockchain/pending-spends.d.ts +16 -0
- package/srv/blockchain/pending-spends.js +81 -0
- package/srv/blockchain/pool-metadata.d.ts +15 -0
- package/srv/blockchain/pool-metadata.js +132 -0
- 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 +3 -17
- package/srv/blockchain/signing/cose-verifier.js +146 -70
- package/srv/blockchain/signing/external-signer.d.ts +15 -115
- package/srv/blockchain/signing/external-signer.js +17 -126
- package/srv/blockchain/signing/hsm-signer.d.ts +10 -54
- package/srv/blockchain/signing/hsm-signer.js +28 -79
- package/srv/blockchain/signing/signature-verifier.d.ts +9 -47
- package/srv/blockchain/signing/signature-verifier.js +70 -83
- package/srv/blockchain/signing/submission-finalizer.d.ts +23 -45
- package/srv/blockchain/signing/submission-finalizer.js +219 -86
- package/srv/blockchain/stored-chain.d.ts +20 -0
- package/srv/blockchain/stored-chain.js +237 -0
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts +31 -229
- package/srv/blockchain/transaction-building/buildooor-tx.js +652 -416
- package/srv/blockchain/transaction-building/cardano-tx.d.ts +9 -37
- package/srv/blockchain/transaction-presence.d.ts +5 -0
- package/srv/blockchain/transaction-presence.js +29 -0
- package/srv/blockchain/transaction-rows.d.ts +12 -0
- package/srv/blockchain/transaction-rows.js +44 -0
- package/srv/blockchain/wallet-worker/build-request.d.ts +5 -20
- package/srv/blockchain/wallet-worker/build-request.js +47 -30
- package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +5 -46
- package/srv/blockchain/wallet-worker/confirmation-tracker.js +25 -45
- package/srv/blockchain/wallet-worker/index.d.ts +1 -1
- package/srv/blockchain/wallet-worker/index.js +3 -11
- package/srv/blockchain/wallet-worker/job-store.d.ts +30 -148
- package/srv/blockchain/wallet-worker/job-store.js +101 -201
- package/srv/blockchain/wallet-worker/lease-heartbeat.d.ts +2 -26
- package/srv/blockchain/wallet-worker/lease-heartbeat.js +6 -28
- package/srv/blockchain/wallet-worker/signers.d.ts +5 -24
- package/srv/blockchain/wallet-worker/signers.js +4 -12
- package/srv/blockchain/wallet-worker/wallet-worker.d.ts +8 -80
- package/srv/blockchain/wallet-worker/wallet-worker.js +107 -155
- package/srv/cardano-agent-service.cds +122 -84
- package/srv/cardano-agent-service.js +4 -9
- package/srv/cardano-backend-service.cds +78 -0
- package/srv/cardano-backend-service.d.ts +2 -0
- package/srv/cardano-backend-service.js +242 -0
- package/srv/cardano-indexer-service.cds +387 -73
- package/srv/cardano-indexer-service.d.ts +5 -1
- package/srv/cardano-indexer-service.js +532 -16
- package/srv/cardano-service.cds +424 -269
- package/srv/cardano-service.js +289 -201
- package/srv/cardano-sign-service.cds +201 -180
- package/srv/cardano-sign-service.js +71 -201
- package/srv/cardano-tx-service.cds +451 -370
- package/srv/cardano-tx-service.js +271 -289
- package/srv/cardano-ui.cds +16 -16
- package/srv/cardano-worker-service.cds +118 -125
- package/srv/cardano-worker-service.js +52 -61
- package/srv/cbor/cip68.d.ts +13 -0
- package/srv/cbor/cip68.js +56 -0
- package/srv/cbor/index.d.ts +3 -1
- package/srv/cbor/index.js +9 -1
- package/srv/cbor/parse.d.ts +30 -18
- package/srv/cbor/parse.js +44 -9
- package/srv/cbor/plutus-data-json.d.ts +20 -0
- package/srv/cbor/plutus-data-json.js +32 -0
- package/srv/config.d.ts +113 -0
- package/srv/config.js +409 -0
- package/srv/server.d.ts +15 -110
- package/srv/server.js +84 -404
- package/srv/utils/agent-access.d.ts +9 -0
- package/srv/utils/agent-access.js +67 -0
- package/srv/utils/agent-grants-config.d.ts +0 -46
- package/srv/utils/agent-grants-config.js +17 -85
- package/srv/utils/agent-grants.d.ts +106 -122
- package/srv/utils/agent-grants.js +538 -236
- package/srv/utils/agent-token-auth.d.ts +4 -99
- package/srv/utils/agent-token-auth.js +18 -182
- package/srv/utils/backend-request-handler.d.ts +3 -17
- package/srv/utils/backend-request-handler.js +3 -18
- package/srv/utils/collections.d.ts +3 -10
- package/srv/utils/collections.js +3 -10
- package/srv/utils/const.d.ts +23 -74
- package/srv/utils/const.js +32 -79
- package/srv/utils/crypto.d.ts +3 -12
- package/srv/utils/crypto.js +6 -21
- package/srv/utils/db-indexes.d.ts +27 -0
- package/srv/utils/db-indexes.js +120 -0
- package/srv/utils/db-sanitize.d.ts +20 -0
- package/srv/utils/db-sanitize.js +80 -0
- package/srv/utils/deep-json.d.ts +6 -0
- package/srv/utils/deep-json.js +240 -0
- package/srv/utils/epoch-slots.d.ts +13 -0
- package/srv/utils/epoch-slots.js +38 -0
- package/srv/utils/error-codes.d.ts +22 -75
- package/srv/utils/error-codes.js +23 -72
- package/srv/utils/errors.d.ts +46 -187
- package/srv/utils/errors.js +114 -230
- package/srv/utils/liveness.d.ts +12 -0
- package/srv/utils/liveness.js +35 -0
- package/srv/utils/mappers.d.ts +102 -223
- package/srv/utils/mappers.js +387 -316
- package/srv/utils/network-context.js +2 -13
- package/srv/utils/paging.d.ts +31 -0
- package/srv/utils/paging.js +43 -0
- package/srv/utils/pg-inline-json.d.ts +8 -0
- package/srv/utils/pg-inline-json.js +58 -0
- package/srv/utils/pg-order-nulls.d.ts +14 -0
- package/srv/utils/pg-order-nulls.js +54 -0
- package/srv/utils/plutus-placeholders.d.ts +16 -22
- package/srv/utils/plutus-placeholders.js +62 -33
- package/srv/utils/rate-limiter.d.ts +2 -21
- package/srv/utils/rate-limiter.js +5 -17
- package/srv/utils/readiness.d.ts +12 -0
- package/srv/utils/readiness.js +29 -0
- package/srv/utils/reference-script.d.ts +19 -0
- package/srv/utils/reference-script.js +84 -0
- package/srv/utils/result-numbers.d.ts +15 -0
- package/srv/utils/result-numbers.js +61 -0
- package/srv/utils/service-events.d.ts +0 -24
- package/srv/utils/service-events.js +3 -25
- package/srv/utils/signing-helper.d.ts +3 -20
- package/srv/utils/signing-helper.js +35 -64
- package/srv/utils/tx-build-helper.d.ts +10 -105
- package/srv/utils/tx-build-helper.js +81 -144
- package/srv/utils/tx-request-parsers.d.ts +82 -33
- package/srv/utils/tx-request-parsers.js +401 -49
- package/srv/utils/tx-utils.d.ts +3 -27
- package/srv/utils/tx-utils.js +32 -50
- package/srv/utils/types.d.ts +261 -191
- package/srv/utils/types.js +2 -6
- package/srv/utils/validators.d.ts +22 -92
- package/srv/utils/validators.js +50 -149
|
@@ -1,285 +1,309 @@
|
|
|
1
1
|
import type { Transaction as CapTransaction } from '@sap/cds';
|
|
2
2
|
import type { CardanoClient } from './cardano-client';
|
|
3
3
|
import type { CardanoTransactionBuilder } from './cardano-tx-builder';
|
|
4
|
-
import { Transaction as CardanoTransaction,
|
|
4
|
+
import { Transaction as CardanoTransaction, type AddressUTxO, TransactionMetadata, NetworkInformation, Block, Epoch, AssetHistory, Account, Drep, Pool, Asset, Address, LedgerProtocolParameter, type AddressTransaction } from '#cds-models/CardanoODataService';
|
|
5
5
|
import { TransactionBuild, TransactionSubmission } from '#cds-models/CardanoTransactionService';
|
|
6
|
-
import { TxBuildRequest, Transaction as ProviderTransaction, BlockData } from '../utils/types';
|
|
6
|
+
import { TxBuildRequest, TxBuildPlutusRequest, AssetInfo, AccountData, PoolData, NetworkInformation as ProviderNetworkInformation, Address as ProviderAddress, Transaction as ProviderTransaction, UTxO as OdatanoUtxo, BlockData, AssetHistoryEntry as AssetHistoryEntryProviderData, TransactionConfirmations } from '../utils/types';
|
|
7
|
+
import { type LedgerAnchor, type LedgerLookup } from './ledger-state';
|
|
7
8
|
import type { TxCacheTargets } from '../utils/tx-build-helper';
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*/
|
|
9
|
+
/** Newest transactions of an address as read: the rows to answer with and what is not stored yet. */
|
|
10
|
+
export interface FetchedAddressTransactions {
|
|
11
|
+
rows: AddressTransaction[];
|
|
12
|
+
newRows: AddressTransaction[];
|
|
13
|
+
transactions: Map<string, ProviderTransaction>;
|
|
14
|
+
}
|
|
15
|
+
/** An address as read; `transactions` is null when their read failed. */
|
|
16
|
+
export interface FetchedAddress {
|
|
17
|
+
address: string;
|
|
18
|
+
data: ProviderAddress;
|
|
19
|
+
transactions: FetchedAddressTransactions | null;
|
|
20
|
+
}
|
|
21
|
+
/** An account as read, with the addresses it controls. */
|
|
22
|
+
export interface FetchedAccount {
|
|
23
|
+
account: AccountData;
|
|
24
|
+
addresses: FetchedAddress[];
|
|
25
|
+
}
|
|
26
|
+
/** A block as read; `epoch` is missing when the backend has no data for its epoch. */
|
|
27
|
+
export interface FetchedBlock {
|
|
28
|
+
block: BlockData;
|
|
29
|
+
epoch?: Epoch;
|
|
30
|
+
}
|
|
31
|
+
/** Metadata of a transaction as the backend reports it. */
|
|
32
|
+
export interface FetchedTransactionMetadata {
|
|
33
|
+
txHash: string;
|
|
34
|
+
metadata: Awaited<ReturnType<CardanoClient['getTransactionMetadata']>>;
|
|
35
|
+
}
|
|
36
|
+
/** Progress of backfillEpochs. */
|
|
37
|
+
export interface EpochBackfillProgress {
|
|
38
|
+
atEpoch: number;
|
|
39
|
+
toEpoch: number;
|
|
40
|
+
updated: number;
|
|
41
|
+
created: number;
|
|
42
|
+
}
|
|
43
|
+
/** Protocol parameters; `fresh` is false when the stored row was still current. */
|
|
44
|
+
export interface FetchedProtocolParameters {
|
|
45
|
+
row: LedgerProtocolParameter;
|
|
46
|
+
fresh: boolean;
|
|
47
|
+
}
|
|
48
|
+
/** Fetches chain data, maps it to entity rows and UPSERTs them in the caller's transaction. */
|
|
21
49
|
export declare class CardanoIndexer {
|
|
22
50
|
private client;
|
|
23
51
|
private txBuilder;
|
|
24
52
|
private lastParamsFetchTime;
|
|
25
53
|
private static readonly CRAWL_EPOCH_REFRESH_MS;
|
|
26
54
|
private static readonly CRAWL_EPOCH_RETRY_MS;
|
|
27
|
-
/**
|
|
28
|
-
* Crawler epoch memo. Network reads are refreshed periodically while an epoch is
|
|
29
|
-
* live and once more when the next epoch starts, so counters such as block_count,
|
|
30
|
-
* fees and lastBlockTime do not remain frozen at their first observed value.
|
|
31
|
-
*
|
|
32
|
-
* At most the current and immediately previous epoch are retained. The rows are
|
|
33
|
-
* intentionally UPSERTed in every block transaction: the caller owns that
|
|
34
|
-
* transaction, so an in-memory "persisted" bit cannot know whether its commit later
|
|
35
|
-
* succeeded. Repeating one local UPSERT is cheap and remains correct after rollback.
|
|
36
|
-
*/
|
|
37
55
|
private crawlEpochCache;
|
|
38
56
|
private crawlEpochCurrent;
|
|
57
|
+
/** Epoch rows known to be committed; a refresh creates a new row object and is written again. */
|
|
58
|
+
private crawlEpochWritten;
|
|
59
|
+
/** Memo updates of the running block transaction, applied only after its commit. */
|
|
60
|
+
private pendingCommit;
|
|
39
61
|
private crawlEpochPrevious;
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
62
|
+
/** Analytics coverage of the crawl path; defaults mirror the crawler config defaults. */
|
|
63
|
+
private crawlAssetHistory;
|
|
64
|
+
private crawlAssetCatalogue;
|
|
65
|
+
/** Certificates + withdrawals per block (ledger-state coverage). Opt-in. */
|
|
66
|
+
private crawlCertificates;
|
|
67
|
+
/** Logged once per process: the active source reports no certificates (Blockfrost). */
|
|
68
|
+
private certificatesUnreportedWarned;
|
|
69
|
+
/** Blocks after utxoAnchor are applied to the Ledger* tables. Without an anchor the mode is inactive. */
|
|
70
|
+
private crawlUtxoSet;
|
|
71
|
+
/** crawler.authoritative: misses in the crawled chain are 404, no provider call. */
|
|
72
|
+
private crawlAuthoritative;
|
|
73
|
+
/** crawler.inputAssetCopies: every crawled input keeps a copy of its assets and points at no output. */
|
|
74
|
+
private crawlInputAssetCopies;
|
|
75
|
+
private utxoAnchor;
|
|
76
|
+
/** `LedgerAddresses.paymentCredential` is complete; the running fill and its table generation. */
|
|
77
|
+
private credentialsReady;
|
|
78
|
+
private credentialFill;
|
|
79
|
+
private credentialGeneration;
|
|
80
|
+
/** The anchor block was found in the crawled chain (checked once, before the first apply). */
|
|
81
|
+
private utxoAnchorVerified;
|
|
82
|
+
/** Kept until the crawler confirms the block commit, so a rolled-back attempt changes nothing. */
|
|
83
|
+
private ledgerInvalidation;
|
|
84
|
+
/** Load pool metadata files from their registered URL. Off unless configured. */
|
|
85
|
+
private poolMetadataFetch;
|
|
86
|
+
private poolMetadataByHash;
|
|
87
|
+
private static readonly POOL_METADATA_MEMO_CAP;
|
|
88
|
+
/** Units known to have an `Assets` row, so a repeat sighting costs no DB round-trip. */
|
|
89
|
+
private static readonly ASSET_MEMO_CAP;
|
|
90
|
+
/** Output references per node lookup when checking crawled UTxOs. */
|
|
91
|
+
private static readonly OUTREF_CHUNK;
|
|
92
|
+
private assetMemo;
|
|
93
|
+
private static readonly ENRICH_QUEUE_CAP;
|
|
94
|
+
private enrichQueue;
|
|
95
|
+
private enrichTimer;
|
|
96
|
+
private enrichRate;
|
|
97
|
+
/** Adopt the crawler's coverage settings; the lazy request path never touches these. */
|
|
98
|
+
configureCrawlCoverage(coverage: {
|
|
99
|
+
assetHistory: boolean;
|
|
100
|
+
assetCatalogue: 'off' | 'bare' | 'enrich';
|
|
101
|
+
assetEnrichRate?: number;
|
|
102
|
+
certificates?: boolean;
|
|
103
|
+
utxoSet?: boolean;
|
|
104
|
+
authoritative?: boolean;
|
|
105
|
+
inputAssetCopies?: boolean;
|
|
106
|
+
}): void;
|
|
107
|
+
private localCoverage;
|
|
108
|
+
private localPoolBlocks;
|
|
109
|
+
private crawlAnswers;
|
|
110
|
+
/** 404 for a lookup the crawled chain answers on its own (the caller already missed in the DB). */
|
|
111
|
+
refuseOutsideCrawl(tx: CapTransaction, method: string, what: string): Promise<void>;
|
|
112
|
+
private localAssetInfo;
|
|
113
|
+
/** Address from the crawled UTxO set when it answers, else from the backend. */
|
|
114
|
+
resolveAddress(tx: CapTransaction, addr: string): Promise<ProviderAddress>;
|
|
115
|
+
/** UTxOs of an address: the crawled set (checked unspent at the node) when it answers, else the backend. */
|
|
116
|
+
resolveAddressUtxos(tx: CapTransaction, addr: string): Promise<OdatanoUtxo[]>;
|
|
117
|
+
/** Asset from the crawled chain when it answers, else from the backend. */
|
|
118
|
+
resolveAssetInfo(tx: CapTransaction, unit: string): Promise<AssetInfo>;
|
|
119
|
+
/** Stored mint/burn rows, newest first. Null when the crawled chain does not answer for them. */
|
|
120
|
+
private crawledAssetHistory;
|
|
121
|
+
/** Mint/burn events, newest first: crawled rows when the crawled chain answers, else the backend. */
|
|
122
|
+
resolveAssetHistory(tx: CapTransaction, unit: string, limit: number): Promise<AssetHistoryEntryProviderData[]>;
|
|
123
|
+
/** UTxOs of a payment credential: the crawled set when it answers, else Koios. */
|
|
124
|
+
resolveCredentialUtxos(tx: CapTransaction, credHash: string): Promise<OdatanoUtxo[]>;
|
|
125
|
+
/** Latest transaction hashes of an address: the crawled set when it has enough, else the backend. */
|
|
126
|
+
resolveAddressTransactionHashes(tx: CapTransaction, addr: string, limit: number): Promise<string[]>;
|
|
127
|
+
/** True while the crawled UTxO set answers address queries (live crawler at the tip, set active). */
|
|
128
|
+
ledgerCoverageActive(tx: CapTransaction): Promise<boolean>;
|
|
129
|
+
private localAddress;
|
|
130
|
+
/** Addresses of a stake key in the crawled UTxO set, with their stored unspent outputs (one read for all). */
|
|
131
|
+
private ledgerAccountUtxos;
|
|
132
|
+
private localAddressTransactions;
|
|
133
|
+
/** Amount lists (lovelace + assets) of `LedgerUTxOs` rows, keyed `txHash#outputIndex`. */
|
|
134
|
+
private ledgerAmounts;
|
|
135
|
+
private snapshotActiveStake;
|
|
136
|
+
private localWithdrawalsSum;
|
|
137
|
+
/** The anchor the imported UTxO set describes (null = ledger mode inactive). */
|
|
138
|
+
setUtxoAnchor(anchor: LedgerAnchor | null): void;
|
|
139
|
+
private verifyUtxoAnchor;
|
|
140
|
+
/** Null while the mode is off, nothing is imported, or an invalidation awaits its commit. */
|
|
141
|
+
getUtxoAnchor(): LedgerAnchor | null;
|
|
142
|
+
/** Apply the memo updates of the block transaction that just committed. */
|
|
143
|
+
confirmBlockCommit(): void;
|
|
144
|
+
/** Hand out a pending invalidation (dropping the anchor) exactly once after the block commit, or null. */
|
|
145
|
+
takeLedgerInvalidation(): string | null;
|
|
146
|
+
private startAssetEnrichment;
|
|
147
|
+
/** Stop the enrichment loop and forget what is still queued (shutdown, crawler halt, mode change). */
|
|
148
|
+
stopAssetEnrichment(): void;
|
|
45
149
|
prefetchCrawlEpoch(epochNumber: number): Promise<void>;
|
|
46
150
|
private refreshCrawlEpoch;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
*/
|
|
151
|
+
private crawledEpochTotals;
|
|
152
|
+
/** Epoch row with only the slot-derived bounds, for an epoch the backend cannot describe. */
|
|
153
|
+
private bareEpochRow;
|
|
154
|
+
backfillEpochs(onProgress?: (p: EpochBackfillProgress) => void): Promise<EpochBackfillProgress>;
|
|
52
155
|
constructor(client: CardanoClient, txBuilder: CardanoTransactionBuilder);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
* @returns {Promise<CardanoTransaction>} transaction entity data
|
|
60
|
-
*/
|
|
156
|
+
private localAddressUtxos;
|
|
157
|
+
/** A transaction from the backend. 404 when the crawled chain answers for it alone. */
|
|
158
|
+
fetchTransaction(tx: CapTransaction, txHash: string): Promise<ProviderTransaction>;
|
|
159
|
+
/** All UPSERTs run in the caller's transaction, so everything persists or nothing does. */
|
|
160
|
+
storeTransaction(tx: CapTransaction, providerTx: ProviderTransaction): Promise<CardanoTransaction>;
|
|
161
|
+
/** Reads a transaction from the backend and stores it. */
|
|
61
162
|
indexTransaction(tx: CapTransaction, txHash: string): Promise<CardanoTransaction>;
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
* the live UTxO set but not address aggregation (e.g. Ogmios). Used as the
|
|
88
|
-
* GetUTxOsByAddress fallback when no configured backend supports getAddress.
|
|
89
|
-
*
|
|
90
|
-
* Does NOT upsert a parent Addresses row (same pattern as indexCredentialUtxos);
|
|
91
|
-
* AddressUTxOs/UTxOAssets reference the bech32 address directly.
|
|
92
|
-
*
|
|
93
|
-
* @param tx CAP transaction
|
|
94
|
-
* @param addr bech32 address
|
|
95
|
-
* @return UTxO entity rows for the address (empty when the address holds none)
|
|
96
|
-
*/
|
|
97
|
-
indexAddressUtxos(tx: CapTransaction, addr: string): Promise<AddressUTxOs[]>;
|
|
98
|
-
/**
|
|
99
|
-
* Evict cached rows a submitted transaction made stale, so the next read
|
|
100
|
-
* refetches instead of serving spent UTxOs for up to indexTtlMs:
|
|
101
|
-
* - every consumed input ref (spent under WHATEVER address cached it),
|
|
102
|
-
* - all address-level rows of the output addresses (their UTxO set gained
|
|
103
|
-
* the new outputs — sender change included) and of `extraAddresses`
|
|
104
|
-
* (e.g. the build's sender when the CBOR could not be parsed).
|
|
105
|
-
*
|
|
106
|
-
* Only the read cache is touched; submissions/builds stay untouched. Note the
|
|
107
|
-
* next refetch may STILL see pre-submit state on lagging backends
|
|
108
|
-
* (Blockfrost/Koios propagation) — that matches cache-less behaviour and is
|
|
109
|
-
* not recoverable server-side.
|
|
110
|
-
*
|
|
111
|
-
* @param tx CAP transaction
|
|
112
|
-
* @param targets input refs + output addresses from extractTxCacheTargets
|
|
113
|
-
* @param extraAddresses additional bech32 addresses to evict
|
|
114
|
-
*/
|
|
163
|
+
/** Lazy path: inputs, outputs, their assets and metadata of one transaction. */
|
|
164
|
+
private writeTransactionChildren;
|
|
165
|
+
fetchAddress(tx: CapTransaction, addr: string, prefetched?: ProviderAddress): Promise<FetchedAddress>;
|
|
166
|
+
/** Reads an address and its newest transactions, then stores them. */
|
|
167
|
+
indexAddress(tx: CapTransaction, addr: string, prefetched?: ProviderAddress): Promise<Address>;
|
|
168
|
+
/** Stores what fetchAddress read: the address, its assets, UTxOs and newest transactions. */
|
|
169
|
+
storeAddress(tx: CapTransaction, fetched: FetchedAddress): Promise<Address>;
|
|
170
|
+
/** UTxOs of a payment credential, always fresh: the crawled set when it answers, else the backend. */
|
|
171
|
+
fetchCredentialUtxos(tx: CapTransaction, credHash: string): Promise<OdatanoUtxo[]>;
|
|
172
|
+
/** Reads the UTxOs of a payment credential and stores them. */
|
|
173
|
+
indexCredentialUtxos(tx: CapTransaction, credHash: string): Promise<AddressUTxO[]>;
|
|
174
|
+
/** Stores credential UTxOs. Rows are written without a parent Addresses row. */
|
|
175
|
+
storeCredentialUtxos(tx: CapTransaction, utxos: OdatanoUtxo[]): Promise<AddressUTxO[]>;
|
|
176
|
+
private localCredentialUtxos;
|
|
177
|
+
private unspentAtNode;
|
|
178
|
+
/** Unspent `LedgerUTxOs` (+ assets) of the given addresses in the provider UTxO shape. */
|
|
179
|
+
private ledgerUtxosOf;
|
|
180
|
+
paymentCredentialsReady(): Promise<boolean>;
|
|
181
|
+
/** The ledger tables were replaced (re-import): the credential column has to be filled again. */
|
|
182
|
+
resetPaymentCredentials(): void;
|
|
183
|
+
indexAddressUtxos(tx: CapTransaction, addr: string): Promise<AddressUTxO[]>;
|
|
184
|
+
/** The UTxOs of an address from the backend. */
|
|
185
|
+
fetchAddressUtxos(addr: string): Promise<OdatanoUtxo[]>;
|
|
186
|
+
/** Stores the UTxOs of an address. Writes no parent Addresses row. */
|
|
187
|
+
storeAddressUtxos(tx: CapTransaction, addr: string, utxos: OdatanoUtxo[]): Promise<AddressUTxO[]>;
|
|
115
188
|
invalidateUtxoCacheForTx(tx: CapTransaction, targets: TxCacheTargets, extraAddresses?: string[]): Promise<void>;
|
|
116
|
-
/**
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
* @return {Promise<AddressTransactions[]>} address transaction entities
|
|
122
|
-
*/
|
|
123
|
-
indexAddressTransactions(tx: CapTransaction, addr: string, limit: number): Promise<AddressTransactions[]>;
|
|
124
|
-
/**
|
|
125
|
-
* Index & return address signing request association
|
|
126
|
-
* Links an address to a signing request for address-based queries
|
|
127
|
-
* @param tx CAP transaction
|
|
128
|
-
* @param addr bech32 address
|
|
129
|
-
* @param signingRequestId signing request UUID
|
|
130
|
-
* @return {Promise<void>}
|
|
131
|
-
*/
|
|
189
|
+
/** Index address transactions (separate from indexAddress for lazy loading). */
|
|
190
|
+
indexAddressTransactions(tx: CapTransaction, addr: string, limit: number): Promise<AddressTransaction[]>;
|
|
191
|
+
fetchAddressTransactions(tx: CapTransaction, addr: string, limit: number): Promise<FetchedAddressTransactions>;
|
|
192
|
+
storeAddressTransactions(tx: CapTransaction, fetched: FetchedAddressTransactions): Promise<AddressTransaction[]>;
|
|
193
|
+
/** Link an address to a signing request for address-based queries. */
|
|
132
194
|
indexAddressSigningRequests(tx: CapTransaction, addr: string, signingRequestId: string): Promise<void>;
|
|
133
|
-
/**
|
|
134
|
-
* Index & return address transaction build association
|
|
135
|
-
* Links an address to a transaction build for address-based queries
|
|
136
|
-
* @param tx CAP transaction
|
|
137
|
-
* @param addr bech32 address
|
|
138
|
-
* @param buildId transaction build UUID
|
|
139
|
-
* @return {Promise<void>}
|
|
140
|
-
*/
|
|
195
|
+
/** Link an address to a transaction build for address-based queries. */
|
|
141
196
|
indexAddressTransactionBuilds(tx: CapTransaction, addr: string, buildId: string): Promise<void>;
|
|
142
|
-
/**
|
|
143
|
-
* Index & return metadata for a single transaction (Metadata)
|
|
144
|
-
* @param tx CAP transaction
|
|
145
|
-
* @param txHash transaction hash
|
|
146
|
-
* @param metadata raw metadata object (label -> JSONValue)
|
|
147
|
-
* @return {Promise<TransactionMetadata[]>} array of transaction metadata rows
|
|
148
|
-
*/
|
|
197
|
+
/** Index the metadata rows of a transaction. */
|
|
149
198
|
indexTransactionMetadata(tx: CapTransaction, tx_hash: string): Promise<TransactionMetadata[]>;
|
|
150
|
-
/**
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
199
|
+
/** Metadata of a transaction from the backend. Null when the transaction is known to have none. */
|
|
200
|
+
fetchTransactionMetadata(tx: CapTransaction, tx_hash: string): Promise<FetchedTransactionMetadata | null>;
|
|
201
|
+
/** Stores the metadata rows of a transaction and returns them. */
|
|
202
|
+
storeTransactionMetadata(tx: CapTransaction, fetched: FetchedTransactionMetadata | null): Promise<TransactionMetadata[]>;
|
|
203
|
+
/** Index the network information; circulating supply comes from the crawled UTxO set when it is current. */
|
|
155
204
|
indexNetworkInformation(tx: CapTransaction): Promise<NetworkInformation>;
|
|
156
|
-
/**
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
205
|
+
/** The network information row, read but not stored. */
|
|
206
|
+
fetchNetworkInformation(tx: CapTransaction): Promise<NetworkInformation>;
|
|
207
|
+
storeNetworkInformation(tx: CapTransaction, netEntity: NetworkInformation): Promise<NetworkInformation>;
|
|
208
|
+
/** Network information from the backend; circulating supply from the crawled UTxO set when current. */
|
|
209
|
+
resolveNetworkInformation(tx: CapTransaction): Promise<ProviderNetworkInformation>;
|
|
210
|
+
/** Index a block by hash, with best-effort epoch enrichment. */
|
|
162
211
|
indexBlock(tx: CapTransaction, blockHash: string): Promise<Block>;
|
|
163
|
-
/**
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
*
|
|
169
|
-
* All writes run inside the caller's CAP transaction (`tx`), so a block is persisted
|
|
170
|
-
* atomically — a failure mid-block rolls the whole block back, keeping the cursor and
|
|
171
|
-
* the data consistent.
|
|
172
|
-
*
|
|
173
|
-
* Inputs from the Ogmios chain-sync path arrive as bare references (no address/amount);
|
|
174
|
-
* resolveInputs() backfills them from this block's own outputs and previously-indexed
|
|
175
|
-
* outputs before mapping. Blockfrost/Koios inputs already carry address/amount and are
|
|
176
|
-
* left untouched.
|
|
177
|
-
*
|
|
178
|
-
* @param tx CAP transaction (one per block, committed by the crawler)
|
|
179
|
-
* @param blockData block header/summary from the crawler source
|
|
180
|
-
* @param txs the block's full transaction list (in block order)
|
|
181
|
-
*/
|
|
212
|
+
/** A block and its epoch from the backend. 404 when the crawled chain answers for it alone. */
|
|
213
|
+
fetchBlock(tx: CapTransaction, blockHash: string): Promise<FetchedBlock>;
|
|
214
|
+
private withEpoch;
|
|
215
|
+
/** Stores a block and, when it was read, its epoch. */
|
|
216
|
+
storeBlock(tx: CapTransaction, fetched: FetchedBlock): Promise<Block>;
|
|
182
217
|
indexBlockFull(tx: CapTransaction, blockData: BlockData, txs: ProviderTransaction[]): Promise<void>;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
private
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
218
|
+
private removeSupersededBlocks;
|
|
219
|
+
private removeStaleTxSeqs;
|
|
220
|
+
private warnIfCertificatesUnreported;
|
|
221
|
+
resolveInputs(tx: CapTransaction, txs: ProviderTransaction[], ledger?: LedgerLookup): Promise<void>;
|
|
222
|
+
private referenceStoredOutputs;
|
|
223
|
+
private applyDeposits;
|
|
224
|
+
private applyCollateralFees;
|
|
225
|
+
private buildAssetHistoryRows;
|
|
226
|
+
private ensureAssetRows;
|
|
227
|
+
private noteAssetSeen;
|
|
228
|
+
snapshotEpoch(epoch: number, at: {
|
|
229
|
+
slot: number;
|
|
230
|
+
time: number;
|
|
231
|
+
hash?: string | null;
|
|
232
|
+
}): Promise<{
|
|
233
|
+
pools: number;
|
|
234
|
+
dreps: number;
|
|
235
|
+
source: 'ogmios' | 'koios' | null;
|
|
236
|
+
}>;
|
|
237
|
+
private snapshotEpochFromLedger;
|
|
238
|
+
private previousLiveStake;
|
|
239
|
+
/** Crawled blocks per pool up to `slot`; null unless the crawl started at or before Shelley. */
|
|
240
|
+
private crawledBlocksByPool;
|
|
241
|
+
/** Every native-asset unit a block touches: outputs, consumed inputs and mint/burn rows. */
|
|
242
|
+
private collectBlockUnits;
|
|
243
|
+
/** Index an epoch by number. */
|
|
196
244
|
indexEpoch(tx: CapTransaction, epochNumber: number): Promise<Epoch>;
|
|
197
|
-
/**
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
* @returns {Promise<Account>} account entity data
|
|
202
|
-
*/
|
|
245
|
+
/** An epoch row from the backend. */
|
|
246
|
+
fetchEpoch(epochNumber: number): Promise<Epoch>;
|
|
247
|
+
storeEpoch(tx: CapTransaction, epochEntity: Epoch): Promise<Epoch>;
|
|
248
|
+
/** Index an account by stake address, plus its addresses when it has any. */
|
|
203
249
|
indexAccount(tx: CapTransaction, stakeAddress: string): Promise<Account>;
|
|
204
|
-
/**
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
250
|
+
/** An account and the addresses it controls, read but not stored. */
|
|
251
|
+
fetchAccount(tx: CapTransaction, stakeAddress: string): Promise<FetchedAccount>;
|
|
252
|
+
/** Stores what fetchAccount read. */
|
|
253
|
+
storeAccount(tx: CapTransaction, fetched: FetchedAccount): Promise<Account>;
|
|
254
|
+
/** Account from the backend with the crawled overlays (controlled amount, withdrawals). */
|
|
255
|
+
resolveAccount(tx: CapTransaction, stakeAddress: string): Promise<AccountData>;
|
|
256
|
+
/** Index a DRep by bech32 id. */
|
|
210
257
|
indexDrep(tx: CapTransaction, drepId: string): Promise<Drep>;
|
|
211
|
-
/**
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
* @returns {Promise<Pool>} pool entity data
|
|
216
|
-
*/
|
|
258
|
+
/** A DRep row from the backend. */
|
|
259
|
+
fetchDrep(drepId: string): Promise<Drep>;
|
|
260
|
+
storeDrep(tx: CapTransaction, drepEntity: Drep): Promise<Drep>;
|
|
261
|
+
/** Index a pool by id. */
|
|
217
262
|
indexPool(tx: CapTransaction, poolId: string): Promise<Pool>;
|
|
218
|
-
/**
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
263
|
+
/** A pool row, read but not stored. */
|
|
264
|
+
fetchPool(tx: CapTransaction, poolId: string): Promise<Pool>;
|
|
265
|
+
storePool(tx: CapTransaction, poolEntity: Pool): Promise<Pool>;
|
|
266
|
+
/** Pool from the backend with crawled block counts, the snapshot's active stake and its metadata file. */
|
|
267
|
+
resolvePool(tx: CapTransaction, poolId: string): Promise<PoolData>;
|
|
268
|
+
private poolMetadataOf;
|
|
269
|
+
/** Turns the loading of pool metadata files on or off (`poolMetadataFetch`). */
|
|
270
|
+
setPoolMetadataFetch(enabled: boolean): void;
|
|
271
|
+
/** Index an asset by unit (policyId + assetNameHex). */
|
|
224
272
|
indexAsset(tx: CapTransaction, unit: string): Promise<Asset>;
|
|
225
|
-
/**
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
* @param unit asset unit (policyId + assetNameHex)
|
|
232
|
-
* @param limit max number of recent events to fetch (default 100)
|
|
233
|
-
* @returns {Promise<AssetHistory[]>} list of mint/burn event entity rows
|
|
234
|
-
*/
|
|
273
|
+
/** Stores an asset read with resolveAssetInfo. */
|
|
274
|
+
storeAsset(tx: CapTransaction, assetInfo: AssetInfo): Promise<Asset>;
|
|
275
|
+
/** Like indexAsset, but always from the backend: the crawled chain has no CIP-26 registry fields. */
|
|
276
|
+
indexAssetFromBackend(tx: CapTransaction, unit: string): Promise<Asset>;
|
|
277
|
+
private writeAsset;
|
|
278
|
+
/** Always fresh. Rows are keyed by unit and tx, so older cached entries persist. */
|
|
235
279
|
indexAssetHistory(tx: CapTransaction, unit: string, limit?: number): Promise<AssetHistory[]>;
|
|
236
|
-
/**
|
|
237
|
-
* Common method: build a transaction, persist build result with inputs/outputs/address associations.
|
|
238
|
-
* All four public indexBuild*Result methods delegate to this to eliminate duplication.
|
|
239
|
-
* @param tx CAP transaction object
|
|
240
|
-
* @param buildreq transaction build request data
|
|
241
|
-
* @param buildFn the specific builder method to call
|
|
242
|
-
* @returns {Promise<TransactionBuild>} transaction build entity data
|
|
243
|
-
*/
|
|
280
|
+
/** Build a transaction and persist the build result with inputs/outputs/address association. */
|
|
244
281
|
private _indexBuildResult;
|
|
245
282
|
indexSimpleBuildResult(tx: CapTransaction, buildreq: TxBuildRequest): Promise<TransactionBuild>;
|
|
246
283
|
indexMetadataBuildResult(tx: CapTransaction, buildreq: TxBuildRequest): Promise<TransactionBuild>;
|
|
247
284
|
indexMultiAssetBuildResult(tx: CapTransaction, buildreq: TxBuildRequest): Promise<TransactionBuild>;
|
|
248
285
|
indexMintBuildResult(tx: CapTransaction, buildreq: TxBuildRequest): Promise<TransactionBuild>;
|
|
249
286
|
indexPlutusSpendBuildResult(tx: CapTransaction, buildreq: TxBuildRequest): Promise<TransactionBuild>;
|
|
250
|
-
/**
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
* @returns {Promise<LedgerProtocolParameter>} protocol parameters entity data
|
|
254
|
-
*/
|
|
287
|
+
/** BuildPlutusTransaction: several script inputs; the redeemers are stored with the build. */
|
|
288
|
+
indexPlutusBuildResult(tx: CapTransaction, buildreq: TxBuildPlutusRequest): Promise<TransactionBuild>;
|
|
289
|
+
/** Protocol parameters, served from the DB row within a 5-minute TTL. */
|
|
255
290
|
indexProtocolParameters(tx: CapTransaction): Promise<LedgerProtocolParameter>;
|
|
256
|
-
/**
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
* @returns {Promise<TransactionSubmission>} persisted transaction submission entity
|
|
262
|
-
*/
|
|
291
|
+
/** The stored row within its TTL, else the parameters from the backend. Nothing is written. */
|
|
292
|
+
fetchProtocolParameters(tx: CapTransaction): Promise<FetchedProtocolParameters>;
|
|
293
|
+
/** Stores parameters that came from the backend and restarts their TTL. */
|
|
294
|
+
storeProtocolParameters(tx: CapTransaction, fetched: FetchedProtocolParameters): Promise<LedgerProtocolParameter>;
|
|
295
|
+
/** Persist a transaction submission and flag the build as submitted when linked. */
|
|
263
296
|
persistTransactionSubmission(tx: CapTransaction, params: {
|
|
264
297
|
signedTxCbor: string;
|
|
265
298
|
txHash: string;
|
|
266
299
|
buildId?: string | null;
|
|
300
|
+
status?: 'pending' | 'submitted';
|
|
267
301
|
}): Promise<TransactionSubmission>;
|
|
268
|
-
/**
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
* @param status new status value
|
|
274
|
-
* @param errorMessage optional error message for failed status
|
|
275
|
-
*/
|
|
276
|
-
updateSubmissionStatus(tx: CapTransaction, submissionId: string, status: string, errorMessage?: string): Promise<void>;
|
|
277
|
-
/**
|
|
278
|
-
* Persist a new signing request
|
|
279
|
-
* @param tx CAP transaction object
|
|
280
|
-
* @param params signing request parameters from external signer module
|
|
281
|
-
* @returns persisted signing request record
|
|
282
|
-
*/
|
|
302
|
+
/** Update a submission's status. With onlyFrom the row changes only while it has that status. */
|
|
303
|
+
updateSubmissionStatus(tx: CapTransaction, submissionId: string, status: TransactionSubmission['status'], errorMessage?: string, onlyFrom?: TransactionSubmission['status']): Promise<void>;
|
|
304
|
+
/** Deletes a resubmit's row when the transaction already has a submitted or confirmed row. */
|
|
305
|
+
dropDuplicateSubmission(tx: CapTransaction, submissionId: string, txHash: string): Promise<boolean>;
|
|
306
|
+
/** Persist a new signing request and link it to the build's sender address. */
|
|
283
307
|
persistSigningRequest(tx: CapTransaction, params: {
|
|
284
308
|
buildId: string;
|
|
285
309
|
signingPayload: {
|
|
@@ -308,13 +332,7 @@ export declare class CardanoIndexer {
|
|
|
308
332
|
cardanoCliCommand: string | undefined;
|
|
309
333
|
cip30TxCbor: string | undefined;
|
|
310
334
|
}>;
|
|
311
|
-
/**
|
|
312
|
-
* Persist a signature verification with signing request status update
|
|
313
|
-
* Handles: SignatureVerification insert, SigningRequest status update
|
|
314
|
-
* @param tx CAP transaction object
|
|
315
|
-
* @param params verification parameters
|
|
316
|
-
* @returns persisted signature verification record
|
|
317
|
-
*/
|
|
335
|
+
/** Persist a signature verification and update the signing request status. */
|
|
318
336
|
persistSignatureVerification(tx: CapTransaction, params: {
|
|
319
337
|
signingRequestId: string;
|
|
320
338
|
signedTxCbor: string;
|
|
@@ -340,13 +358,7 @@ export declare class CardanoIndexer {
|
|
|
340
358
|
warnings: string;
|
|
341
359
|
verifiedAt: string;
|
|
342
360
|
}>;
|
|
343
|
-
/**
|
|
344
|
-
* Index a verified transaction submission with all related records
|
|
345
|
-
* Handles persistence of: SignatureVerification, TransactionSubmission, SigningRequest update, Build update
|
|
346
|
-
* @param tx CAP transaction object
|
|
347
|
-
* @param params submission parameters
|
|
348
|
-
* @returns {Promise<TransactionSubmission>} transaction submission entity data
|
|
349
|
-
*/
|
|
361
|
+
/** Persist a verified submission: verification, submission, signing request and build updates. */
|
|
350
362
|
indexVerifiedTransactionSubmission(tx: CapTransaction, params: {
|
|
351
363
|
signingRequestId: string;
|
|
352
364
|
buildId: string;
|
|
@@ -361,38 +373,27 @@ export declare class CardanoIndexer {
|
|
|
361
373
|
signerType?: string;
|
|
362
374
|
signerInfo?: string;
|
|
363
375
|
}): Promise<TransactionSubmission>;
|
|
364
|
-
/**
|
|
365
|
-
* Index & return the latest epoch information data
|
|
366
|
-
* @param tx CAP transaction object
|
|
367
|
-
* @returns {Promise<Epoch>} epoch entity data
|
|
368
|
-
*/
|
|
376
|
+
/** Index the latest epoch. */
|
|
369
377
|
indexLatestEpoch(tx: CapTransaction): Promise<Epoch>;
|
|
370
|
-
/**
|
|
371
|
-
* Index & return the latest block information data
|
|
372
|
-
* @param tx CAP transaction object
|
|
373
|
-
* @returns {Promise<Block>} block entity data
|
|
374
|
-
*/
|
|
378
|
+
/** Index the latest block, with best-effort epoch enrichment. */
|
|
375
379
|
indexLatestBlock(tx: CapTransaction): Promise<Block>;
|
|
376
380
|
/** Max addresses to index concurrently (avoid overloading backends) */
|
|
377
381
|
private static readonly ADDR_CONCURRENCY;
|
|
378
|
-
/**
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
*/
|
|
382
|
+
/** Block position of a transaction already in the local index (crawled or cached), or null. */
|
|
383
|
+
findIndexedTransaction(tx: CapTransaction, txHash: string): Promise<{
|
|
384
|
+
slot: number | null;
|
|
385
|
+
blockHeight: number | null;
|
|
386
|
+
blockHash: string | null;
|
|
387
|
+
} | null>;
|
|
388
|
+
resolveTransactionConfirmations(tx: CapTransaction, txHash: string): Promise<TransactionConfirmations>;
|
|
389
|
+
/** Height of a transaction in a crawled block and the crawler's tip; null when the crawl does not hold it. */
|
|
390
|
+
private crawledTransactionDepth;
|
|
391
|
+
/** Batch-fetches the missing ones, stores them and returns only those. */
|
|
389
392
|
ensureTransactionsIndexed(tx: CapTransaction, txHashes: string[]): Promise<Map<string, ProviderTransaction>>;
|
|
390
|
-
/**
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
*/
|
|
396
|
-
private _ensureAddresses;
|
|
393
|
+
/** The hashes among the given ones that have no stored transaction. */
|
|
394
|
+
private unstoredTransactionHashes;
|
|
395
|
+
/** Stores transactions read from a backend, each with its inputs, outputs and metadata. */
|
|
396
|
+
private storeTransactions;
|
|
397
|
+
private fetchAddresses;
|
|
397
398
|
}
|
|
398
399
|
//# sourceMappingURL=cardano-indexer.d.ts.map
|