@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,205 +1,140 @@
|
|
|
1
|
-
import { CardanoBackend, PaginatingBackend } from './cardano-backend';
|
|
2
|
-
import { Transaction, BlockData, Address, UTxO, NetworkInformation, EpochData, MetadataLabelTx, PoolData, DrepData, AccountData, AssetInfo, AssetHistoryEntry, LedgerProtocolParameters } from '../../utils/types';
|
|
1
|
+
import { CardanoBackend, PaginatingBackend, EnumeratingBackend, TokenRegistryBackend } from './cardano-backend';
|
|
2
|
+
import { Transaction, BlockData, Address, UTxO, NetworkInformation, EpochData, MetadataLabelTx, PoolData, DrepData, AccountData, AssetInfo, AssetHistoryEntry, LedgerProtocolParameters, TxCertificate } from '../../utils/types';
|
|
3
3
|
import { Network } from '../cardano-client';
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
/** Shape of a Koios tx-in/tx-out row from /tx_info */
|
|
5
|
+
interface KoiosTxIO {
|
|
6
|
+
address?: string;
|
|
7
|
+
payment_addr?: {
|
|
8
|
+
bech32?: string;
|
|
9
|
+
};
|
|
10
|
+
tx_hash: string;
|
|
11
|
+
tx_index: number;
|
|
12
|
+
value: string;
|
|
13
|
+
datum_hash?: string | null;
|
|
14
|
+
inline_datum?: unknown;
|
|
15
|
+
reference_script?: unknown;
|
|
16
|
+
asset_list?: Array<{
|
|
17
|
+
policy_id: string;
|
|
18
|
+
asset_name: string;
|
|
19
|
+
quantity: string;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
/** Shape of a Koios /tx_info response row */
|
|
23
|
+
interface KoiosTxInfo {
|
|
24
|
+
tx_hash: string;
|
|
25
|
+
block_hash: string;
|
|
26
|
+
block_height: number | string;
|
|
27
|
+
tx_timestamp?: number;
|
|
28
|
+
block_time?: number;
|
|
29
|
+
absolute_slot?: number;
|
|
30
|
+
slot_no?: number;
|
|
31
|
+
tx_block_index?: number;
|
|
32
|
+
fee?: string;
|
|
33
|
+
deposit?: string;
|
|
34
|
+
tx_size: number;
|
|
35
|
+
metadata?: Record<string, unknown> | null;
|
|
36
|
+
inputs: KoiosTxIO[];
|
|
37
|
+
outputs: KoiosTxIO[];
|
|
38
|
+
/** False when the script phase failed (collateral consumed, regular ins/outs not applied). Absent on older Koios. */
|
|
39
|
+
valid_contract?: boolean | null;
|
|
40
|
+
collateral_inputs?: KoiosTxIO[] | null;
|
|
41
|
+
/** Live Koios returns ONE object here (the spec says array); both shapes are accepted. */
|
|
42
|
+
collateral_output?: KoiosTxIO | KoiosTxIO[] | null;
|
|
43
|
+
reference_inputs?: KoiosTxIO[] | null;
|
|
44
|
+
/** Net mint per asset with `_assets: true`. A negative quantity is a burn. Older Koios omits it. */
|
|
45
|
+
assets_minted?: Array<{
|
|
46
|
+
policy_id?: string;
|
|
47
|
+
asset_name?: string | null;
|
|
48
|
+
quantity?: string | number;
|
|
49
|
+
}> | null;
|
|
50
|
+
/** `_withdrawals: true` only (crawler batch path); null/absent otherwise. */
|
|
51
|
+
withdrawals?: Array<{
|
|
52
|
+
amount?: string | number;
|
|
53
|
+
stake_addr?: string;
|
|
54
|
+
}> | null;
|
|
55
|
+
/** Only with `_certs: true`. `type` uses Koios names such as pool_delegation. */
|
|
56
|
+
certificates?: Array<{
|
|
57
|
+
index?: number | null;
|
|
58
|
+
type?: string;
|
|
59
|
+
info?: Record<string, unknown> | null;
|
|
60
|
+
}> | null;
|
|
61
|
+
}
|
|
62
|
+
/** CardanoBackend implementation on the Koios REST API (Axios). */
|
|
63
|
+
export declare class KoiosBackend implements CardanoBackend, PaginatingBackend, EnumeratingBackend, TokenRegistryBackend {
|
|
9
64
|
readonly name = "koios";
|
|
10
65
|
private api;
|
|
11
66
|
private network;
|
|
12
|
-
/**
|
|
13
|
-
* Constructor
|
|
14
|
-
*/
|
|
15
67
|
constructor(network: Network, timeoutMs: number, apiKey?: string);
|
|
16
|
-
/**
|
|
17
|
-
* Initialize the backend
|
|
18
|
-
*/
|
|
68
|
+
/** Probe /tip to verify connectivity. */
|
|
19
69
|
init(): Promise<boolean>;
|
|
20
|
-
/**
|
|
21
|
-
* Retry a Koios API call up to 3 times with exponential backoff if the
|
|
22
|
-
* result is an empty array. Koios sometimes returns [] transiently for
|
|
23
|
-
* valid queries — a single retry is not always sufficient for historical
|
|
24
|
-
* epoch lookups, so we retry with increasing delays (500 → 1000 → 2000 ms).
|
|
25
|
-
*/
|
|
70
|
+
/** Retry with backoff when Koios briefly returns [] for a valid query. */
|
|
26
71
|
private fetchWithRetryOnEmpty;
|
|
27
|
-
/**
|
|
28
|
-
* Koios runs several load-balanced grest instances and they are occasionally
|
|
29
|
-
* version-skewed: some return HTTP 400 with Postgres error 42804 ("structure
|
|
30
|
-
* of query does not match function result type", e.g. `out_sum_lovelace`
|
|
31
|
-
* word128 vs numeric on /epoch_info) while healthy instances serve the
|
|
32
|
-
* IDENTICAL request fine. The same request therefore flips 200/400 between
|
|
33
|
-
* calls. Retrying a few times lands on a healthy instance. Scoped strictly to
|
|
34
|
-
* the 42804 type-skew error so genuine 400s (bad params) still fail fast.
|
|
35
|
-
*/
|
|
36
72
|
private getWithRetryOn42804;
|
|
37
|
-
/**
|
|
38
|
-
* Get Transaction Data for specified transaction hash
|
|
39
|
-
* @param hash transaction hash (hex)
|
|
40
|
-
* @returns {Promise<Transaction>} transaction data
|
|
41
|
-
*/
|
|
42
73
|
getTransaction(hash: string): Promise<Transaction>;
|
|
43
|
-
/**
|
|
44
|
-
* Get Block Data for specified block hash
|
|
45
|
-
* @param blockHash block hash (hex)
|
|
46
|
-
* @returns {Promise<BlockData>} block data
|
|
47
|
-
*/
|
|
48
74
|
getBlock(blockHash: string): Promise<BlockData>;
|
|
49
|
-
/**
|
|
50
|
-
* Get Epoch Data for specified epoch number
|
|
51
|
-
* @param epochNumber epoch number
|
|
52
|
-
* @returns {Promise<EpochData>} epoch data
|
|
53
|
-
*/
|
|
54
75
|
getEpoch(epochNumber: number): Promise<EpochData>;
|
|
55
|
-
/**
|
|
56
|
-
* Get Address Data (without transactions - use getAddressTransactions() separately)
|
|
57
|
-
* @param address bech32 address
|
|
58
|
-
* @returns {Promise<Address>} address data
|
|
59
|
-
*/
|
|
76
|
+
/** Address data. Transactions come from getAddressTransactions(). */
|
|
60
77
|
getAddress(address: string): Promise<Address>;
|
|
61
|
-
/**
|
|
62
|
-
* Get Address Transactions
|
|
63
|
-
* @param address bech32 address
|
|
64
|
-
* @returns {Promise<Transaction[]>} list of transactions for this address
|
|
65
|
-
*/
|
|
66
78
|
getAddressTransactions(address: string, limit: number): Promise<Transaction[]>;
|
|
67
|
-
/**
|
|
68
|
-
* Get Address UTxOs for specified address
|
|
69
|
-
* @param address bech32 address
|
|
70
|
-
* @returns {Promise<UTxO[]>} list of UTxOs
|
|
71
|
-
*/
|
|
72
79
|
getAddressUtxos(address: string): Promise<UTxO[]>;
|
|
73
|
-
/**
|
|
74
|
-
* Get UTxOs by payment credential. Returns UTxOs across all bech32 addresses
|
|
75
|
-
* sharing the given 28-byte payment credential (key hash or script hash).
|
|
76
|
-
* Native Koios endpoint — single round-trip with inline-datum hydration.
|
|
77
|
-
* @param credHash 28-byte payment credential as 56-char lowercase hex
|
|
78
|
-
* @returns {Promise<UTxO[]>} list of UTxOs across all bech32 forms
|
|
79
|
-
*/
|
|
80
|
+
/** UTxOs of every address with this payment credential (56 hex chars). */
|
|
80
81
|
getCredentialUtxos(credHash: string): Promise<UTxO[]>;
|
|
81
|
-
/**
|
|
82
|
-
* Get Network Information
|
|
83
|
-
* @returns {Promise<Network>} network information
|
|
84
|
-
*/
|
|
85
82
|
getNetworkInformation(): Promise<NetworkInformation>;
|
|
86
|
-
/**
|
|
87
|
-
* Get Transaction Metadata for specified transaction hash
|
|
88
|
-
* @param tx_hash transaction hash (hex)
|
|
89
|
-
* @returns {Promise<MetadataLabelTx[]>} transaction metadata list
|
|
90
|
-
*/
|
|
91
83
|
getTransactionMetadata(tx_hash: string): Promise<MetadataLabelTx[]>;
|
|
92
|
-
/**
|
|
93
|
-
* Get Pool Data for specified pool id
|
|
94
|
-
* @param poolId pool id
|
|
95
|
-
* @returns {Promise<PoolData>} pool data
|
|
96
|
-
*/
|
|
97
84
|
getPool(poolId: string): Promise<PoolData>;
|
|
98
|
-
/**
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
* minting tx + creation_time, and both on-chain and registry metadata.
|
|
102
|
-
* @param unit policyId + assetNameHex (concatenated hex)
|
|
103
|
-
* @returns {Promise<AssetInfo>} canonical asset info
|
|
104
|
-
*/
|
|
85
|
+
/** Map one Koios /pool_info row to the canonical PoolData. */
|
|
86
|
+
private _mapKoiosPool;
|
|
87
|
+
/** Asset info from Koios `asset_info`. */
|
|
105
88
|
getAssetInfo(unit: string): Promise<AssetInfo>;
|
|
106
|
-
/**
|
|
107
|
-
* Get latest mint/burn events for an asset.
|
|
108
|
-
* Koios's `asset_history` returns minting_txs[{ tx_hash, block_time, quantity }]
|
|
109
|
-
* with `quantity` SIGNED (negative = burn). Action is derived from sign;
|
|
110
|
-
* the canonical `quantity` field stores absolute value.
|
|
111
|
-
* @param unit policyId + assetNameHex (concatenated hex)
|
|
112
|
-
* @param limit max number of events (default 100). Note: Koios returns ALL events;
|
|
113
|
-
* limit is applied client-side after sort-by-block_time desc.
|
|
114
|
-
* @returns {Promise<AssetHistoryEntry[]>} list of mint/burn events (most recent first)
|
|
115
|
-
*/
|
|
116
89
|
getAssetHistory(unit: string, limit?: number): Promise<AssetHistoryEntry[]>;
|
|
117
|
-
/**
|
|
118
|
-
* Get Drep Data for specified drep id
|
|
119
|
-
* @param drepId drep id
|
|
120
|
-
* @returns {Promise<DrepData>} drep data
|
|
121
|
-
*/
|
|
122
90
|
getDrep(drepId: string): Promise<DrepData>;
|
|
123
|
-
/**
|
|
124
|
-
|
|
125
|
-
* @param accountId account id
|
|
126
|
-
* @returns {Promise<AccountData>} account data
|
|
127
|
-
*/
|
|
91
|
+
/** Map one Koios /drep_info row to the canonical DrepData. */
|
|
92
|
+
private _mapKoiosDrep;
|
|
128
93
|
getAccount(accountId: string): Promise<AccountData>;
|
|
129
|
-
/**
|
|
130
|
-
* Submit Transaction
|
|
131
|
-
* @param signedTxCbor signed transaction in CBOR hex format
|
|
132
|
-
* @returns {Promise<string>} transaction hash
|
|
133
|
-
*/
|
|
134
94
|
submitTransaction(signedTxCbor: string): Promise<string>;
|
|
135
|
-
/**
|
|
136
|
-
* Get Protocol Parameters
|
|
137
|
-
* @returns {Promise<any>} protocol parameters
|
|
138
|
-
*/
|
|
139
95
|
getProtocolParameters(): Promise<LedgerProtocolParameters>;
|
|
140
|
-
/**
|
|
141
|
-
* Get Latest Block Data
|
|
142
|
-
* @returns {Promise<BlockData>} latest block data
|
|
143
|
-
*/
|
|
144
96
|
getLatestBlock(): Promise<BlockData>;
|
|
145
|
-
/**
|
|
146
|
-
* Get Latest Epoch Data
|
|
147
|
-
* @returns {Promise<EpochData>} latest epoch data
|
|
148
|
-
*/
|
|
149
97
|
getLatestEpoch(): Promise<EpochData>;
|
|
150
|
-
/**
|
|
151
|
-
* Get the latest chain tip slot.
|
|
152
|
-
* @returns {Promise<number>} current chain slot
|
|
153
|
-
*/
|
|
154
98
|
getCurrentSlot(): Promise<number>;
|
|
155
|
-
/**
|
|
156
|
-
* Check whether a UTxO is still unspent via Koios `POST /utxo_info`.
|
|
157
|
-
* @param txHash 64-char lowercase hex
|
|
158
|
-
* @param outputIndex non-negative integer
|
|
159
|
-
* @returns {Promise<boolean>} true iff the UTxO exists and is unspent
|
|
160
|
-
*/
|
|
99
|
+
/** Whether a UTxO exists and is unspent, via Koios `POST /utxo_info`. */
|
|
161
100
|
isUtxoUnspent(txHash: string, outputIndex: number): Promise<boolean>;
|
|
162
|
-
/**
|
|
163
|
-
* Get transaction hashes for an address (lightweight — no full tx details).
|
|
164
|
-
* @param address bech32 address
|
|
165
|
-
* @param limit maximum number of hashes
|
|
166
|
-
* @returns {Promise<string[]>} most recent tx hashes
|
|
167
|
-
*/
|
|
101
|
+
/** Most recent tx hashes of an address, without tx details. */
|
|
168
102
|
getAddressTransactionHashes(address: string, limit: number): Promise<string[]>;
|
|
169
|
-
/**
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
103
|
+
/** crawler.certificates: ask /tx_info for certificates + withdrawals on the crawl's batch call. */
|
|
104
|
+
private crawlCertificates;
|
|
105
|
+
configureCrawl(options: {
|
|
106
|
+
certificates: boolean;
|
|
107
|
+
}): void;
|
|
108
|
+
/** Batch fetch transactions via POST /tx_info, chunked at 100 hashes (Koios limit). */
|
|
175
109
|
getTransactionsBatch(txHashes: string[]): Promise<Map<string, Transaction>>;
|
|
176
|
-
/**
|
|
177
|
-
* Map a Koios /block_info response object to our BlockData (same shape getBlock
|
|
178
|
-
* maps inline; kept private to avoid touching getBlock).
|
|
179
|
-
*/
|
|
110
|
+
/** Map a Koios /block_info row to BlockData. */
|
|
180
111
|
private mapKoiosBlockInfo;
|
|
181
|
-
/**
|
|
182
|
-
* Get a block by its height via the PostgREST-filtered /blocks list, then resolve
|
|
183
|
-
* full data through /block_info.
|
|
184
|
-
*/
|
|
112
|
+
/** Finds the block in the filtered /blocks list, then reads it from /block_info. */
|
|
185
113
|
getBlockByHeight(height: number): Promise<BlockData>;
|
|
186
|
-
/**
|
|
187
|
-
* Get up to `count` blocks following `afterHash`, in ascending chain order.
|
|
188
|
-
* Koios has no "next after hash" endpoint, so we list blocks above the anchor height
|
|
189
|
-
* (PostgREST gt + order + limit), then batch /block_info. When the caller already
|
|
190
|
-
* knows the anchor height (the crawler's cursor), the hash→height resolution
|
|
191
|
-
* round-trip is skipped entirely.
|
|
192
|
-
*/
|
|
193
114
|
getNextBlocks(afterHash: string, count: number, afterHeight?: number): Promise<BlockData[]>;
|
|
194
|
-
/**
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
115
|
+
/** Rows per page when listing ids (PostgREST caps a response at 1000 rows). */
|
|
116
|
+
private static readonly LIST_PAGE_SIZE;
|
|
117
|
+
/** Ids resolved per /pool_info / /drep_info request. */
|
|
118
|
+
private static readonly INFO_BATCH_SIZE;
|
|
119
|
+
/** Page cap. 500 pages hold 500 000 ids, far beyond any real pool or DRep set. */
|
|
120
|
+
private static readonly LIST_MAX_PAGES;
|
|
121
|
+
/** Pages through a PostgREST list endpoint for one id column. Stops on the first short page. */
|
|
122
|
+
private listAllIds;
|
|
123
|
+
/** Units with a CIP-26 registry entry, from `asset_token_registry` (the whole registry, paged). */
|
|
124
|
+
getTokenRegistryUnits(): Promise<string[]>;
|
|
125
|
+
/** All pool ids, including retired ones, so a snapshot does not drop retiring pools. */
|
|
126
|
+
getPoolIds(): Promise<string[]>;
|
|
127
|
+
/** Resolve pool ids in batches. Ids Koios does not return are omitted, never filled with empty rows. */
|
|
128
|
+
getPools(poolIds: string[]): Promise<PoolData[]>;
|
|
129
|
+
/** All DRep ids known to Koios (bech32). */
|
|
130
|
+
getDrepIds(): Promise<string[]>;
|
|
131
|
+
/** Resolve DRep ids in batches; unknown ids are omitted (see getPools). */
|
|
132
|
+
getDreps(drepIds: string[]): Promise<DrepData[]>;
|
|
133
|
+
/** All transactions of a block in order. /block_txs may answer flat rows or one `tx_hashes` array. */
|
|
199
134
|
getBlockTransactions(blockHash: string): Promise<Transaction[]>;
|
|
200
|
-
/**
|
|
201
|
-
* Map a Koios /tx_info response object to the normalized Transaction type.
|
|
202
|
-
*/
|
|
135
|
+
/** Map a Koios /tx_info row to the normalized Transaction (ledger view, see ledgerView). */
|
|
203
136
|
private _mapKoiosTx;
|
|
204
137
|
}
|
|
138
|
+
export declare function mapKoiosCertificates(certs: NonNullable<KoiosTxInfo['certificates']>): TxCertificate[];
|
|
139
|
+
export {};
|
|
205
140
|
//# sourceMappingURL=koios-backend.d.ts.map
|