@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.
- package/@cds-models/CardanoAgentService/index.d.ts +99 -51
- package/@cds-models/CardanoAgentService/index.js +15 -0
- package/@cds-models/CardanoBackendService/index.d.ts +358 -0
- package/@cds-models/CardanoBackendService/index.js +41 -0
- package/@cds-models/CardanoIndexerService/index.d.ts +594 -11
- package/@cds-models/CardanoIndexerService/index.js +74 -0
- package/@cds-models/CardanoODataService/index.d.ts +417 -57
- package/@cds-models/CardanoODataService/index.js +42 -0
- package/@cds-models/CardanoSignService/index.d.ts +45 -19
- package/@cds-models/CardanoSignService/index.js +4 -0
- package/@cds-models/CardanoTransactionService/index.d.ts +70 -44
- package/@cds-models/CardanoTransactionService/index.js +5 -0
- package/@cds-models/CardanoWorkerService/index.d.ts +35 -22
- package/@cds-models/CardanoWorkerService/index.js +2 -0
- package/@cds-models/index.d.ts +114 -4
- package/@cds-models/index.js +20 -4
- package/@cds-models/odatano/cardano/index.d.ts +451 -32
- package/@cds-models/odatano/cardano/index.js +48 -0
- package/README.md +103 -167
- package/db/schema.cds +2455 -1705
- package/db/types.cds +456 -295
- package/package.json +41 -53
- package/scripts/deploy-schema.mjs +113 -0
- package/scripts/migrate-schema.mjs +528 -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 -137
- package/srv/blockchain/backends/blockfrost-backend.js +125 -215
- package/srv/blockchain/backends/call-signal.d.ts +7 -0
- package/srv/blockchain/backends/call-signal.js +22 -0
- package/srv/blockchain/backends/cardano-backend.d.ts +100 -189
- package/srv/blockchain/backends/cardano-backend.js +29 -5
- package/srv/blockchain/backends/koios-backend.d.ts +108 -170
- package/srv/blockchain/backends/koios-backend.js +488 -482
- package/srv/blockchain/backends/odatano-backend.d.ts +55 -0
- package/srv/blockchain/backends/odatano-backend.js +211 -0
- package/srv/blockchain/backends/ogmios-backend.d.ts +122 -190
- package/srv/blockchain/backends/ogmios-backend.js +683 -327
- 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 +71 -241
- package/srv/blockchain/cardano-client.js +354 -322
- package/srv/blockchain/cardano-indexer.d.ts +295 -283
- package/srv/blockchain/cardano-indexer.js +1690 -502
- 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 +2 -13
- package/srv/blockchain/circuit-breaker.js +11 -15
- package/srv/blockchain/crawler/account-snapshots.d.ts +29 -0
- package/srv/blockchain/crawler/account-snapshots.js +173 -0
- package/srv/blockchain/crawler/asset-decimals-backfill.d.ts +17 -0
- package/srv/blockchain/crawler/asset-decimals-backfill.js +56 -0
- package/srv/blockchain/crawler/asset-registry-backfill.d.ts +46 -0
- package/srv/blockchain/crawler/asset-registry-backfill.js +157 -0
- package/srv/blockchain/crawler/asset-slice-backfill.d.ts +35 -0
- package/srv/blockchain/crawler/asset-slice-backfill.js +149 -0
- package/srv/blockchain/crawler/certificate-backfill.d.ts +56 -0
- package/srv/blockchain/crawler/certificate-backfill.js +174 -0
- package/srv/blockchain/crawler/crawler.d.ts +125 -81
- package/srv/blockchain/crawler/crawler.js +738 -167
- package/srv/blockchain/crawler/credential-backfill.d.ts +30 -0
- package/srv/blockchain/crawler/credential-backfill.js +101 -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 +161 -0
- package/srv/blockchain/crawler/key-pages.d.ts +12 -0
- package/srv/blockchain/crawler/key-pages.js +48 -0
- package/srv/blockchain/crawler/metadata-position-backfill.d.ts +22 -0
- package/srv/blockchain/crawler/metadata-position-backfill.js +59 -0
- package/srv/blockchain/crawler/output-datum-backfill.d.ts +41 -0
- package/srv/blockchain/crawler/output-datum-backfill.js +100 -0
- package/srv/blockchain/crawler/sync-state.d.ts +31 -47
- package/srv/blockchain/crawler/sync-state.js +135 -128
- package/srv/blockchain/crawler/transaction-backfill.d.ts +46 -0
- package/srv/blockchain/crawler/transaction-backfill.js +271 -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/crawler/window-plan.d.ts +31 -0
- package/srv/blockchain/crawler/window-plan.js +59 -0
- package/srv/blockchain/ledger-state.d.ts +62 -0
- package/srv/blockchain/ledger-state.js +521 -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 +22 -131
- package/srv/blockchain/signing/failed-recheck.d.ts +17 -0
- package/srv/blockchain/signing/failed-recheck.js +135 -0
- package/srv/blockchain/signing/hsm-signer.d.ts +10 -54
- package/srv/blockchain/signing/hsm-signer.js +28 -79
- package/srv/blockchain/signing/landing-proof.d.ts +60 -0
- package/srv/blockchain/signing/landing-proof.js +224 -0
- package/srv/blockchain/signing/signature-verifier.d.ts +9 -47
- package/srv/blockchain/signing/signature-verifier.js +71 -87
- package/srv/blockchain/signing/submission-finalizer.d.ts +37 -45
- package/srv/blockchain/signing/submission-finalizer.js +280 -86
- package/srv/blockchain/stored-chain.d.ts +19 -0
- package/srv/blockchain/stored-chain.js +258 -0
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts +31 -229
- package/srv/blockchain/transaction-building/buildooor-tx.js +663 -421
- package/srv/blockchain/transaction-building/cardano-tx.d.ts +9 -37
- package/srv/blockchain/transaction-presence.d.ts +12 -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 +8 -23
- package/srv/blockchain/wallet-worker/build-request.js +40 -353
- package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +27 -47
- package/srv/blockchain/wallet-worker/confirmation-tracker.js +158 -61
- package/srv/blockchain/wallet-worker/index.d.ts +1 -1
- package/srv/blockchain/wallet-worker/index.js +3 -11
- package/srv/blockchain/wallet-worker/invalidation.d.ts +35 -0
- package/srv/blockchain/wallet-worker/invalidation.js +128 -0
- package/srv/blockchain/wallet-worker/job-store.d.ts +58 -150
- package/srv/blockchain/wallet-worker/job-store.js +200 -273
- 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 +29 -82
- package/srv/blockchain/wallet-worker/wallet-worker.js +334 -198
- package/srv/cardano-agent-service.cds +122 -84
- package/srv/cardano-agent-service.js +12 -9
- package/srv/cardano-backend-service.cds +81 -0
- package/srv/cardano-backend-service.d.ts +2 -0
- package/srv/cardano-backend-service.js +259 -0
- package/srv/cardano-indexer-service.cds +393 -18
- package/srv/cardano-indexer-service.d.ts +5 -1
- package/srv/cardano-indexer-service.js +477 -16
- package/srv/cardano-service.cds +426 -269
- package/srv/cardano-service.js +640 -217
- package/srv/cardano-sign-service.cds +211 -180
- package/srv/cardano-sign-service.js +210 -287
- package/srv/cardano-tx-service.cds +462 -370
- package/srv/cardano-tx-service.js +283 -800
- package/srv/cardano-ui.cds +16 -16
- package/srv/cardano-worker-service.cds +141 -125
- package/srv/cardano-worker-service.js +104 -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 +117 -0
- package/srv/config.js +419 -0
- package/srv/server.d.ts +15 -110
- package/srv/server.js +83 -405
- package/srv/utils/agent-access.d.ts +11 -0
- package/srv/utils/agent-access.js +86 -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 -237
- package/srv/utils/agent-token-auth.d.ts +4 -99
- package/srv/utils/agent-token-auth.js +62 -186
- package/srv/utils/backend-request-handler.d.ts +3 -17
- package/srv/utils/backend-request-handler.js +3 -18
- package/srv/utils/build-request.d.ts +52 -0
- package/srv/utils/build-request.js +487 -0
- package/srv/utils/collections.d.ts +4 -10
- package/srv/utils/collections.js +14 -10
- package/srv/utils/const.d.ts +32 -75
- package/srv/utils/const.js +40 -80
- package/srv/utils/crypto.d.ts +3 -12
- package/srv/utils/crypto.js +11 -25
- package/srv/utils/db-indexes.d.ts +31 -0
- package/srv/utils/db-indexes.js +185 -0
- package/srv/utils/db-kind.d.ts +23 -0
- package/srv/utils/db-kind.js +42 -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/detached-run.d.ts +41 -0
- package/srv/utils/detached-run.js +101 -0
- package/srv/utils/epoch-slots.d.ts +14 -0
- package/srv/utils/epoch-slots.js +45 -0
- package/srv/utils/error-codes.d.ts +26 -75
- package/srv/utils/error-codes.js +27 -72
- package/srv/utils/errors.d.ts +55 -187
- package/srv/utils/errors.js +161 -235
- package/srv/utils/lease.d.ts +20 -0
- package/srv/utils/lease.js +62 -0
- package/srv/utils/liveness.d.ts +12 -0
- package/srv/utils/liveness.js +35 -0
- package/srv/utils/mappers.d.ts +111 -223
- package/srv/utils/mappers.js +432 -371
- package/srv/utils/navigation.d.ts +17 -0
- package/srv/utils/navigation.js +52 -0
- package/srv/utils/network-context.d.ts +0 -1
- package/srv/utils/network-context.js +9 -15
- 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/resolution.d.ts +13 -0
- package/srv/utils/resolution.js +47 -0
- package/srv/utils/result-numbers.d.ts +15 -0
- package/srv/utils/result-numbers.js +61 -0
- package/srv/utils/row-values.d.ts +7 -0
- package/srv/utils/row-values.js +27 -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 +25 -105
- package/srv/utils/tx-build-helper.js +108 -156
- 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 +294 -232
- package/srv/utils/types.js +2 -22
- package/srv/utils/validators.d.ts +22 -92
- package/srv/utils/validators.js +60 -170
|
@@ -1,285 +1,321 @@
|
|
|
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
|
+
}
|
|
25
|
+
/** `Accounts.addressList`: the addresses under a stake key, unique and sorted. */
|
|
26
|
+
export type AccountAddressList = string[];
|
|
27
|
+
/** The address list of an account as stored: unique and sorted. */
|
|
28
|
+
export declare function accountAddressList(addresses: readonly string[]): AccountAddressList;
|
|
29
|
+
/** Reads `Accounts.addressList`; null when the column is empty or not a list of addresses. */
|
|
30
|
+
export declare function parseAccountAddressList(json: unknown): AccountAddressList | null;
|
|
31
|
+
/** A block as read; `epoch` is missing when the backend has no data for its epoch. */
|
|
32
|
+
export interface FetchedBlock {
|
|
33
|
+
block: BlockData;
|
|
34
|
+
epoch?: Epoch;
|
|
35
|
+
}
|
|
36
|
+
/** Metadata of a transaction as the backend reports it. */
|
|
37
|
+
export interface FetchedTransactionMetadata {
|
|
38
|
+
txHash: string;
|
|
39
|
+
metadata: Awaited<ReturnType<CardanoClient['getTransactionMetadata']>>;
|
|
40
|
+
}
|
|
41
|
+
/** Progress of backfillEpochs. */
|
|
42
|
+
export interface EpochBackfillProgress {
|
|
43
|
+
atEpoch: number;
|
|
44
|
+
toEpoch: number;
|
|
45
|
+
updated: number;
|
|
46
|
+
created: number;
|
|
47
|
+
}
|
|
48
|
+
/** Protocol parameters; `fresh` is false when the stored row was still current. */
|
|
49
|
+
export interface FetchedProtocolParameters {
|
|
50
|
+
row: LedgerProtocolParameter;
|
|
51
|
+
fresh: boolean;
|
|
52
|
+
}
|
|
53
|
+
/** Fetches chain data, maps it to entity rows and UPSERTs them in the caller's transaction. */
|
|
21
54
|
export declare class CardanoIndexer {
|
|
22
55
|
private client;
|
|
23
56
|
private txBuilder;
|
|
24
57
|
private lastParamsFetchTime;
|
|
25
58
|
private static readonly CRAWL_EPOCH_REFRESH_MS;
|
|
26
59
|
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
60
|
private crawlEpochCache;
|
|
38
61
|
private crawlEpochCurrent;
|
|
62
|
+
/** Committed epoch rows and the final flag they were written with; a refresh creates a new row object. */
|
|
63
|
+
private crawlEpochWritten;
|
|
64
|
+
/** Memo updates of the running block transaction, applied only after its commit. */
|
|
65
|
+
private pendingCommit;
|
|
39
66
|
private crawlEpochPrevious;
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
67
|
+
/** Analytics coverage of the crawl path; defaults mirror the crawler config defaults. */
|
|
68
|
+
private crawlAssetHistory;
|
|
69
|
+
private crawlAssetCatalogue;
|
|
70
|
+
/** Certificates + withdrawals per block (ledger-state coverage). Opt-in. */
|
|
71
|
+
private crawlCertificates;
|
|
72
|
+
/** Logged once per process: the active source reports no certificates (Blockfrost). */
|
|
73
|
+
private certificatesUnreportedWarned;
|
|
74
|
+
/** Blocks after utxoAnchor are applied to the Ledger* tables. Without an anchor the mode is inactive. */
|
|
75
|
+
private crawlUtxoSet;
|
|
76
|
+
/** crawler.authoritative: misses in the crawled chain are 404, no provider call. */
|
|
77
|
+
private crawlAuthoritative;
|
|
78
|
+
/** crawler.inputAssetCopies: every crawled input keeps a copy of its assets and points at no output. */
|
|
79
|
+
private crawlInputAssetCopies;
|
|
80
|
+
private utxoAnchor;
|
|
81
|
+
/** `LedgerAddresses.paymentCredential` is complete; the running fill and its table generation. */
|
|
82
|
+
private credentialsReady;
|
|
83
|
+
private credentialFill;
|
|
84
|
+
private credentialGeneration;
|
|
85
|
+
/** The anchor block was found in the crawled chain (checked once, before the first apply). */
|
|
86
|
+
private utxoAnchorVerified;
|
|
87
|
+
/** Kept until the crawler confirms the block commit, so a rolled-back attempt changes nothing. */
|
|
88
|
+
private ledgerInvalidation;
|
|
89
|
+
/** Load pool metadata files from their registered URL. Off unless configured. */
|
|
90
|
+
private poolMetadataFetch;
|
|
91
|
+
private poolMetadataByHash;
|
|
92
|
+
private static readonly POOL_METADATA_MEMO_CAP;
|
|
93
|
+
/** Units known to have an `Assets` row, so a repeat sighting costs no DB round-trip. */
|
|
94
|
+
private static readonly ASSET_MEMO_CAP;
|
|
95
|
+
/** Output references per node lookup when checking crawled UTxOs. */
|
|
96
|
+
private static readonly OUTREF_CHUNK;
|
|
97
|
+
private assetMemo;
|
|
98
|
+
private static readonly ENRICH_QUEUE_CAP;
|
|
99
|
+
private enrichQueue;
|
|
100
|
+
private enrichTimer;
|
|
101
|
+
private enrichRate;
|
|
102
|
+
/** Adopt the crawler's coverage settings; the lazy request path never touches these. */
|
|
103
|
+
configureCrawlCoverage(coverage: {
|
|
104
|
+
assetHistory: boolean;
|
|
105
|
+
assetCatalogue: 'off' | 'bare' | 'enrich';
|
|
106
|
+
assetEnrichRate?: number;
|
|
107
|
+
certificates?: boolean;
|
|
108
|
+
utxoSet?: boolean;
|
|
109
|
+
authoritative?: boolean;
|
|
110
|
+
inputAssetCopies?: boolean;
|
|
111
|
+
}): void;
|
|
112
|
+
private localCoverage;
|
|
113
|
+
private localPoolBlocks;
|
|
114
|
+
private crawlAnswers;
|
|
115
|
+
/** 404 for a lookup the crawled chain answers on its own (the caller already missed in the DB). */
|
|
116
|
+
refuseOutsideCrawl(tx: CapTransaction, method: string, what: string): Promise<void>;
|
|
117
|
+
private localAssetInfo;
|
|
118
|
+
/** Address from the crawled UTxO set when it answers, else from the backend. */
|
|
119
|
+
resolveAddress(tx: CapTransaction, addr: string): Promise<ProviderAddress>;
|
|
120
|
+
/** UTxOs of an address: the crawled set (checked unspent at the node) when it answers, else the backend. */
|
|
121
|
+
resolveAddressUtxos(tx: CapTransaction, addr: string): Promise<OdatanoUtxo[]>;
|
|
122
|
+
/** Asset from the crawled chain when it answers, else from the backend. */
|
|
123
|
+
resolveAssetInfo(tx: CapTransaction, unit: string): Promise<AssetInfo>;
|
|
124
|
+
/** Stored mint/burn rows, newest first. Null when the crawled chain does not answer for them. */
|
|
125
|
+
private crawledAssetHistory;
|
|
126
|
+
/** Mint/burn events, newest first: crawled rows when the crawled chain answers, else the backend. */
|
|
127
|
+
resolveAssetHistory(tx: CapTransaction, unit: string, limit: number): Promise<AssetHistoryEntryProviderData[]>;
|
|
128
|
+
/** UTxOs of a payment credential: the crawled set when it answers, else Koios. */
|
|
129
|
+
resolveCredentialUtxos(tx: CapTransaction, credHash: string): Promise<OdatanoUtxo[]>;
|
|
130
|
+
/** Latest transaction hashes of an address: the crawled set when it has enough, else the backend. */
|
|
131
|
+
resolveAddressTransactionHashes(tx: CapTransaction, addr: string, limit: number): Promise<string[]>;
|
|
132
|
+
/** True while the crawled UTxO set answers address queries (live crawler at the tip, set active). */
|
|
133
|
+
ledgerCoverageActive(tx: CapTransaction): Promise<boolean>;
|
|
134
|
+
private localAddress;
|
|
135
|
+
/** Addresses of a stake key in the crawled UTxO set, with their stored unspent outputs (one read for all). */
|
|
136
|
+
private ledgerAccountUtxos;
|
|
137
|
+
private localAddressTransactions;
|
|
138
|
+
/** Amount lists (lovelace + assets) of `LedgerUTxOs` rows, keyed `txHash#outputIndex`. */
|
|
139
|
+
private ledgerAmounts;
|
|
140
|
+
private snapshotActiveStake;
|
|
141
|
+
private localWithdrawalsSum;
|
|
142
|
+
/** The anchor the imported UTxO set describes (null = ledger mode inactive). */
|
|
143
|
+
setUtxoAnchor(anchor: LedgerAnchor | null): void;
|
|
144
|
+
private verifyUtxoAnchor;
|
|
145
|
+
/** Null while the mode is off, nothing is imported, or an invalidation awaits its commit. */
|
|
146
|
+
getUtxoAnchor(): LedgerAnchor | null;
|
|
147
|
+
/** Apply the memo updates of the block transaction that just committed. */
|
|
148
|
+
confirmBlockCommit(): void;
|
|
149
|
+
/** Hand out a pending invalidation (dropping the anchor) exactly once after the block commit, or null. */
|
|
150
|
+
takeLedgerInvalidation(): string | null;
|
|
151
|
+
private startAssetEnrichment;
|
|
152
|
+
/** Stop the enrichment loop and forget what is still queued (shutdown, crawler halt, mode change). */
|
|
153
|
+
stopAssetEnrichment(): void;
|
|
45
154
|
prefetchCrawlEpoch(epochNumber: number): Promise<void>;
|
|
155
|
+
/** True when the epoch has a stored row that is not final yet. Never throws. */
|
|
156
|
+
private storedOpenEpoch;
|
|
46
157
|
private refreshCrawlEpoch;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
*/
|
|
158
|
+
private crawledEpochTotals;
|
|
159
|
+
/** Epoch row with only the slot-derived bounds, for an epoch the backend cannot describe. */
|
|
160
|
+
private bareEpochRow;
|
|
161
|
+
backfillEpochs(onProgress?: (p: EpochBackfillProgress) => void, shouldStop?: () => boolean): Promise<EpochBackfillProgress>;
|
|
52
162
|
constructor(client: CardanoClient, txBuilder: CardanoTransactionBuilder);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
* @returns {Promise<CardanoTransaction>} transaction entity data
|
|
60
|
-
*/
|
|
163
|
+
private localAddressUtxos;
|
|
164
|
+
/** A transaction from the backend. 404 when the crawled chain answers for it alone. */
|
|
165
|
+
fetchTransaction(tx: CapTransaction, txHash: string): Promise<ProviderTransaction>;
|
|
166
|
+
/** All UPSERTs run in the caller's transaction, so everything persists or nothing does. */
|
|
167
|
+
storeTransaction(tx: CapTransaction, providerTx: ProviderTransaction): Promise<CardanoTransaction>;
|
|
168
|
+
/** Reads a transaction from the backend and stores it. */
|
|
61
169
|
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
|
-
|
|
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
|
-
*/
|
|
170
|
+
/** Lazy path: inputs, outputs, their assets and metadata of one transaction. */
|
|
171
|
+
private writeTransactionChildren;
|
|
172
|
+
fetchAddress(tx: CapTransaction, addr: string, prefetched?: ProviderAddress): Promise<FetchedAddress>;
|
|
173
|
+
/** Reads an address and its newest transactions, then stores them. */
|
|
174
|
+
indexAddress(tx: CapTransaction, addr: string, prefetched?: ProviderAddress): Promise<Address>;
|
|
175
|
+
/** Stores what fetchAddress read: the address, its assets, UTxOs and newest transactions. */
|
|
176
|
+
storeAddress(tx: CapTransaction, fetched: FetchedAddress): Promise<Address>;
|
|
177
|
+
/** UTxOs of a payment credential, always fresh: the crawled set when it answers, else the backend. */
|
|
178
|
+
fetchCredentialUtxos(tx: CapTransaction, credHash: string): Promise<OdatanoUtxo[]>;
|
|
179
|
+
/** Reads the UTxOs of a payment credential and stores them. */
|
|
180
|
+
indexCredentialUtxos(tx: CapTransaction, credHash: string): Promise<AddressUTxO[]>;
|
|
181
|
+
/** Stores credential UTxOs. Rows are written without a parent Addresses row. */
|
|
182
|
+
storeCredentialUtxos(tx: CapTransaction, utxos: OdatanoUtxo[]): Promise<AddressUTxO[]>;
|
|
183
|
+
private localCredentialUtxos;
|
|
184
|
+
private unspentAtNode;
|
|
185
|
+
/** Unspent `LedgerUTxOs` (+ assets) of the given addresses in the provider UTxO shape. */
|
|
186
|
+
private ledgerUtxosOf;
|
|
187
|
+
paymentCredentialsReady(): Promise<boolean>;
|
|
188
|
+
/** The ledger tables were replaced (re-import): the credential column has to be filled again. */
|
|
189
|
+
resetPaymentCredentials(): void;
|
|
190
|
+
indexAddressUtxos(tx: CapTransaction, addr: string): Promise<AddressUTxO[]>;
|
|
191
|
+
/** The UTxOs of an address from the backend. */
|
|
192
|
+
fetchAddressUtxos(addr: string): Promise<OdatanoUtxo[]>;
|
|
193
|
+
storeAddressFromUtxos(tx: CapTransaction, addr: string, utxos: OdatanoUtxo[]): Promise<Address>;
|
|
194
|
+
/** Stores the UTxOs of an address. Writes no parent Addresses row. */
|
|
195
|
+
storeAddressUtxos(tx: CapTransaction, addr: string, utxos: OdatanoUtxo[]): Promise<AddressUTxO[]>;
|
|
115
196
|
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
|
-
*/
|
|
197
|
+
/** Index address transactions (separate from indexAddress for lazy loading). */
|
|
198
|
+
indexAddressTransactions(tx: CapTransaction, addr: string, limit: number): Promise<AddressTransaction[]>;
|
|
199
|
+
fetchAddressTransactions(tx: CapTransaction, addr: string, limit: number): Promise<FetchedAddressTransactions>;
|
|
200
|
+
storeAddressTransactions(tx: CapTransaction, fetched: FetchedAddressTransactions): Promise<AddressTransaction[]>;
|
|
201
|
+
/** Link an address to a signing request for address-based queries. */
|
|
132
202
|
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
|
-
*/
|
|
203
|
+
/** Link an address to a transaction build for address-based queries. */
|
|
141
204
|
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
|
-
*/
|
|
205
|
+
/** Index the metadata rows of a transaction. */
|
|
149
206
|
indexTransactionMetadata(tx: CapTransaction, tx_hash: string): Promise<TransactionMetadata[]>;
|
|
150
|
-
/**
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
207
|
+
/** Metadata of a transaction from the backend. Null when the transaction is known to have none. */
|
|
208
|
+
fetchTransactionMetadata(tx: CapTransaction, tx_hash: string): Promise<FetchedTransactionMetadata | null>;
|
|
209
|
+
/** Stores the metadata rows of a transaction and returns them. */
|
|
210
|
+
storeTransactionMetadata(tx: CapTransaction, fetched: FetchedTransactionMetadata | null): Promise<TransactionMetadata[]>;
|
|
211
|
+
/** Index the network information; circulating supply comes from the crawled UTxO set when it is current. */
|
|
155
212
|
indexNetworkInformation(tx: CapTransaction): Promise<NetworkInformation>;
|
|
156
|
-
/**
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
213
|
+
/** The network information row, read but not stored. */
|
|
214
|
+
fetchNetworkInformation(tx: CapTransaction): Promise<NetworkInformation>;
|
|
215
|
+
storeNetworkInformation(tx: CapTransaction, netEntity: NetworkInformation): Promise<NetworkInformation>;
|
|
216
|
+
/** Network information from the backend; circulating supply from the crawled UTxO set when current. */
|
|
217
|
+
resolveNetworkInformation(tx: CapTransaction): Promise<ProviderNetworkInformation>;
|
|
218
|
+
/** Index a block by hash, with best-effort epoch enrichment. */
|
|
162
219
|
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
|
-
*/
|
|
220
|
+
/** A block and its epoch from the backend. 404 when the crawled chain answers for it alone. */
|
|
221
|
+
fetchBlock(tx: CapTransaction, blockHash: string): Promise<FetchedBlock>;
|
|
222
|
+
private withEpoch;
|
|
223
|
+
private writeCrawlEpochs;
|
|
224
|
+
/** Stores a block and, when it was read, its epoch. */
|
|
225
|
+
storeBlock(tx: CapTransaction, fetched: FetchedBlock): Promise<Block>;
|
|
182
226
|
indexBlockFull(tx: CapTransaction, blockData: BlockData, txs: ProviderTransaction[]): Promise<void>;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
private
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
227
|
+
private removeSupersededBlocks;
|
|
228
|
+
private removeStaleTxSeqs;
|
|
229
|
+
private warnIfCertificatesUnreported;
|
|
230
|
+
resolveInputs(tx: CapTransaction, txs: ProviderTransaction[], ledger?: LedgerLookup): Promise<void>;
|
|
231
|
+
private referenceStoredOutputs;
|
|
232
|
+
private applyDeposits;
|
|
233
|
+
private applyCollateralFees;
|
|
234
|
+
private buildAssetHistoryRows;
|
|
235
|
+
private ensureAssetRows;
|
|
236
|
+
private noteAssetSeen;
|
|
237
|
+
/** Forgets the epoch totals in memory. A rollback removed blocks they counted. */
|
|
238
|
+
forgetCrawlEpochs(): void;
|
|
239
|
+
reconcileRolledBackAssets(tx: CapTransaction, units: string[], forkSlot: number): Promise<void>;
|
|
240
|
+
snapshotEpoch(epoch: number, at: {
|
|
241
|
+
slot: number;
|
|
242
|
+
time: number;
|
|
243
|
+
hash?: string | null;
|
|
244
|
+
}, shouldStop?: () => boolean): Promise<{
|
|
245
|
+
pools: number;
|
|
246
|
+
dreps: number;
|
|
247
|
+
source: 'ogmios' | 'koios' | null;
|
|
248
|
+
}>;
|
|
249
|
+
private snapshotEpochFromLedger;
|
|
250
|
+
private previousLiveStake;
|
|
251
|
+
/** Crawled blocks per pool up to `slot`; null unless the crawl started at or before Shelley. */
|
|
252
|
+
private crawledBlocksByPool;
|
|
253
|
+
/** Every native-asset unit a block touches: outputs, consumed inputs and mint/burn rows. */
|
|
254
|
+
private collectBlockUnits;
|
|
255
|
+
/** Index an epoch by number. */
|
|
196
256
|
indexEpoch(tx: CapTransaction, epochNumber: number): Promise<Epoch>;
|
|
197
|
-
/**
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
*/
|
|
257
|
+
/** An epoch row from the backend. */
|
|
258
|
+
fetchEpoch(epochNumber: number): Promise<Epoch>;
|
|
259
|
+
storeEpoch(tx: CapTransaction, epochEntity: Epoch): Promise<Epoch>;
|
|
260
|
+
withFinal(epochEntity: Epoch, now?: number, crawlComplete?: boolean): Epoch;
|
|
261
|
+
/** Index an account by stake address. Its addresses are read on their own. */
|
|
203
262
|
indexAccount(tx: CapTransaction, stakeAddress: string): Promise<Account>;
|
|
204
|
-
/**
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
263
|
+
/** An account, read but not stored. */
|
|
264
|
+
fetchAccount(tx: CapTransaction, stakeAddress: string): Promise<FetchedAccount>;
|
|
265
|
+
storeAccount(tx: CapTransaction, fetched: FetchedAccount): Promise<Account>;
|
|
266
|
+
/** Account from the backend with the crawled overlays (controlled amount, withdrawals). */
|
|
267
|
+
resolveAccount(tx: CapTransaction, stakeAddress: string): Promise<AccountData>;
|
|
268
|
+
/** Index a DRep by bech32 id. */
|
|
210
269
|
indexDrep(tx: CapTransaction, drepId: string): Promise<Drep>;
|
|
211
|
-
/**
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
* @returns {Promise<Pool>} pool entity data
|
|
216
|
-
*/
|
|
270
|
+
/** A DRep row from the backend. */
|
|
271
|
+
fetchDrep(drepId: string): Promise<Drep>;
|
|
272
|
+
storeDrep(tx: CapTransaction, drepEntity: Drep): Promise<Drep>;
|
|
273
|
+
/** Index a pool by id. */
|
|
217
274
|
indexPool(tx: CapTransaction, poolId: string): Promise<Pool>;
|
|
218
|
-
/**
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
275
|
+
/** A pool row, read but not stored. */
|
|
276
|
+
fetchPool(tx: CapTransaction, poolId: string): Promise<Pool>;
|
|
277
|
+
storePool(tx: CapTransaction, poolEntity: Pool): Promise<Pool>;
|
|
278
|
+
/** Pool from the backend with crawled block counts, the snapshot's active stake and its metadata file. */
|
|
279
|
+
resolvePool(tx: CapTransaction, poolId: string): Promise<PoolData>;
|
|
280
|
+
private poolMetadataOf;
|
|
281
|
+
/** Turns the loading of pool metadata files on or off (`poolMetadataFetch`). */
|
|
282
|
+
setPoolMetadataFetch(enabled: boolean): void;
|
|
283
|
+
/** Index an asset by unit (policyId + assetNameHex). */
|
|
224
284
|
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
|
-
*/
|
|
285
|
+
/** Stores an asset read with resolveAssetInfo. */
|
|
286
|
+
storeAsset(tx: CapTransaction, assetInfo: AssetInfo): Promise<Asset>;
|
|
287
|
+
/** Like indexAsset, but always from the backend: the crawled chain has no CIP-26 registry fields. */
|
|
288
|
+
indexAssetFromBackend(tx: CapTransaction, unit: string): Promise<Asset>;
|
|
289
|
+
private writeAsset;
|
|
290
|
+
/** Always fresh. Rows are keyed by unit and tx, so older cached entries persist. */
|
|
235
291
|
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
|
-
*/
|
|
292
|
+
/** Build a transaction and persist the build result with inputs/outputs/address association. */
|
|
244
293
|
private _indexBuildResult;
|
|
245
294
|
indexSimpleBuildResult(tx: CapTransaction, buildreq: TxBuildRequest): Promise<TransactionBuild>;
|
|
246
295
|
indexMetadataBuildResult(tx: CapTransaction, buildreq: TxBuildRequest): Promise<TransactionBuild>;
|
|
247
296
|
indexMultiAssetBuildResult(tx: CapTransaction, buildreq: TxBuildRequest): Promise<TransactionBuild>;
|
|
248
297
|
indexMintBuildResult(tx: CapTransaction, buildreq: TxBuildRequest): Promise<TransactionBuild>;
|
|
249
298
|
indexPlutusSpendBuildResult(tx: CapTransaction, buildreq: TxBuildRequest): Promise<TransactionBuild>;
|
|
250
|
-
/**
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
* @returns {Promise<LedgerProtocolParameter>} protocol parameters entity data
|
|
254
|
-
*/
|
|
299
|
+
/** BuildPlutusTransaction: several script inputs; the redeemers are stored with the build. */
|
|
300
|
+
indexPlutusBuildResult(tx: CapTransaction, buildreq: TxBuildPlutusRequest): Promise<TransactionBuild>;
|
|
301
|
+
/** Protocol parameters, served from the DB row within a 5-minute TTL. */
|
|
255
302
|
indexProtocolParameters(tx: CapTransaction): Promise<LedgerProtocolParameter>;
|
|
256
|
-
/**
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
* @returns {Promise<TransactionSubmission>} persisted transaction submission entity
|
|
262
|
-
*/
|
|
303
|
+
/** The stored row within its TTL, else the parameters from the backend. Nothing is written. */
|
|
304
|
+
fetchProtocolParameters(tx: CapTransaction): Promise<FetchedProtocolParameters>;
|
|
305
|
+
/** Stores parameters that came from the backend and restarts their TTL. */
|
|
306
|
+
storeProtocolParameters(tx: CapTransaction, fetched: FetchedProtocolParameters): Promise<LedgerProtocolParameter>;
|
|
307
|
+
/** Persist a transaction submission and flag the build as submitted when linked. */
|
|
263
308
|
persistTransactionSubmission(tx: CapTransaction, params: {
|
|
264
309
|
signedTxCbor: string;
|
|
265
310
|
txHash: string;
|
|
266
311
|
buildId?: string | null;
|
|
312
|
+
status?: 'pending' | 'submitted';
|
|
267
313
|
}): 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
|
-
*/
|
|
314
|
+
/** Update a submission's status. With onlyFrom the row changes only while it has that status. */
|
|
315
|
+
updateSubmissionStatus(tx: CapTransaction, submissionId: string, status: TransactionSubmission['status'], errorMessage?: string, onlyFrom?: TransactionSubmission['status']): Promise<void>;
|
|
316
|
+
/** Deletes a resubmit's row when the transaction already has a submitted or confirmed row. */
|
|
317
|
+
dropDuplicateSubmission(tx: CapTransaction, submissionId: string, txHash: string): Promise<boolean>;
|
|
318
|
+
/** Persist a new signing request and link it to the build's sender address. */
|
|
283
319
|
persistSigningRequest(tx: CapTransaction, params: {
|
|
284
320
|
buildId: string;
|
|
285
321
|
signingPayload: {
|
|
@@ -308,13 +344,7 @@ export declare class CardanoIndexer {
|
|
|
308
344
|
cardanoCliCommand: string | undefined;
|
|
309
345
|
cip30TxCbor: string | undefined;
|
|
310
346
|
}>;
|
|
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
|
-
*/
|
|
347
|
+
/** Persist a signature verification and update the signing request status. */
|
|
318
348
|
persistSignatureVerification(tx: CapTransaction, params: {
|
|
319
349
|
signingRequestId: string;
|
|
320
350
|
signedTxCbor: string;
|
|
@@ -340,13 +370,7 @@ export declare class CardanoIndexer {
|
|
|
340
370
|
warnings: string;
|
|
341
371
|
verifiedAt: string;
|
|
342
372
|
}>;
|
|
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
|
-
*/
|
|
373
|
+
/** Persist a verified submission: verification, submission, signing request and build updates. */
|
|
350
374
|
indexVerifiedTransactionSubmission(tx: CapTransaction, params: {
|
|
351
375
|
signingRequestId: string;
|
|
352
376
|
buildId: string;
|
|
@@ -361,38 +385,26 @@ export declare class CardanoIndexer {
|
|
|
361
385
|
signerType?: string;
|
|
362
386
|
signerInfo?: string;
|
|
363
387
|
}): 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
|
-
*/
|
|
388
|
+
/** Index the latest epoch. */
|
|
369
389
|
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
|
-
*/
|
|
390
|
+
/** Index the latest block, with best-effort epoch enrichment. */
|
|
375
391
|
indexLatestBlock(tx: CapTransaction): Promise<Block>;
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
*/
|
|
392
|
+
resolveTransactionConfirmations(tx: CapTransaction, txHash: string): Promise<TransactionConfirmations>;
|
|
393
|
+
/** Height of a transaction in a crawled block and the crawler's tip; null when the crawl does not hold it. */
|
|
394
|
+
private crawledTransactionDepth;
|
|
395
|
+
findCrawledTransaction(tx: CapTransaction, txHash: string): Promise<{
|
|
396
|
+
slot: number;
|
|
397
|
+
blockHeight: number;
|
|
398
|
+
blockHash: string;
|
|
399
|
+
tipHeight: number;
|
|
400
|
+
spendsCollaterals: boolean;
|
|
401
|
+
validityKnown: boolean;
|
|
402
|
+
} | null>;
|
|
403
|
+
/** Batch-fetches the missing ones, stores them and returns only those. */
|
|
389
404
|
ensureTransactionsIndexed(tx: CapTransaction, txHashes: string[]): Promise<Map<string, ProviderTransaction>>;
|
|
390
|
-
/**
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
* @param bech32List array of bech32 addresses
|
|
395
|
-
*/
|
|
396
|
-
private _ensureAddresses;
|
|
405
|
+
/** The hashes among the given ones that have no stored transaction. */
|
|
406
|
+
private unstoredTransactionHashes;
|
|
407
|
+
/** Stores transactions read from a backend, each with its inputs, outputs and metadata. */
|
|
408
|
+
private storeTransactions;
|
|
397
409
|
}
|
|
398
410
|
//# sourceMappingURL=cardano-indexer.d.ts.map
|