@odatano/core 2.0.0-rc.2 → 2.0.0-rc.20
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/CardanoIndexerService/index.d.ts +139 -2
- package/@cds-models/CardanoIndexerService/index.js +18 -0
- package/@cds-models/CardanoODataService/index.d.ts +224 -0
- package/@cds-models/CardanoODataService/index.js +27 -0
- package/@cds-models/CardanoSignService/index.d.ts +5 -2
- package/@cds-models/CardanoTransactionService/index.d.ts +9 -9
- package/@cds-models/odatano/cardano/index.d.ts +316 -0
- package/@cds-models/odatano/cardano/index.js +33 -0
- package/README.md +195 -136
- package/db/schema.cds +2121 -1633
- package/package.json +179 -173
- package/src/index.d.ts +10 -10
- package/src/index.js +24 -14
- package/src/plugin.js +39 -52
- package/srv/blockchain/backends/blockfrost-backend.d.ts +29 -131
- package/srv/blockchain/backends/blockfrost-backend.js +45 -158
- package/srv/blockchain/backends/cardano-backend.d.ts +78 -158
- package/srv/blockchain/backends/cardano-backend.js +14 -5
- package/srv/blockchain/backends/koios-backend.d.ts +126 -60
- package/srv/blockchain/backends/koios-backend.js +292 -202
- package/srv/blockchain/backends/ogmios-backend.d.ts +59 -96
- package/srv/blockchain/backends/ogmios-backend.js +241 -153
- 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 +50 -205
- package/srv/blockchain/cardano-client.js +80 -224
- package/srv/blockchain/cardano-indexer.d.ts +146 -244
- package/srv/blockchain/cardano-indexer.js +442 -285
- package/srv/blockchain/cardano-tx-builder.d.ts +19 -84
- package/srv/blockchain/cardano-tx-builder.js +21 -107
- package/srv/blockchain/crawler/certificate-backfill.d.ts +45 -0
- package/srv/blockchain/crawler/certificate-backfill.js +150 -0
- package/srv/blockchain/crawler/crawler.d.ts +121 -53
- package/srv/blockchain/crawler/crawler.js +402 -82
- 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 +44 -28
- package/srv/blockchain/crawler/sync-state.js +115 -43
- package/srv/blockchain/crawler/utxo-set-import.d.ts +69 -0
- package/srv/blockchain/crawler/utxo-set-import.js +269 -0
- package/srv/blockchain/ledger-state.d.ts +80 -0
- package/srv/blockchain/ledger-state.js +383 -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 -48
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts +71 -160
- package/srv/blockchain/transaction-building/buildooor-tx.js +185 -260
- package/srv/blockchain/transaction-building/cardano-tx.d.ts +8 -34
- package/srv/blockchain/wallet-worker/build-request.d.ts +4 -17
- package/srv/blockchain/wallet-worker/build-request.js +39 -23
- 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 +34 -90
- 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-indexer-service.cds +164 -73
- package/srv/cardano-indexer-service.js +156 -11
- package/srv/cardano-service.cds +45 -0
- package/srv/cardano-service.js +38 -96
- package/srv/cardano-sign-service.cds +200 -180
- package/srv/cardano-sign-service.js +55 -173
- package/srv/cardano-tx-service.cds +32 -26
- package/srv/cardano-tx-service.js +133 -195
- package/srv/cardano-worker-service.js +7 -15
- package/srv/server.d.ts +28 -86
- package/srv/server.js +95 -128
- 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 +914 -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 +19 -68
- package/srv/utils/const.js +20 -69
- 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 +89 -0
- package/srv/utils/db-sanitize.d.ts +27 -0
- package/srv/utils/db-sanitize.js +85 -0
- package/srv/utils/error-codes.d.ts +18 -73
- package/srv/utils/error-codes.js +17 -70
- package/srv/utils/errors.d.ts +34 -178
- package/srv/utils/errors.js +55 -217
- package/srv/utils/liveness.d.ts +16 -0
- package/srv/utils/liveness.js +41 -0
- package/srv/utils/mappers.d.ts +82 -210
- package/srv/utils/mappers.js +272 -293
- package/srv/utils/network-context.js +2 -11
- package/srv/utils/pg-order-nulls.d.ts +14 -0
- package/srv/utils/pg-order-nulls.js +57 -0
- package/srv/utils/plutus-placeholders.d.ts +6 -18
- package/srv/utils/plutus-placeholders.js +6 -20
- 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 +18 -92
- package/srv/utils/tx-build-helper.js +32 -123
- package/srv/utils/tx-request-parsers.d.ts +14 -20
- package/srv/utils/tx-request-parsers.js +33 -20
- package/srv/utils/tx-utils.d.ts +4 -23
- package/srv/utils/tx-utils.js +12 -41
- package/srv/utils/types.d.ts +112 -169
- package/srv/utils/types.js +2 -6
- package/srv/utils/validators.d.ts +19 -89
- package/srv/utils/validators.js +31 -138
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
using {odatano.cardano as db} from '../db/schema';
|
|
2
|
-
using {
|
|
2
|
+
using {
|
|
3
|
+
Bech32,
|
|
4
|
+
Lovelace
|
|
5
|
+
} from '../db/types';
|
|
3
6
|
|
|
4
7
|
|
|
5
8
|
/**
|
|
@@ -43,20 +46,21 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
43
46
|
@description: 'Projection for Transaction Build Output Assets'
|
|
44
47
|
entity TransactionBuildOutputAssets as projection on db.TransactionBuildOutputAssets;
|
|
45
48
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
@readonly
|
|
50
|
+
@title : 'Transaction Submissions'
|
|
51
|
+
@description: 'Projection for Transaction Submissions'
|
|
49
52
|
entity TransactionSubmissions as projection on db.TransactionSubmissions
|
|
50
53
|
actions {
|
|
51
54
|
@title : 'Check Submission Status'
|
|
52
55
|
@description: 'Check the status of a submitted transaction by querying the blockchain for confirmation'
|
|
53
56
|
action CheckSubmissionStatus() returns TransactionSubmissions;
|
|
54
57
|
};
|
|
58
|
+
|
|
55
59
|
/**
|
|
56
60
|
* TransactionSubmissions status flow:
|
|
57
|
-
* pending
|
|
58
|
-
* submitted
|
|
59
|
-
* pending | submitted
|
|
61
|
+
* pending -> [submit to chain] -> submitted (internal, in SubmitTransaction handler)
|
|
62
|
+
* submitted -> [CheckSubmissionStatus] confirmed | stays submitted (conditional)
|
|
63
|
+
* pending | submitted -> failed (blockchain error)
|
|
60
64
|
*/
|
|
61
65
|
annotate CardanoTransactionService.TransactionSubmissions with @flow.status: status actions {
|
|
62
66
|
CheckSubmissionStatus @from : [ #submitted];
|
|
@@ -117,7 +121,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
117
121
|
validityStartMs: String,
|
|
118
122
|
@title: 'Validity End (Posix ms)'
|
|
119
123
|
@description: 'Optional. Validity-interval end in Posix milliseconds. Passed through to the builder only; for non-script transfers the builder leaves bounds unset unless provided.'
|
|
120
|
-
validityEndMs: String)
|
|
124
|
+
validityEndMs: String) returns TransactionBuilds;
|
|
121
125
|
|
|
122
126
|
@title : 'Build Transaction with Metadata'
|
|
123
127
|
@description: 'Build a transaction with custom metadata from sender to recipient with specified amount and change address'
|
|
@@ -136,7 +140,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
136
140
|
changeAddress: Bech32,
|
|
137
141
|
@title: 'Metadata JSON'
|
|
138
142
|
@description: 'The JSON representation of the transaction metadata as string'
|
|
139
|
-
metadataJson: String)
|
|
143
|
+
metadataJson: String) returns TransactionBuilds;
|
|
140
144
|
|
|
141
145
|
@title : 'Build Multi-Asset Transaction'
|
|
142
146
|
@description: 'Build a transaction to send native assets (tokens) along with ADA'
|
|
@@ -167,7 +171,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
167
171
|
validityStartMs: String,
|
|
168
172
|
@title: 'Validity End (Posix ms)'
|
|
169
173
|
@description: 'Optional. Validity-interval end in Posix milliseconds. Passed through to the builder only; for non-script transfers the builder leaves bounds unset unless provided.'
|
|
170
|
-
validityEndMs: String)
|
|
174
|
+
validityEndMs: String) returns TransactionBuilds;
|
|
171
175
|
|
|
172
176
|
@title : 'Build Minting Transaction'
|
|
173
177
|
@description: 'Build a transaction to mint or burn native assets'
|
|
@@ -182,10 +186,10 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
182
186
|
@description: 'The amount of ADA to send with minted assets in lovelace'
|
|
183
187
|
lovelaceAmount: Lovelace,
|
|
184
188
|
@title: 'Mint Actions JSON'
|
|
185
|
-
@description: 'JSON array of mint/burn actions (format: [{"assetUnit":"policyId+assetName","quantity":"amount"}])'
|
|
189
|
+
@description: 'JSON array of mint/burn actions (format: [{"assetUnit":"policyId+assetName","quantity":"amount"}]). Multi-policy mints: each action may additionally carry its own "mintingPolicyScript" (CBOR hex, pre-applied) and "redeemerJson" (JSON-encoded PlutusData string), overriding the top-level policy/redeemer for that action. Actions resolving to the same policy must agree on their redeemer (the ledger carries one redeemer per policy).'
|
|
186
190
|
mintActionsJson: String,
|
|
187
191
|
@title: 'Minting Policy Script'
|
|
188
|
-
@description: 'The minting policy script in CBOR hex format'
|
|
192
|
+
@description: 'The minting policy script in CBOR hex format. Actions without a per-action mintingPolicyScript mint under this script.'
|
|
189
193
|
mintingPolicyScript: String,
|
|
190
194
|
@title: 'Change Address'
|
|
191
195
|
@description: 'The Bech32 encoded address for returning change -defaults to sender address if not specified'
|
|
@@ -211,6 +215,9 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
211
215
|
@title: 'Reference Inputs JSON'
|
|
212
216
|
@description: 'Optional JSON array of {txHash, outputIndex} UTxOs to include as CIP-31 reference inputs (read-only, not consumed). Use for oracle feeds, shared config UTxOs, or script reference UTxOs. Buildooor builder only.'
|
|
213
217
|
referenceInputsJson: String,
|
|
218
|
+
@title: 'Extra Outputs JSON'
|
|
219
|
+
@description: 'Optional JSON array of additional outputs [{address, lovelaceAmount, assets?, inlineDatumJson?, referenceScriptHex?}] appended after the primary recipient output. When present, the extra outputs carry the minted assets (declare each minted unit in an entry''s assets) and the primary output stays ADA-only — to place each minted token on its own output with its own inline datum (e.g. datum-bound predicate tokens). Each entry is independently min-ADA checked.'
|
|
220
|
+
extraOutputsJson: String,
|
|
214
221
|
@title: 'Metadata JSON'
|
|
215
222
|
@description: 'Optional transaction metadata as JSON (CIP-20 / label-674 etc.). Object keyed by numeric label string. Attached as auxiliary_data to the mint tx so chain-watchers can correlate off-chain context (receipt IDs, free-form notes).'
|
|
216
223
|
metadataJson: String,
|
|
@@ -222,14 +229,14 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
222
229
|
validityStartMs: String,
|
|
223
230
|
@title: 'Validity End (Posix ms)'
|
|
224
231
|
@description: 'Optional. Sets the transaction validity-interval end in Posix milliseconds. Required finite value for Plutus validators that call expect Finite(upper) on tx.validity_range.upper_bound. Defaults to now + 3 600 000 ms when omitted.'
|
|
225
|
-
validityEndMs: String)
|
|
232
|
+
validityEndMs: String) returns TransactionBuilds;
|
|
226
233
|
|
|
227
234
|
@title : 'Get Build Details'
|
|
228
235
|
@description: 'Retrieve transaction build details using the Build Id'
|
|
229
236
|
action GetBuildDetails(
|
|
230
237
|
@title: 'Build Id'
|
|
231
238
|
@description: 'The unique identifier of the transaction build'
|
|
232
|
-
buildId: UUID)
|
|
239
|
+
buildId: UUID) returns TransactionBuilds;
|
|
233
240
|
|
|
234
241
|
@title : 'Submit Transaction'
|
|
235
242
|
@description: 'Submit a transaction to the Cardano network using a build ID and signed CBOR'
|
|
@@ -239,7 +246,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
239
246
|
buildId: UUID,
|
|
240
247
|
@title: 'Signed Transaction CBOR'
|
|
241
248
|
@description: 'The CBOR of the signed transaction'
|
|
242
|
-
signedTxCbor: String)
|
|
249
|
+
signedTxCbor: String) returns TransactionSubmissions;
|
|
243
250
|
|
|
244
251
|
@title : 'Submit Signed Transaction'
|
|
245
252
|
@description: 'Submit a signed transaction to the Cardano network'
|
|
@@ -249,7 +256,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
249
256
|
signedTxCbor: String,
|
|
250
257
|
@title: 'Network'
|
|
251
258
|
@description: 'The Cardano network to submit the transaction to (e.g., mainnet, testnet)'
|
|
252
|
-
network: String(10))
|
|
259
|
+
network: String(10)) returns TransactionSubmissions;
|
|
253
260
|
|
|
254
261
|
@title : 'Build Plutus Spend Transaction'
|
|
255
262
|
@description: 'Build a transaction to spend a UTxO locked at a Plutus script address'
|
|
@@ -326,13 +333,14 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
326
333
|
action SetCollateral(
|
|
327
334
|
@title: 'Address'
|
|
328
335
|
@description: 'The Bech32 encoded address to check and set up collateral for'
|
|
329
|
-
address: Bech32)
|
|
336
|
+
address: Bech32) returns TransactionBuilds;
|
|
337
|
+
|
|
330
338
|
@title : 'Address Transaction Builds'
|
|
331
339
|
@description: 'Projection for retrieving transaction builds by address'
|
|
332
340
|
action GetTransactionBuildsByAddress(
|
|
333
341
|
@title: 'Bech32 Address'
|
|
334
342
|
@description: 'The Bech32 encoded address to retrieve transaction builds for'
|
|
335
|
-
address: Bech32)
|
|
343
|
+
address: Bech32) returns array of AddressTransactionBuilds;
|
|
336
344
|
|
|
337
345
|
@title : 'Derive Script Address'
|
|
338
346
|
@description: 'Utility: Apply optional PlutusData parameters to a validator script and return its enterprise script address (bech32) and script hash (28-byte hex). Pure derivation, no transaction built, no blockchain call.'
|
|
@@ -346,19 +354,17 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
346
354
|
@title: 'Network'
|
|
347
355
|
@description: 'Optional network override (mainnet, preview, preprod). Defaults to the configured network.'
|
|
348
356
|
network: String(10)) returns {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
357
|
+
scriptAddress : String(120);
|
|
358
|
+
scriptHash : String(56);
|
|
359
|
+
};
|
|
352
360
|
|
|
353
361
|
@title : 'Extract Payment Key Hash'
|
|
354
362
|
@description: 'Utility: Decode a Bech32 Cardano address and return its 28-byte payment credential hash (hex). Pure bech32 decoding — no blockchain call. Use to obtain the key hash for requiredSignersJson on Plutus actions.'
|
|
355
363
|
action ExtractPaymentKeyHash(
|
|
356
364
|
@title: 'Address'
|
|
357
365
|
@description: 'The Bech32 encoded Cardano address (addr / addr_test)'
|
|
358
|
-
address: Bech32)
|
|
359
|
-
|
|
360
|
-
|
|
366
|
+
address: Bech32) returns {
|
|
367
|
+
paymentKeyHash : String(56);
|
|
368
|
+
};
|
|
361
369
|
|
|
362
370
|
}
|
|
363
|
-
|
|
364
|
-
|