@odatano/core 2.0.0-rc.3 → 2.0.0-rc.31
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 +251 -0
- package/@cds-models/CardanoAgentService/index.js +36 -0
- package/@cds-models/CardanoBackendService/index.d.ts +357 -0
- package/@cds-models/CardanoBackendService/index.js +40 -0
- package/@cds-models/CardanoIndexerService/index.d.ts +194 -2
- package/@cds-models/CardanoIndexerService/index.js +25 -0
- package/@cds-models/CardanoODataService/index.d.ts +294 -7
- package/@cds-models/CardanoODataService/index.js +33 -0
- package/@cds-models/CardanoSignService/index.d.ts +28 -3
- package/@cds-models/CardanoSignService/index.js +3 -0
- package/@cds-models/CardanoTransactionService/index.d.ts +52 -19
- package/@cds-models/CardanoTransactionService/index.js +4 -0
- package/@cds-models/index.d.ts +18 -0
- package/@cds-models/index.js +3 -0
- package/@cds-models/odatano/cardano/index.d.ts +408 -7
- package/@cds-models/odatano/cardano/index.js +42 -0
- package/README.md +64 -5
- package/db/schema.cds +677 -13
- package/db/types.cds +27 -0
- package/package.json +182 -173
- package/scripts/migrate-slot-leader.mjs +104 -0
- package/scripts/migrate-txseq.mjs +147 -0
- package/src/index.d.ts +11 -10
- package/src/index.js +28 -14
- package/src/plugin.js +39 -52
- package/srv/blockchain/backends/blockfrost-backend.d.ts +29 -131
- package/srv/blockchain/backends/blockfrost-backend.js +49 -160
- package/srv/blockchain/backends/cardano-backend.d.ts +104 -158
- package/srv/blockchain/backends/cardano-backend.js +19 -5
- package/srv/blockchain/backends/koios-backend.d.ts +126 -60
- package/srv/blockchain/backends/koios-backend.js +356 -217
- package/srv/blockchain/backends/odatano-backend.d.ts +64 -0
- package/srv/blockchain/backends/odatano-backend.js +170 -0
- package/srv/blockchain/backends/ogmios-backend.d.ts +162 -94
- package/srv/blockchain/backends/ogmios-backend.js +548 -197
- package/srv/blockchain/backends/ogmios-frame-guard.d.ts +32 -0
- package/srv/blockchain/backends/ogmios-frame-guard.js +142 -0
- package/srv/blockchain/cardano-client.d.ts +78 -205
- package/srv/blockchain/cardano-client.js +186 -242
- package/srv/blockchain/cardano-indexer.d.ts +302 -242
- package/srv/blockchain/cardano-indexer.js +1193 -362
- package/srv/blockchain/cardano-tx-builder.d.ts +43 -81
- package/srv/blockchain/cardano-tx-builder.js +177 -132
- package/srv/blockchain/crawler/certificate-backfill.d.ts +67 -0
- package/srv/blockchain/crawler/certificate-backfill.js +169 -0
- package/srv/blockchain/crawler/crawler.d.ts +139 -54
- package/srv/blockchain/crawler/crawler.js +478 -96
- package/srv/blockchain/crawler/hooks.d.ts +3 -14
- package/srv/blockchain/crawler/index.d.ts +5 -0
- package/srv/blockchain/crawler/index.js +35 -7
- package/srv/blockchain/crawler/sync-state.d.ts +46 -28
- package/srv/blockchain/crawler/sync-state.js +128 -43
- package/srv/blockchain/crawler/transaction-backfill.d.ts +52 -0
- package/srv/blockchain/crawler/transaction-backfill.js +283 -0
- package/srv/blockchain/crawler/utxo-set-import.d.ts +78 -0
- package/srv/blockchain/crawler/utxo-set-import.js +363 -0
- package/srv/blockchain/ledger-state.d.ts +101 -0
- package/srv/blockchain/ledger-state.js +432 -0
- package/srv/blockchain/pending-spends.d.ts +28 -0
- package/srv/blockchain/pending-spends.js +89 -0
- package/srv/blockchain/signing/cose-verifier.d.ts +5 -12
- package/srv/blockchain/signing/cose-verifier.js +6 -12
- package/srv/blockchain/signing/external-signer.d.ts +16 -113
- package/srv/blockchain/signing/external-signer.js +19 -122
- package/srv/blockchain/signing/hsm-signer.d.ts +13 -45
- package/srv/blockchain/signing/hsm-signer.js +23 -63
- package/srv/blockchain/signing/signature-verifier.d.ts +8 -44
- package/srv/blockchain/signing/signature-verifier.js +13 -54
- package/srv/blockchain/signing/submission-finalizer.d.ts +9 -36
- package/srv/blockchain/signing/submission-finalizer.js +16 -49
- package/srv/blockchain/stored-chain.d.ts +33 -0
- package/srv/blockchain/stored-chain.js +234 -0
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts +115 -160
- package/srv/blockchain/transaction-building/buildooor-tx.js +651 -287
- package/srv/blockchain/transaction-building/caller-datums.d.ts +29 -0
- package/srv/blockchain/transaction-building/caller-datums.js +139 -0
- package/srv/blockchain/transaction-building/cardano-tx.d.ts +10 -35
- package/srv/blockchain/transaction-rows.d.ts +12 -0
- package/srv/blockchain/transaction-rows.js +43 -0
- package/srv/blockchain/wallet-worker/build-request.d.ts +4 -17
- package/srv/blockchain/wallet-worker/build-request.js +48 -24
- package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +25 -17
- package/srv/blockchain/wallet-worker/confirmation-tracker.js +87 -41
- package/srv/blockchain/wallet-worker/index.js +2 -8
- package/srv/blockchain/wallet-worker/job-store.d.ts +36 -103
- package/srv/blockchain/wallet-worker/job-store.js +0 -0
- package/srv/blockchain/wallet-worker/lease-heartbeat.d.ts +4 -20
- package/srv/blockchain/wallet-worker/lease-heartbeat.js +4 -20
- package/srv/blockchain/wallet-worker/signers.d.ts +6 -19
- package/srv/blockchain/wallet-worker/signers.js +3 -8
- package/srv/blockchain/wallet-worker/wallet-worker.d.ts +15 -71
- package/srv/blockchain/wallet-worker/wallet-worker.js +40 -91
- package/srv/cardano-agent-service.cds +146 -0
- package/srv/cardano-agent-service.d.ts +2 -0
- package/srv/cardano-agent-service.js +12 -0
- package/srv/cardano-backend-service.cds +52 -0
- package/srv/cardano-backend-service.d.ts +2 -0
- package/srv/cardano-backend-service.js +244 -0
- package/srv/cardano-indexer-service.cds +201 -73
- package/srv/cardano-indexer-service.js +280 -11
- package/srv/cardano-service.cds +56 -1
- package/srv/cardano-service.js +52 -113
- package/srv/cardano-sign-service.cds +200 -180
- package/srv/cardano-sign-service.js +55 -173
- package/srv/cardano-tx-service.cds +439 -364
- package/srv/cardano-tx-service.js +305 -209
- package/srv/cardano-ui.cds +16 -16
- package/srv/cardano-worker-service.js +7 -15
- package/srv/cbor/parse.js +13 -1
- package/srv/server.d.ts +28 -86
- package/srv/server.js +130 -135
- package/srv/utils/agent-grants-config.d.ts +37 -0
- package/srv/utils/agent-grants-config.js +138 -0
- package/srv/utils/agent-grants.d.ts +262 -0
- package/srv/utils/agent-grants.js +922 -0
- package/srv/utils/agent-token-auth.d.ts +16 -0
- package/srv/utils/agent-token-auth.js +78 -0
- package/srv/utils/backend-request-handler.d.ts +2 -16
- package/srv/utils/backend-request-handler.js +3 -18
- package/srv/utils/collections.d.ts +4 -8
- package/srv/utils/collections.js +4 -8
- package/srv/utils/const.d.ts +30 -67
- package/srv/utils/const.js +32 -72
- package/srv/utils/crypto.d.ts +3 -12
- package/srv/utils/crypto.js +5 -18
- package/srv/utils/db-indexes.d.ts +25 -0
- package/srv/utils/db-indexes.js +94 -0
- package/srv/utils/db-sanitize.d.ts +27 -0
- package/srv/utils/db-sanitize.js +85 -0
- package/srv/utils/epoch-slots.d.ts +13 -0
- package/srv/utils/epoch-slots.js +25 -0
- package/srv/utils/error-codes.d.ts +20 -73
- package/srv/utils/error-codes.js +19 -70
- package/srv/utils/errors.d.ts +50 -177
- package/srv/utils/errors.js +94 -218
- package/srv/utils/liveness.d.ts +16 -0
- package/srv/utils/liveness.js +40 -0
- package/srv/utils/mappers.d.ts +128 -214
- package/srv/utils/mappers.js +354 -299
- package/srv/utils/network-context.js +2 -11
- package/srv/utils/pg-inline-json.d.ts +8 -0
- package/srv/utils/pg-inline-json.js +62 -0
- package/srv/utils/pg-order-nulls.d.ts +14 -0
- package/srv/utils/pg-order-nulls.js +56 -0
- package/srv/utils/plutus-placeholders.d.ts +23 -16
- package/srv/utils/plutus-placeholders.js +63 -27
- package/srv/utils/rate-limiter.d.ts +46 -0
- package/srv/utils/rate-limiter.js +116 -0
- package/srv/utils/service-events.d.ts +2 -22
- package/srv/utils/service-events.js +3 -23
- package/srv/utils/signing-helper.d.ts +3 -18
- package/srv/utils/signing-helper.js +10 -32
- package/srv/utils/tx-build-helper.d.ts +26 -92
- package/srv/utils/tx-build-helper.js +68 -123
- package/srv/utils/tx-request-parsers.d.ts +107 -21
- package/srv/utils/tx-request-parsers.js +433 -34
- package/srv/utils/tx-utils.d.ts +4 -23
- package/srv/utils/tx-utils.js +12 -41
- package/srv/utils/types.d.ts +238 -169
- package/srv/utils/types.js +2 -6
- package/srv/utils/validators.d.ts +24 -90
- package/srv/utils/validators.js +50 -147
|
@@ -1,33 +1,26 @@
|
|
|
1
|
-
import type { JSONValue } from './types';
|
|
1
|
+
import type { JSONValue, MintAction } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* Shared parsers for the Build*-action JSON payload fields
|
|
4
|
-
*
|
|
5
|
-
* request transformation (srv/blockchain/wallet-worker/build-request.ts) so
|
|
6
|
-
* both paths accept exactly the same payload shape.
|
|
7
|
-
*
|
|
8
|
-
* Result contract: { parsed } on success (undefined for absent/empty input →
|
|
9
|
-
* no-op) or { error } with a caller-presentable message.
|
|
3
|
+
* Shared parsers for the Build*-action JSON payload fields (transaction service and wallet worker).
|
|
4
|
+
* Result contract: `{ parsed }` on success (undefined for absent/empty input) or `{ error }` with a client message.
|
|
10
5
|
*/
|
|
11
|
-
|
|
6
|
+
/** PlutusData as CBOR hex, checked to decode; `field` names it in the error. */
|
|
7
|
+
export declare function parsePlutusCbor(value: unknown, field: string): {
|
|
8
|
+
hex?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function parseUtxoRefArray(json: string | undefined, fieldName: 'forceInputsJson' | 'referenceInputsJson' | 'protectInputsJson'): {
|
|
12
12
|
parsed?: Array<{
|
|
13
13
|
txHash: string;
|
|
14
14
|
outputIndex: number;
|
|
15
15
|
}>;
|
|
16
16
|
error?: string;
|
|
17
17
|
};
|
|
18
|
-
/**
|
|
19
|
-
* Parse and validate requiredSignersJson (array of 56-hex Ed25519 key hashes).
|
|
20
|
-
* Same result contract as the other parse* helpers.
|
|
21
|
-
*/
|
|
18
|
+
/** Parse and validate requiredSignersJson (array of 56-hex Ed25519 key hashes). */
|
|
22
19
|
export declare function parseRequiredSigners(requiredSignersJson: string | undefined): {
|
|
23
20
|
parsed?: string[];
|
|
24
21
|
error?: string;
|
|
25
22
|
};
|
|
26
|
-
/**
|
|
27
|
-
* Parse and validate an assetsJson array ({unit, quantity} entries) with the same
|
|
28
|
-
* per-entry strictness as parseExtraOutputs — unchecked entries previously flowed
|
|
29
|
-
* into the builder and surfaced as 500s.
|
|
30
|
-
*/
|
|
23
|
+
/** Parse and validate an assetsJson array of `{unit, quantity}` entries. */
|
|
31
24
|
export declare function parseAssetsArray(assetsJson: string | undefined, fieldName: string): {
|
|
32
25
|
parsed?: Array<{
|
|
33
26
|
unit: string;
|
|
@@ -45,14 +38,107 @@ export interface ParsedExtraOutput {
|
|
|
45
38
|
quantity: string;
|
|
46
39
|
}>;
|
|
47
40
|
inlineDatum?: JSONValue;
|
|
41
|
+
/** Hash of a datum the output is locked with (hex, 32 bytes); `outputsJson` only. */
|
|
42
|
+
datumHash?: string;
|
|
43
|
+
/** Inline datum as PlutusData CBOR hex, taken byte for byte; `outputsJson` only. */
|
|
44
|
+
inlineDatumCbor?: string;
|
|
48
45
|
referenceScript?: string;
|
|
49
46
|
}
|
|
47
|
+
/** Parse and validate extraOutputsJson (undefined for an empty array). */
|
|
48
|
+
export declare function parseExtraOutputs(extraOutputsJson: string | undefined): {
|
|
49
|
+
parsed?: ParsedExtraOutput[];
|
|
50
|
+
error?: string;
|
|
51
|
+
};
|
|
50
52
|
/**
|
|
51
|
-
* Parse
|
|
52
|
-
*
|
|
53
|
+
* Parse an output list. `outputsJson` (BuildPlutusTransaction) additionally accepts `datumHash`;
|
|
54
|
+
* the entries keep their order, each is min-ADA checked by the builder.
|
|
53
55
|
*/
|
|
54
|
-
export declare function
|
|
56
|
+
export declare function parseOutputList(json: string | undefined, fieldName: 'extraOutputsJson' | 'outputsJson'): {
|
|
55
57
|
parsed?: ParsedExtraOutput[];
|
|
56
58
|
error?: string;
|
|
57
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Parse the optional per-action policy fields of a mintActionsJson entry: `mintingPolicyScript` (CBOR hex,
|
|
62
|
+
* applied as-is) and `redeemerJson` (JSON string). Absent fields fall back to the top-level script/redeemer.
|
|
63
|
+
*/
|
|
64
|
+
export declare function parseMintActionPolicyFields(entry: Record<string, unknown>, i: number, byReference?: boolean): {
|
|
65
|
+
script?: string;
|
|
66
|
+
redeemer?: JSONValue;
|
|
67
|
+
error?: string;
|
|
68
|
+
};
|
|
69
|
+
/** Upper bound on script inputs per BuildPlutusTransaction. */
|
|
70
|
+
export declare const MAX_SCRIPT_INPUTS = 16;
|
|
71
|
+
/** One script UTxO of a BuildPlutusTransaction, validated; `validatorScript` still without params applied. */
|
|
72
|
+
export interface ParsedScriptInput {
|
|
73
|
+
txHash: string;
|
|
74
|
+
outputIndex: number;
|
|
75
|
+
validatorScript?: string;
|
|
76
|
+
scriptParams?: JSONValue[];
|
|
77
|
+
referenceScript?: {
|
|
78
|
+
txHash: string;
|
|
79
|
+
outputIndex: number;
|
|
80
|
+
};
|
|
81
|
+
redeemer: JSONValue;
|
|
82
|
+
/** Redeemer as PlutusData CBOR hex (instead of redeemerJson), taken byte for byte. */
|
|
83
|
+
redeemerCbor?: string;
|
|
84
|
+
datum?: JSONValue;
|
|
85
|
+
/** Datum preimage as PlutusData CBOR hex (instead of datumJson). */
|
|
86
|
+
datumCbor?: string;
|
|
87
|
+
}
|
|
88
|
+
/** Parse and validate scriptInputsJson: 1..MAX_SCRIPT_INPUTS distinct script UTxOs, each with its own redeemer. */
|
|
89
|
+
export declare function parseScriptInputs(json: string | undefined): {
|
|
90
|
+
parsed?: ParsedScriptInput[];
|
|
91
|
+
error?: string;
|
|
92
|
+
};
|
|
93
|
+
/** Upper bound on withdrawals per BuildPlutusTransaction. */
|
|
94
|
+
export declare const MAX_WITHDRAWALS = 16;
|
|
95
|
+
/** One withdrawal of a BuildPlutusTransaction, validated; `stakingScript` still without params applied. */
|
|
96
|
+
export interface ParsedWithdrawal {
|
|
97
|
+
rewardAddress: string;
|
|
98
|
+
lovelace: string;
|
|
99
|
+
stakingScript?: string;
|
|
100
|
+
scriptParams?: JSONValue[];
|
|
101
|
+
referenceScript?: {
|
|
102
|
+
txHash: string;
|
|
103
|
+
outputIndex: number;
|
|
104
|
+
};
|
|
105
|
+
redeemer?: JSONValue;
|
|
106
|
+
redeemerCbor?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Parse and validate withdrawalsJson: distinct reward accounts, lovelace >= 0, optionally a staking
|
|
110
|
+
* script (inline or by reference) with exactly one redeemer form; without a script no redeemer.
|
|
111
|
+
*/
|
|
112
|
+
export declare function parseWithdrawals(json: string | undefined): {
|
|
113
|
+
parsed?: ParsedWithdrawal[];
|
|
114
|
+
error?: string;
|
|
115
|
+
};
|
|
116
|
+
/** Optional staking script (inline with params, or by reference) plus its redeemer, shared by withdrawals and certificates. */
|
|
117
|
+
type ParsedStakingScriptWitness = Pick<ParsedWithdrawal, 'stakingScript' | 'scriptParams' | 'referenceScript' | 'redeemer' | 'redeemerCbor'>;
|
|
118
|
+
/** Upper bound on certificates per BuildPlutusTransaction. */
|
|
119
|
+
export declare const MAX_CERTIFICATES = 16;
|
|
120
|
+
/** One certificate of a BuildPlutusTransaction, validated; `stakingScript` still without params applied. */
|
|
121
|
+
export interface ParsedCertificate extends ParsedStakingScriptWitness {
|
|
122
|
+
type: 'registerStake' | 'deregisterStake';
|
|
123
|
+
stakeAddress: string;
|
|
124
|
+
deposit?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Parse and validate certificatesJson: stake registrations and deregistrations, each with an
|
|
128
|
+
* optional staking script (inline or by reference) and exactly one redeemer form when scripted.
|
|
129
|
+
*/
|
|
130
|
+
export declare function parseCertificates(json: string | undefined): {
|
|
131
|
+
parsed?: ParsedCertificate[];
|
|
132
|
+
error?: string;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Parse mintActionsJson for BuildPlutusTransaction: every action carries its own `mintingPolicyScript`
|
|
136
|
+
* or `referenceScript` (no request-level default) and optional `redeemerJson`; `assetUnit` is
|
|
137
|
+
* policyId+assetName, or with an inline script a bare assetName prefixed with the script's policy id.
|
|
138
|
+
*/
|
|
139
|
+
export declare function parsePolicyMintActions(json: string | undefined): {
|
|
140
|
+
parsed?: MintAction[];
|
|
141
|
+
error?: string;
|
|
142
|
+
};
|
|
143
|
+
export {};
|
|
58
144
|
//# sourceMappingURL=tx-request-parsers.d.ts.map
|