@odatano/core 2.0.0-rc.43 → 2.0.0-rc.45

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.
Files changed (171) hide show
  1. package/@cds-models/CardanoAgentService/index.d.ts +0 -46
  2. package/@cds-models/CardanoBackendService/index.d.ts +0 -10
  3. package/@cds-models/CardanoIndexerService/index.d.ts +36 -20
  4. package/@cds-models/CardanoIndexerService/index.js +4 -0
  5. package/@cds-models/CardanoODataService/index.d.ts +19 -47
  6. package/@cds-models/CardanoSignService/index.d.ts +3 -18
  7. package/@cds-models/CardanoTransactionService/index.d.ts +9 -31
  8. package/@cds-models/CardanoWorkerService/index.d.ts +3 -19
  9. package/@cds-models/index.d.ts +17 -0
  10. package/@cds-models/index.js +2 -0
  11. package/@cds-models/odatano/cardano/index.d.ts +1 -34
  12. package/README.md +6 -6
  13. package/db/schema.cds +29 -44
  14. package/db/types.cds +22 -5
  15. package/package.json +3 -1
  16. package/scripts/migrate-slot-leader.mjs +3 -11
  17. package/scripts/migrate-txseq.mjs +3 -12
  18. package/src/index.d.ts +0 -4
  19. package/src/index.js +3 -5
  20. package/src/plugin.js +4 -8
  21. package/srv/blockchain/asset-decimals.d.ts +7 -0
  22. package/srv/blockchain/asset-decimals.js +91 -0
  23. package/srv/blockchain/backends/blockfrost-backend.d.ts +2 -10
  24. package/srv/blockchain/backends/blockfrost-backend.js +15 -21
  25. package/srv/blockchain/backends/cardano-backend.d.ts +12 -71
  26. package/srv/blockchain/backends/koios-backend.d.ts +14 -147
  27. package/srv/blockchain/backends/koios-backend.js +40 -164
  28. package/srv/blockchain/backends/odatano-backend.d.ts +1 -11
  29. package/srv/blockchain/backends/odatano-backend.js +11 -12
  30. package/srv/blockchain/backends/ogmios-backend.d.ts +13 -160
  31. package/srv/blockchain/backends/ogmios-backend.js +48 -175
  32. package/srv/blockchain/backends/ogmios-frame-guard.d.ts +2 -18
  33. package/srv/blockchain/backends/ogmios-frame-guard.js +8 -20
  34. package/srv/blockchain/cardano-client.d.ts +12 -80
  35. package/srv/blockchain/cardano-client.js +36 -88
  36. package/srv/blockchain/cardano-indexer.d.ts +12 -192
  37. package/srv/blockchain/cardano-indexer.js +132 -222
  38. package/srv/blockchain/cardano-tx-builder.d.ts +1 -28
  39. package/srv/blockchain/cardano-tx-builder.js +17 -34
  40. package/srv/blockchain/circuit-breaker.d.ts +1 -13
  41. package/srv/blockchain/circuit-breaker.js +5 -15
  42. package/srv/blockchain/crawler/asset-decimals-backfill.d.ts +15 -0
  43. package/srv/blockchain/crawler/asset-decimals-backfill.js +56 -0
  44. package/srv/blockchain/crawler/certificate-backfill.d.ts +0 -17
  45. package/srv/blockchain/crawler/certificate-backfill.js +8 -22
  46. package/srv/blockchain/crawler/crawler.d.ts +16 -93
  47. package/srv/blockchain/crawler/crawler.js +85 -160
  48. package/srv/blockchain/crawler/credential-backfill.d.ts +0 -9
  49. package/srv/blockchain/crawler/credential-backfill.js +6 -6
  50. package/srv/blockchain/crawler/hooks.d.ts +1 -5
  51. package/srv/blockchain/crawler/index.d.ts +0 -12
  52. package/srv/blockchain/crawler/index.js +6 -20
  53. package/srv/blockchain/crawler/sync-state.d.ts +6 -44
  54. package/srv/blockchain/crawler/sync-state.js +18 -53
  55. package/srv/blockchain/crawler/transaction-backfill.d.ts +0 -11
  56. package/srv/blockchain/crawler/transaction-backfill.js +11 -30
  57. package/srv/blockchain/crawler/utxo-set-import.d.ts +1 -30
  58. package/srv/blockchain/crawler/utxo-set-import.js +27 -53
  59. package/srv/blockchain/ledger-state.d.ts +10 -54
  60. package/srv/blockchain/ledger-state.js +11 -27
  61. package/srv/blockchain/pending-spends.d.ts +0 -12
  62. package/srv/blockchain/pending-spends.js +4 -12
  63. package/srv/blockchain/request-coalescer.d.ts +2 -16
  64. package/srv/blockchain/request-coalescer.js +2 -16
  65. package/srv/blockchain/signing/cose-verifier.d.ts +0 -9
  66. package/srv/blockchain/signing/cose-verifier.js +4 -10
  67. package/srv/blockchain/signing/external-signer.d.ts +1 -4
  68. package/srv/blockchain/signing/external-signer.js +2 -8
  69. package/srv/blockchain/signing/hsm-signer.d.ts +6 -18
  70. package/srv/blockchain/signing/hsm-signer.js +16 -28
  71. package/srv/blockchain/signing/signature-verifier.d.ts +1 -8
  72. package/srv/blockchain/signing/signature-verifier.js +9 -19
  73. package/srv/blockchain/signing/submission-finalizer.d.ts +10 -16
  74. package/srv/blockchain/signing/submission-finalizer.js +48 -19
  75. package/srv/blockchain/stored-chain.d.ts +1 -14
  76. package/srv/blockchain/stored-chain.js +3 -8
  77. package/srv/blockchain/transaction-building/buildooor-fee-patch.d.ts +0 -4
  78. package/srv/blockchain/transaction-building/buildooor-fee-patch.js +4 -9
  79. package/srv/blockchain/transaction-building/buildooor-tx.d.ts +7 -150
  80. package/srv/blockchain/transaction-building/buildooor-tx.js +91 -196
  81. package/srv/blockchain/transaction-building/caller-datums.d.ts +0 -14
  82. package/srv/blockchain/transaction-building/caller-datums.js +3 -9
  83. package/srv/blockchain/transaction-building/cardano-tx.d.ts +1 -4
  84. package/srv/blockchain/wallet-worker/build-request.d.ts +0 -5
  85. package/srv/blockchain/wallet-worker/build-request.js +6 -9
  86. package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +5 -23
  87. package/srv/blockchain/wallet-worker/confirmation-tracker.js +16 -20
  88. package/srv/blockchain/wallet-worker/index.d.ts +1 -1
  89. package/srv/blockchain/wallet-worker/index.js +3 -5
  90. package/srv/blockchain/wallet-worker/job-store.d.ts +15 -65
  91. package/srv/blockchain/wallet-worker/job-store.js +0 -0
  92. package/srv/blockchain/wallet-worker/lease-heartbeat.d.ts +2 -10
  93. package/srv/blockchain/wallet-worker/lease-heartbeat.js +6 -12
  94. package/srv/blockchain/wallet-worker/signers.d.ts +3 -11
  95. package/srv/blockchain/wallet-worker/signers.js +3 -6
  96. package/srv/blockchain/wallet-worker/wallet-worker.d.ts +3 -21
  97. package/srv/blockchain/wallet-worker/wallet-worker.js +47 -54
  98. package/srv/cardano-agent-service.cds +123 -146
  99. package/srv/cardano-agent-service.js +2 -5
  100. package/srv/cardano-backend-service.cds +10 -17
  101. package/srv/cardano-backend-service.js +7 -12
  102. package/srv/cardano-indexer-service.cds +35 -37
  103. package/srv/cardano-indexer-service.d.ts +5 -1
  104. package/srv/cardano-indexer-service.js +64 -33
  105. package/srv/cardano-service.cds +56 -40
  106. package/srv/cardano-service.js +42 -69
  107. package/srv/cardano-sign-service.cds +14 -23
  108. package/srv/cardano-sign-service.js +18 -24
  109. package/srv/cardano-tx-service.cds +27 -29
  110. package/srv/cardano-tx-service.js +60 -122
  111. package/srv/cardano-worker-service.cds +109 -125
  112. package/srv/cardano-worker-service.js +21 -31
  113. package/srv/cbor/cip68.d.ts +13 -0
  114. package/srv/cbor/cip68.js +56 -0
  115. package/srv/cbor/index.d.ts +1 -0
  116. package/srv/cbor/index.js +6 -1
  117. package/srv/cbor/parse.d.ts +3 -18
  118. package/srv/cbor/parse.js +2 -7
  119. package/srv/cbor/plutus-data-json.d.ts +0 -4
  120. package/srv/server.d.ts +5 -36
  121. package/srv/server.js +30 -51
  122. package/srv/utils/agent-grants-config.d.ts +0 -18
  123. package/srv/utils/agent-grants-config.js +6 -13
  124. package/srv/utils/agent-grants.d.ts +14 -68
  125. package/srv/utils/agent-grants.js +42 -60
  126. package/srv/utils/agent-token-auth.d.ts +0 -5
  127. package/srv/utils/agent-token-auth.js +2 -5
  128. package/srv/utils/backend-request-handler.d.ts +1 -1
  129. package/srv/utils/collections.d.ts +1 -4
  130. package/srv/utils/collections.js +1 -4
  131. package/srv/utils/const.d.ts +0 -18
  132. package/srv/utils/const.js +7 -18
  133. package/srv/utils/crypto.js +3 -5
  134. package/srv/utils/db-indexes.d.ts +2 -0
  135. package/srv/utils/db-indexes.js +22 -9
  136. package/srv/utils/db-sanitize.d.ts +1 -8
  137. package/srv/utils/db-sanitize.js +3 -8
  138. package/srv/utils/epoch-slots.d.ts +1 -8
  139. package/srv/utils/epoch-slots.js +3 -8
  140. package/srv/utils/error-codes.d.ts +0 -4
  141. package/srv/utils/error-codes.js +2 -4
  142. package/srv/utils/errors.d.ts +2 -22
  143. package/srv/utils/errors.js +13 -27
  144. package/srv/utils/liveness.d.ts +0 -4
  145. package/srv/utils/liveness.js +2 -4
  146. package/srv/utils/mappers.d.ts +0 -37
  147. package/srv/utils/mappers.js +22 -39
  148. package/srv/utils/network-context.js +2 -4
  149. package/srv/utils/paging.d.ts +31 -0
  150. package/srv/utils/paging.js +43 -0
  151. package/srv/utils/pg-inline-json.js +3 -7
  152. package/srv/utils/pg-order-nulls.js +2 -5
  153. package/srv/utils/plutus-placeholders.d.ts +0 -13
  154. package/srv/utils/plutus-placeholders.js +6 -13
  155. package/srv/utils/rate-limiter.d.ts +0 -8
  156. package/srv/utils/rate-limiter.js +2 -4
  157. package/srv/utils/reference-script.d.ts +0 -18
  158. package/srv/utils/reference-script.js +8 -19
  159. package/srv/utils/service-events.d.ts +0 -4
  160. package/srv/utils/service-events.js +2 -4
  161. package/srv/utils/signing-helper.d.ts +1 -8
  162. package/srv/utils/signing-helper.js +3 -8
  163. package/srv/utils/tx-build-helper.d.ts +2 -32
  164. package/srv/utils/tx-build-helper.js +26 -40
  165. package/srv/utils/tx-request-parsers.d.ts +1 -25
  166. package/srv/utils/tx-request-parsers.js +10 -25
  167. package/srv/utils/tx-utils.d.ts +0 -8
  168. package/srv/utils/tx-utils.js +10 -13
  169. package/srv/utils/types.d.ts +2 -37
  170. package/srv/utils/validators.d.ts +0 -4
  171. package/srv/utils/validators.js +2 -4
@@ -15,6 +15,7 @@ const hsm_signer_1 = require("./blockchain/signing/hsm-signer");
15
15
  const cose_verifier_1 = require("./blockchain/signing/cose-verifier");
16
16
  const signing_helper_1 = require("./utils/signing-helper");
17
17
  const tx_utils_1 = require("./utils/tx-utils");
18
+ const paging_1 = require("./utils/paging");
18
19
  const submission_finalizer_1 = require("./blockchain/signing/submission-finalizer");
19
20
  const { SELECT, UPDATE } = cds_1.default.ql;
20
21
  const logger = cds_1.default.log('CardanoSignService');
@@ -28,10 +29,7 @@ async function verifyBuildOwnership(req, db, buildId, address, TransactionBuilds
28
29
  }
29
30
  return build;
30
31
  }
31
- /**
32
- * Expire a pending signing request past its TTL.
33
- * @returns true if expired, false otherwise
34
- */
32
+ /** Expires a pending signing request past its TTL. Returns true if it expired. */
35
33
  async function checkAndExpireSigningRequest(db, signingRequest, SigningRequests) {
36
34
  const now = new Date().toISOString();
37
35
  const result = await db.run(UPDATE.entity(SigningRequests)
@@ -45,11 +43,8 @@ async function checkAndExpireSigningRequest(db, signingRequest, SigningRequests)
45
43
  // A later req.reject rolls this update back; the next touch re-applies it.
46
44
  return false;
47
45
  }
48
- /**
49
- * Key hashes that must witness a signing request: the body's `required_signers` plus the
50
- * payment key hash of the build's senderAddress (script credentials skipped).
51
- * Returns undefined when nothing is derivable.
52
- */
46
+ // Key hashes that must sign: the body's required_signers plus the sender's payment key hash.
47
+ // Script credentials are skipped. Returns undefined when nothing can be derived.
53
48
  async function resolveRequiredSigners(db, signingRequest, TransactionBuilds) {
54
49
  const signers = new Set();
55
50
  try {
@@ -94,7 +89,7 @@ module.exports = (srv) => {
94
89
  .set({ status: 'expired' })
95
90
  .where({ status: 'pending', expiresAt: { '<=': new Date().toISOString() } }));
96
91
  });
97
- // CreateSigningRequest — persist a signing request for a build (idempotent per pending build).
92
+ // CreateSigningRequest: persist a signing request for a build (idempotent per pending build).
98
93
  srv.on('CreateSigningRequest', async (req) => {
99
94
  logger.debug('CreateSigningRequest Action handler called');
100
95
  const { buildId, message } = req.data;
@@ -119,7 +114,7 @@ module.exports = (srv) => {
119
114
  return signingRequestRecord;
120
115
  });
121
116
  });
122
- // GetSigningRequest — by id; expires a pending request past its TTL on read.
117
+ // GetSigningRequest: by id; expires a pending request past its TTL on read.
123
118
  srv.on('GetSigningRequest', async (req) => {
124
119
  logger.debug('GetSigningRequest Action handler called');
125
120
  const { signingRequestId } = req.data;
@@ -135,7 +130,7 @@ module.exports = (srv) => {
135
130
  return signingRequest;
136
131
  });
137
132
  });
138
- // VerifySignature — verify a signed tx / witness set against the request; persists the result.
133
+ // VerifySignature: verify a signed tx or witness set against the request; persists the result.
139
134
  srv.on('VerifySignature', async (req) => {
140
135
  logger.debug('VerifySignature Action handler called');
141
136
  const { signingRequestId, signedTxCbor, signerType, signerInfo, address } = req.data;
@@ -189,7 +184,7 @@ module.exports = (srv) => {
189
184
  return verificationRecord;
190
185
  });
191
186
  });
192
- // SubmitVerifiedTransaction — verify and submit in one step.
187
+ // SubmitVerifiedTransaction: verify and submit in one step.
193
188
  srv.on('SubmitVerifiedTransaction', async (req) => {
194
189
  logger.debug('SubmitVerifiedTransaction Action handler called');
195
190
  const { signingRequestId, signedTxCbor, signerType, signerInfo, address } = req.data;
@@ -256,7 +251,7 @@ module.exports = (srv) => {
256
251
  // Phase 1 on the caller's transaction; validation errors stay synchronous.
257
252
  const prep = await phase1(cds_1.default.tx(req));
258
253
  (0, submission_finalizer_1.scheduleDeferredSubmit)(req, SigningRequests, finalizeParams(prep));
259
- logger.info({ signingRequestId, txHash: prep.txHash }, 'Verified and claimed — submit deferred until after the caller commits');
254
+ logger.info({ signingRequestId, txHash: prep.txHash }, 'Verified and claimed, submit deferred until after the caller commits');
260
255
  return {
261
256
  id: null,
262
257
  build_id: prep.buildId,
@@ -278,7 +273,7 @@ module.exports = (srv) => {
278
273
  return (0, mappers_1.mapError)(req, e, 'SubmitVerifiedTransaction');
279
274
  }
280
275
  });
281
- // VerifyDataSignature — stateless CIP-30 signData (COSE_Sign1) check for wallet login.
276
+ // VerifyDataSignature: stateless CIP-30 signData (COSE_Sign1) check for wallet login.
282
277
  // Public (@requires:'any') because the caller is not yet authenticated.
283
278
  srv.on('VerifyDataSignature', async (req) => {
284
279
  logger.debug('VerifyDataSignature Action handler called');
@@ -294,7 +289,7 @@ module.exports = (srv) => {
294
289
  // Never throws: a bad signature is a 200 with valid:false + reason.
295
290
  return (0, cose_verifier_1.verifyDataSignature)({ address, coseSignature, coseKey, expectedPayload });
296
291
  });
297
- // GetSigningRequestsByAddress — address ↔ signing request associations.
292
+ // GetSigningRequestsByAddress: signing requests linked to an address.
298
293
  srv.on('GetSigningRequestsByAddress', async (req) => {
299
294
  logger.debug('GetSigningRequestsByAddress Action handler called');
300
295
  const { address } = req.data;
@@ -302,14 +297,13 @@ module.exports = (srv) => {
302
297
  (0, errors_1.rejectMissing)(req, 'GetSigningRequestsByAddress', 'address');
303
298
  if (!(0, validators_1.isValidBech32Address)(address))
304
299
  (0, errors_1.rejectInvalid)(req, 'GetSigningRequestsByAddress', 'Invalid bech32 address format', 'address');
305
- return (0, backend_request_handler_1.handleRequest)(req, async (db) => {
306
- return db.run(SELECT.from(AddressSigningRequests).where({ address_address: address }));
307
- });
300
+ const { limit, skip } = (0, paging_1.pageOf)(req.data, 1000);
301
+ return (0, backend_request_handler_1.handleRequest)(req, (db) => db.run(SELECT.from(AddressSigningRequests).where({ address_address: address }).orderBy('signingRequest_id').limit(limit, skip)));
308
302
  });
309
303
  // ---------------------------------------------------------------------------
310
304
  // HSM signing actions
311
305
  // ---------------------------------------------------------------------------
312
- // SignWithHsm — create a signing request, sign with the HSM, verify; returns the request.
306
+ // SignWithHsm: create a signing request, sign with the HSM, verify; returns the request.
313
307
  srv.on('SignWithHsm', async (req) => {
314
308
  logger.debug('SignWithHsm Action handler called');
315
309
  enforceHsmRole(req, 'SignWithHsm');
@@ -365,7 +359,7 @@ module.exports = (srv) => {
365
359
  return db.run(SELECT.one.from(SigningRequests).where({ id: signingRequestRecord.id }));
366
360
  });
367
361
  });
368
- // SignAndSubmitWithHsm — create a signing request, sign, verify and submit in one call.
362
+ // SignAndSubmitWithHsm: create a signing request, sign, verify and submit in one call.
369
363
  srv.on('SignAndSubmitWithHsm', async (req) => {
370
364
  logger.debug('SignAndSubmitWithHsm Action handler called');
371
365
  enforceHsmRole(req, 'SignAndSubmitWithHsm');
@@ -398,7 +392,7 @@ module.exports = (srv) => {
398
392
  const hsmStatus = hsmSigner.getStatus();
399
393
  const hsmKeyIdentifier = hsmStatus.keyLabel || hsmStatus.keyId || 'unknown';
400
394
  if (!verificationResult.isValid) {
401
- logger.error({ signingRequestId: signingRequestRecord.id, hsmKey: hsmKeyIdentifier }, 'HSM signature verification failed — aborting submission');
395
+ logger.error({ signingRequestId: signingRequestRecord.id, hsmKey: hsmKeyIdentifier }, 'HSM signature verification failed, aborting submission');
402
396
  (0, errors_1.rejectInvalid)(req, 'SignAndSubmitWithHsm', 'HSM signature verification failed', 'signedTxCbor');
403
397
  }
404
398
  // Claim as 'submitting'; deferred path also persists signed CBOR + signer metadata
@@ -423,7 +417,7 @@ module.exports = (srv) => {
423
417
  // Phase 1 on the caller's transaction; submit runs after its commit.
424
418
  const prep = await phase1(cds_1.default.tx(req));
425
419
  (0, submission_finalizer_1.scheduleDeferredSubmit)(req, SigningRequests, finalizeParams(prep));
426
- logger.info({ signingRequestId: prep.signingRequestId, txHash: prep.txHash }, 'HSM-signed and claimed — submit deferred until after the caller commits');
420
+ logger.info({ signingRequestId: prep.signingRequestId, txHash: prep.txHash }, 'HSM-signed and claimed, submit deferred until after the caller commits');
427
421
  return {
428
422
  id: null,
429
423
  build_id: buildId,
@@ -446,7 +440,7 @@ module.exports = (srv) => {
446
440
  return (0, mappers_1.mapError)(req, e, 'SignAndSubmitWithHsm');
447
441
  }
448
442
  });
449
- // GetHsmStatus — connection status and key info; null fields when no HSM is configured.
443
+ // GetHsmStatus: connection status and key info; null fields when no HSM is configured.
450
444
  srv.on('GetHsmStatus', async (_req) => {
451
445
  enforceHsmRole(_req, 'GetHsmStatus');
452
446
  const hsmSigner = (0, hsm_signer_1.getHsmSigner)();
@@ -1,3 +1,4 @@
1
+ using { CardanoNetwork } from '../db/types';
1
2
  using {odatano.cardano as db} from '../db/schema';
2
3
  using {
3
4
  Bech32,
@@ -5,16 +6,7 @@ using {
5
6
  } from '../db/types';
6
7
 
7
8
 
8
- /**
9
- * Cardano Transaction Service
10
- *
11
- * Handles transaction building and submission operations.
12
- * Separate from the read-only CardanoODataService to provide
13
- * clear separation between general query and command operations.
14
- *
15
- * Security note: see CardanoODataService (cardano-service.cds) for the rationale
16
- * on service-level auth without per-resource ownership enforcement.
17
- */
9
+ // Transaction building and submission, separate from the read service.
18
10
  @requires: 'authenticated-user'
19
11
  service CardanoTransactionService @(impl: './cardano-tx-service') {
20
12
  // ---------------------------------------------------------------------------
@@ -57,16 +49,12 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
57
49
  entity TransactionSubmissions as projection on db.TransactionSubmissions
58
50
  actions {
59
51
  @title : 'Check Submission Status'
60
- @description: 'Check the status of a submitted transaction by querying the blockchain for confirmation'
52
+ @description: 'Mark a submitted transaction confirmed once it is 3 blocks deep (its own block included); otherwise it stays submitted'
61
53
  action CheckSubmissionStatus() returns TransactionSubmissions;
62
54
  };
63
55
 
64
- /**
65
- * TransactionSubmissions status flow:
66
- * pending -> [submit to chain] -> submitted (internal, in SubmitTransaction handler)
67
- * submitted -> [CheckSubmissionStatus] confirmed | stays submitted (conditional)
68
- * pending | submitted -> failed (blockchain error)
69
- */
56
+ // Status flow: pending, then submitted by SubmitTransaction, then confirmed by CheckSubmissionStatus at 3 blocks deep.
57
+ // A blockchain error moves pending or submitted to failed.
70
58
  annotate CardanoTransactionService.TransactionSubmissions with @flow.status: status actions {
71
59
  CheckSubmissionStatus @from : [ #submitted];
72
60
  };
@@ -78,7 +66,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
78
66
 
79
67
  @readonly
80
68
  @title : 'Address Transaction Builds'
81
- @description: 'Projection for retrieving transaction builds by address'
69
+ @description: 'Transaction builds of an address, ordered by build id'
82
70
  entity AddressTransactionBuilds as projection on db.AddressTransactionBuilds;
83
71
 
84
72
  // ---------------------------------------------------------------------------
@@ -119,7 +107,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
119
107
  @description: 'Optional JSON array of {txHash, outputIndex} UTxOs of the sender that must never be spent: left out of coin selection and collateral.'
120
108
  protectInputsJson: String,
121
109
  @title: 'Validator Script'
122
- @description: 'Optional Plutus validator CBOR hex. Required when lockOnScript=true. Used only to derive the target script address — the script itself is not attached to the transaction.'
110
+ @description: 'Optional Plutus validator CBOR hex. Required when lockOnScript=true. Used only to derive the target script address; the script itself is not attached to the transaction.'
123
111
  validatorScript: String,
124
112
  @title: 'Script Parameters JSON'
125
113
  @description: 'Optional JSON array of PlutusData parameters to apply to validatorScript before deriving the script address. For parameterized validators.'
@@ -128,7 +116,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
128
116
  @description: 'When true, validatorScript is required. Derives the enterprise script address from the (optionally param-applied) script and routes the output there instead of recipientAddress. Returns scriptAddress and scriptHash in the response.'
129
117
  lockOnScript: Boolean,
130
118
  @title: 'Reference Script Hex'
131
- @description: 'Optional Plutus V3 validator CBOR hex to attach as referenceScript on the primary recipient output (CIP-33 reference script deploy). Significantly increases the output min-ADA — lovelaceAmount must cover the inflated requirement.'
119
+ @description: 'Optional Plutus V3 validator CBOR hex to attach as referenceScript on the primary recipient output (CIP-33 reference script deploy). Significantly increases the output min-ADA; lovelaceAmount must cover the inflated requirement.'
132
120
  referenceScriptHex: String,
133
121
  @title: 'Validity Start (Posix ms)'
134
122
  @description: 'Optional. Validity-interval start in Posix milliseconds. Passed through to the builder only; for non-script transfers the builder leaves bounds unset unless provided.'
@@ -184,7 +172,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
184
172
  @description: 'Optional. When true, a lovelaceAmount below the recipient output min-ADA is raised to it; otherwise such a request is rejected with the required amount.'
185
173
  ensureMinAda: Boolean,
186
174
  @title: 'Reference Script Hex'
187
- @description: 'Optional Plutus V3 validator CBOR hex to attach as referenceScript on the primary recipient output (CIP-33 reference script deploy). Significantly increases the output min-ADA — lovelaceAmount must cover the inflated requirement.'
175
+ @description: 'Optional Plutus V3 validator CBOR hex to attach as referenceScript on the primary recipient output (CIP-33 reference script deploy). Significantly increases the output min-ADA; lovelaceAmount must cover the inflated requirement.'
188
176
  referenceScriptHex: String,
189
177
  @title: 'Validity Start (Posix ms)'
190
178
  @description: 'Optional. Validity-interval start in Posix milliseconds. Passed through to the builder only; for non-script transfers the builder leaves bounds unset unless provided.'
@@ -239,13 +227,13 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
239
227
  @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.'
240
228
  referenceInputsJson: String,
241
229
  @title: 'Extra Outputs JSON'
242
- @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.'
230
+ @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. This places 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.'
243
231
  extraOutputsJson: String,
244
232
  @title: 'Metadata JSON'
245
233
  @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).'
246
234
  metadataJson: String,
247
235
  @title: 'Reference Script Hex'
248
- @description: 'Optional Plutus V3 validator CBOR hex to attach as referenceScript on the primary recipient output (CIP-33 reference script deploy). Significantly increases the output min-ADA — lovelaceAmount must cover the inflated requirement.'
236
+ @description: 'Optional Plutus V3 validator CBOR hex to attach as referenceScript on the primary recipient output (CIP-33 reference script deploy). Significantly increases the output min-ADA; lovelaceAmount must cover the inflated requirement.'
249
237
  referenceScriptHex: String,
250
238
  @title: 'Validity Start (Posix ms)'
251
239
  @description: 'Optional. Sets the transaction validity-interval start in Posix milliseconds. Required finite value for Plutus validators that call expect Finite(lower) on tx.validity_range.lower_bound. Defaults to now − 120 000 ms when omitted.'
@@ -278,8 +266,9 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
278
266
  @description: 'The CBOR of the signed transaction'
279
267
  signedTxCbor: String,
280
268
  @title: 'Network'
281
- @description: 'The Cardano network to submit the transaction to (e.g., mainnet, testnet)'
282
- network: String(10)) returns TransactionSubmissions;
269
+ @description: 'Optional network check (mainnet, preview, preprod); must match the configured network'
270
+ @assert.range
271
+ network: CardanoNetwork) returns TransactionSubmissions;
283
272
 
284
273
  @title : 'Build Plutus Spend Transaction'
285
274
  @description: 'Build a transaction to spend a UTxO locked at a Plutus script address'
@@ -345,7 +334,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
345
334
  @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.'
346
335
  referenceInputsJson: String,
347
336
  @title: 'Reference Script Hex'
348
- @description: 'Optional Plutus V3 validator CBOR hex to attach as referenceScript on the primary recipient output (CIP-33 reference script deploy). Combines with the spend in one atomic tx. Significantly increases the output min-ADA — lovelaceAmount must cover the inflated requirement.'
337
+ @description: 'Optional Plutus V3 validator CBOR hex to attach as referenceScript on the primary recipient output (CIP-33 reference script deploy). Combines with the spend in one atomic tx. Significantly increases the output min-ADA; lovelaceAmount must cover the inflated requirement.'
349
338
  referenceScriptHex: String,
350
339
  @title: 'Validity Start (Posix ms)'
351
340
  @description: 'Optional. Sets the transaction validity-interval start in Posix milliseconds. Required finite value for Plutus validators that call expect Finite(lower) on tx.validity_range.lower_bound. Defaults to now − 120 000 ms when omitted.'
@@ -409,7 +398,15 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
409
398
  action GetTransactionBuildsByAddress(
410
399
  @title: 'Bech32 Address'
411
400
  @description: 'The Bech32 encoded address to retrieve transaction builds for'
412
- address: Bech32) returns array of AddressTransactionBuilds;
401
+ address: Bech32,
402
+ @title: 'Limit'
403
+ @description: 'Maximum number of rows (default 1000, at most 5000)'
404
+ @assert.range: [1, 5000]
405
+ limit: Integer,
406
+ @title: 'Skip'
407
+ @description: 'Number of rows to skip (default 0)'
408
+ @assert.range: [0, _]
409
+ skip: Integer) returns array of AddressTransactionBuilds;
413
410
 
414
411
  @title : 'Derive Script Address'
415
412
  @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.'
@@ -422,13 +419,14 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
422
419
  scriptParamsJson: String,
423
420
  @title: 'Network'
424
421
  @description: 'Optional network override (mainnet, preview, preprod). Defaults to the configured network.'
425
- network: String(10)) returns {
422
+ @assert.range
423
+ network: CardanoNetwork) returns {
426
424
  scriptAddress : String(120);
427
425
  scriptHash : String(56);
428
426
  };
429
427
 
430
428
  @title : 'Extract Payment Key Hash'
431
- @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.'
429
+ @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.'
432
430
  action ExtractPaymentKeyHash(
433
431
  @title: 'Address'
434
432
  @description: 'The Bech32 encoded Cardano address (addr / addr_test)'