@odatano/core 2.0.0-rc.26 → 2.0.0-rc.28

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.
@@ -109,6 +109,9 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
109
109
  @title: 'Force Inputs JSON'
110
110
  @description: 'Optional JSON array of {txHash, outputIndex} UTxOs that MUST be consumed as inputs. Added before coin selection. Use for one-shot minting seeds, token-carrying UTxOs, or deterministic input control.'
111
111
  forceInputsJson: String,
112
+ @title: 'Protect Inputs JSON'
113
+ @description: 'Optional JSON array of {txHash, outputIndex} UTxOs of the sender that must never be spent: left out of coin selection and collateral.'
114
+ protectInputsJson: String,
112
115
  @title: 'Validator Script'
113
116
  @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.'
114
117
  validatorScript: String,
@@ -217,6 +220,9 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
217
220
  @title: 'Force Inputs JSON'
218
221
  @description: 'Optional JSON array of {txHash, outputIndex} UTxOs that MUST be consumed as inputs. Added before coin selection. Use for one-shot minting seeds, token-carrying UTxOs, or deterministic input control.'
219
222
  forceInputsJson: String,
223
+ @title: 'Protect Inputs JSON'
224
+ @description: 'Optional JSON array of {txHash, outputIndex} UTxOs of the sender that must never be spent: left out of coin selection and collateral.'
225
+ protectInputsJson: String,
220
226
  @title: 'Reference Inputs JSON'
221
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.'
222
228
  referenceInputsJson: String,
@@ -308,6 +314,9 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
308
314
  @title: 'Force Inputs JSON'
309
315
  @description: 'Optional JSON array of {txHash, outputIndex} UTxOs that MUST be consumed as inputs. Added before coin selection. Use for one-shot minting seeds, token-carrying UTxOs, or deterministic input control.'
310
316
  forceInputsJson: String,
317
+ @title: 'Protect Inputs JSON'
318
+ @description: 'Optional JSON array of {txHash, outputIndex} UTxOs of the sender that must never be spent: left out of coin selection and collateral.'
319
+ protectInputsJson: String,
311
320
  @title: 'Extra Outputs JSON'
312
321
  @description: 'Optional JSON array of additional outputs appended after the primary recipient output, before change. Each entry: {address, lovelaceAmount, assets?: [{unit, quantity}], inlineDatumJson?, referenceScriptHex?}. Use for multi-output state-machine transitions (counter updates + batch NFT outputs) or per-output CIP-33 ref-script deploy. Each extra output is independently min-ADA checked.'
313
322
  extraOutputsJson: String,
@@ -352,8 +361,17 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
352
361
  @description: 'Optional JSON array of {txHash, outputIndex} read-only reference inputs; reference-script UTxOs of scriptInputsJson are added automatically.'
353
362
  referenceInputsJson: String,
354
363
  @title: 'Force Inputs JSON'
355
- @description: 'Optional JSON array of {txHash, outputIndex} UTxOs of the sender that must be consumed.'
364
+ @description: 'Optional JSON array of {txHash, outputIndex} UTxOs that must be consumed. A UTxO of another key address needs that address''s payment key hash in requiredSignersJson, and every unit it brings must be spent by outputsJson (nothing of it goes to the change); it is never collateral.'
356
365
  forceInputsJson: String,
366
+ @title: 'Protect Inputs JSON'
367
+ @description: 'Optional JSON array of {txHash, outputIndex} UTxOs of the sender that must never be spent: left out of coin selection and collateral.'
368
+ protectInputsJson: String,
369
+ @title: 'Withdrawals JSON'
370
+ @description: 'Optional JSON array, 1..16 entries: {rewardAddress, lovelace (0 allowed), stakingScript (CBOR hex) | referenceScript: {txHash, outputIndex}, scriptParamsJson?, redeemerJson | redeemerCbor}. With a script the withdrawal runs it under the Reward purpose (withdraw-zero pattern), without one the stake key signs. The reward account must be registered on chain.'
371
+ withdrawalsJson: String,
372
+ @title: 'Certificates JSON'
373
+ @description: 'Optional JSON array, 1..16 entries: {type: registerStake | deregisterStake, stakeAddress, deposit?, stakingScript (CBOR hex) | referenceScript: {txHash, outputIndex}, scriptParamsJson?, redeemerJson | redeemerCbor}. A registration without a script needs no witness (key or script credential); with a script it is the Conway deposit form and the script runs under the Certifying purpose. A deregistration of a script credential needs the script; of a key credential the key''s witness. The deposit is balanced by the builder.'
374
+ certificatesJson: String,
357
375
  @title: 'Required Signers JSON'
358
376
  @description: 'Optional JSON array of Ed25519 key hashes (hex, 28 bytes each) that must sign the transaction.'
359
377
  requiredSignersJson: String,
@@ -35,6 +35,11 @@ module.exports = (srv) => {
35
35
  return (0, errors_1.rejectInvalid)(req, 'BuildSimpleAdaTransaction', forceInputsResult.error, 'forceInputsJson');
36
36
  cleanData.forceInputs = forceInputsResult.parsed;
37
37
  delete cleanData.forceInputsJson;
38
+ const protectInputsResult = (0, tx_request_parsers_1.parseUtxoRefArray)(req.data.protectInputsJson, 'protectInputsJson');
39
+ if (protectInputsResult.error)
40
+ return (0, errors_1.rejectInvalid)(req, 'BuildSimpleAdaTransaction', protectInputsResult.error, 'protectInputsJson');
41
+ cleanData.protectInputs = protectInputsResult.parsed;
42
+ delete cleanData.protectInputsJson;
38
43
  if (outputDatumJson) {
39
44
  const jsonResult = (0, validators_1.validatePlutusJson)(outputDatumJson, 'outputDatumJson');
40
45
  if (!jsonResult.valid)
@@ -261,6 +266,10 @@ module.exports = (srv) => {
261
266
  if (forceInputsResult.error)
262
267
  return (0, errors_1.rejectInvalid)(req, 'BuildMintTransaction', forceInputsResult.error, 'forceInputsJson');
263
268
  const forceInputs = forceInputsResult.parsed;
269
+ const protectInputsResult = (0, tx_request_parsers_1.parseUtxoRefArray)(req.data.protectInputsJson, 'protectInputsJson');
270
+ if (protectInputsResult.error)
271
+ return (0, errors_1.rejectInvalid)(req, 'BuildMintTransaction', protectInputsResult.error, 'protectInputsJson');
272
+ const protectInputs = protectInputsResult.parsed;
264
273
  // CIP-31 reference inputs
265
274
  const refInputsResult = (0, tx_request_parsers_1.parseUtxoRefArray)(referenceInputsJson, 'referenceInputsJson');
266
275
  if (refInputsResult.error)
@@ -289,6 +298,7 @@ module.exports = (srv) => {
289
298
  delete cleanData.mintRedeemerJson;
290
299
  delete cleanData.lockOnScript;
291
300
  delete cleanData.forceInputsJson;
301
+ delete cleanData.protectInputsJson;
292
302
  delete cleanData.referenceInputsJson;
293
303
  delete cleanData.extraOutputsJson;
294
304
  if (parsedMetadata) {
@@ -350,6 +360,7 @@ module.exports = (srv) => {
350
360
  inlineDatum,
351
361
  mintRedeemer,
352
362
  forceInputs,
363
+ protectInputs,
353
364
  referenceInputs,
354
365
  extraOutputs
355
366
  });
@@ -421,6 +432,10 @@ module.exports = (srv) => {
421
432
  if (forceInputsResult.error)
422
433
  return (0, errors_1.rejectInvalid)(req, 'BuildPlutusSpendTransaction', forceInputsResult.error, 'forceInputsJson');
423
434
  const forceInputs = forceInputsResult.parsed;
435
+ const protectInputsResult = (0, tx_request_parsers_1.parseUtxoRefArray)(req.data.protectInputsJson, 'protectInputsJson');
436
+ if (protectInputsResult.error)
437
+ return (0, errors_1.rejectInvalid)(req, 'BuildPlutusSpendTransaction', protectInputsResult.error, 'protectInputsJson');
438
+ const protectInputs = protectInputsResult.parsed;
424
439
  // CIP-31 reference inputs
425
440
  const refInputsResult = (0, tx_request_parsers_1.parseUtxoRefArray)(referenceInputsJson, 'referenceInputsJson');
426
441
  if (refInputsResult.error)
@@ -571,6 +586,7 @@ module.exports = (srv) => {
571
586
  requiredSigners,
572
587
  inlineDatum,
573
588
  forceInputs,
589
+ protectInputs,
574
590
  referenceInputs,
575
591
  extraOutputs,
576
592
  mintActions: parsedMintActions,
@@ -585,6 +601,7 @@ module.exports = (srv) => {
585
601
  delete cleanData.inlineDatumJson;
586
602
  delete cleanData.lockOnScript;
587
603
  delete cleanData.forceInputsJson;
604
+ delete cleanData.protectInputsJson;
588
605
  delete cleanData.referenceInputsJson;
589
606
  delete cleanData.extraOutputsJson;
590
607
  delete cleanData.mintActionsJson;
@@ -617,7 +634,7 @@ module.exports = (srv) => {
617
634
  });
618
635
  // BuildPlutusTransaction — several script UTxOs in one transaction, each with its own redeemer.
619
636
  srv.on('BuildPlutusTransaction', async (req) => {
620
- const { senderAddress, changeAddress, scriptInputsJson, outputsJson, referenceInputsJson, forceInputsJson, requiredSignersJson, mintActionsJson, validityStartMs, validityEndMs } = req.data;
637
+ const { senderAddress, changeAddress, scriptInputsJson, outputsJson, referenceInputsJson, forceInputsJson, protectInputsJson, withdrawalsJson, certificatesJson, requiredSignersJson, mintActionsJson, validityStartMs, validityEndMs } = req.data;
621
638
  const action = 'BuildPlutusTransaction';
622
639
  const errors = (0, validators_1.validateTransactionInputs)({ senderAddress, validityStartMs, validityEndMs }, ['senderAddress']);
623
640
  (0, errors_1.throwIfValidationErrors)(req, action, errors);
@@ -640,6 +657,15 @@ module.exports = (srv) => {
640
657
  const forceInputsResult = (0, tx_request_parsers_1.parseUtxoRefArray)(forceInputsJson, 'forceInputsJson');
641
658
  if (forceInputsResult.error)
642
659
  return (0, errors_1.rejectInvalid)(req, action, forceInputsResult.error, 'forceInputsJson');
660
+ const protectInputsResult = (0, tx_request_parsers_1.parseUtxoRefArray)(protectInputsJson, 'protectInputsJson');
661
+ if (protectInputsResult.error)
662
+ return (0, errors_1.rejectInvalid)(req, action, protectInputsResult.error, 'protectInputsJson');
663
+ const withdrawalsResult = (0, tx_request_parsers_1.parseWithdrawals)(withdrawalsJson);
664
+ if (withdrawalsResult.error)
665
+ return (0, errors_1.rejectInvalid)(req, action, withdrawalsResult.error, 'withdrawalsJson');
666
+ const certificatesResult = (0, tx_request_parsers_1.parseCertificates)(certificatesJson);
667
+ if (certificatesResult.error)
668
+ return (0, errors_1.rejectInvalid)(req, action, certificatesResult.error, 'certificatesJson');
643
669
  const signersResult = (0, tx_request_parsers_1.parseRequiredSigners)(requiredSignersJson);
644
670
  if (signersResult.error)
645
671
  return (0, errors_1.rejectInvalid)(req, action, signersResult.error, 'requiredSignersJson');
@@ -669,6 +695,41 @@ module.exports = (srv) => {
669
695
  ...(si.datumCbor ? { datumCbor: si.datumCbor } : {}),
670
696
  });
671
697
  }
698
+ // Same for the staking scripts of withdrawals and certificates
699
+ const stakingWitness = (w, at, field) => {
700
+ let stakingScript = w.stakingScript;
701
+ if (stakingScript && w.scriptParams) {
702
+ try {
703
+ stakingScript = (0, tx_build_helper_1.applyScriptParameters)(stakingScript, w.scriptParams);
704
+ }
705
+ catch (err) {
706
+ const errMsg = err instanceof Error ? err.message : String(err);
707
+ return { error: (0, errors_1.rejectInvalid)(req, action, `${at}: failed to apply script parameters: ${errMsg}`, field) };
708
+ }
709
+ }
710
+ return {
711
+ parsed: {
712
+ ...(stakingScript ? { stakingScript } : {}),
713
+ ...(w.referenceScript ? { referenceScript: w.referenceScript } : {}),
714
+ ...(w.redeemer !== undefined ? { redeemer: w.redeemer } : {}),
715
+ ...(w.redeemerCbor ? { redeemerCbor: w.redeemerCbor } : {}),
716
+ },
717
+ };
718
+ };
719
+ const withdrawals = [];
720
+ for (const [i, w] of (withdrawalsResult.parsed ?? []).entries()) {
721
+ const witness = stakingWitness(w, `withdrawals[${i}]`, 'withdrawalsJson');
722
+ if ('error' in witness)
723
+ return witness.error;
724
+ withdrawals.push({ rewardAddress: w.rewardAddress, lovelace: w.lovelace, ...witness.parsed });
725
+ }
726
+ const certificates = [];
727
+ for (const [i, c] of (certificatesResult.parsed ?? []).entries()) {
728
+ const witness = stakingWitness(c, `certificates[${i}]`, 'certificatesJson');
729
+ if ('error' in witness)
730
+ return witness.error;
731
+ certificates.push({ type: c.type, stakeAddress: c.stakeAddress, ...(c.deposit ? { deposit: c.deposit } : {}), ...witness.parsed });
732
+ }
672
733
  const buildReq = {
673
734
  network: (0, server_1.getCardanoClient)().network,
674
735
  senderAddress,
@@ -677,6 +738,9 @@ module.exports = (srv) => {
677
738
  outputs: outputsResult.parsed,
678
739
  referenceInputs: refInputsResult.parsed,
679
740
  forceInputs: forceInputsResult.parsed,
741
+ protectInputs: protectInputsResult.parsed,
742
+ ...(withdrawals.length > 0 ? { withdrawals } : {}),
743
+ ...(certificates.length > 0 ? { certificates } : {}),
680
744
  requiredSigners: signersResult.parsed,
681
745
  mintActions: mintResult.parsed,
682
746
  validityStartMs,
@@ -891,13 +891,13 @@ annotate srv.Addresses with @(
891
891
  $Type : 'UI.ReferenceFacet',
892
892
  Label : 'Assets',
893
893
  Target : 'assets/@UI.LineItem',
894
- ![@UI.Hidden]: (not hasAssets)
894
+ @UI.Hidden: (not hasAssets)
895
895
  },
896
896
  {
897
897
  $Type : 'UI.ReferenceFacet',
898
898
  Label : 'UTxOs',
899
899
  Target : 'utxos/@UI.LineItem',
900
- ![@UI.Hidden]: (not hasUTxOs)
900
+ @UI.Hidden: (not hasUTxOs)
901
901
  }
902
902
  ],
903
903
 
@@ -1075,7 +1075,7 @@ annotate srv.AddressUTxOs with @(
1075
1075
  $Type : 'UI.ReferenceFacet',
1076
1076
  Label : 'Assets',
1077
1077
  Target : 'assets/@UI.LineItem',
1078
- ![@UI.Hidden]: (not hasAssets)
1078
+ @UI.Hidden: (not hasAssets)
1079
1079
  },
1080
1080
  {
1081
1081
  $Type : 'UI.ReferenceFacet',
@@ -1305,19 +1305,19 @@ annotate srv.Transactions with @(
1305
1305
  $Type : 'UI.ReferenceFacet',
1306
1306
  Label : 'Metadata',
1307
1307
  Target : 'metadata/@UI.LineItem',
1308
- ![@UI.Hidden]: (not hasMetadata)
1308
+ @UI.Hidden: (not hasMetadata)
1309
1309
  },
1310
1310
  {
1311
1311
  $Type : 'UI.ReferenceFacet',
1312
1312
  Label : 'Inputs',
1313
1313
  Target : 'inputs/@UI.LineItem',
1314
- ![@UI.Hidden]: (not hasInputs)
1314
+ @UI.Hidden: (not hasInputs)
1315
1315
  },
1316
1316
  {
1317
1317
  $Type : 'UI.ReferenceFacet',
1318
1318
  Label : 'Outputs',
1319
1319
  Target : 'outputs/@UI.LineItem',
1320
- ![@UI.Hidden]: (not hasOutputs)
1320
+ @UI.Hidden: (not hasOutputs)
1321
1321
  }
1322
1322
  ],
1323
1323
 
@@ -1451,7 +1451,7 @@ annotate srv.TransactionInputs with @(
1451
1451
  $Type : 'UI.ReferenceFacet',
1452
1452
  Label : 'Assets',
1453
1453
  Target : 'assets/@UI.LineItem',
1454
- ![@UI.Hidden]: (not hasAssets)
1454
+ @UI.Hidden: (not hasAssets)
1455
1455
  },
1456
1456
  {
1457
1457
  $Type : 'UI.ReferenceFacet',
@@ -1625,7 +1625,7 @@ annotate srv.TransactionOutputs with @(
1625
1625
  $Type : 'UI.ReferenceFacet',
1626
1626
  Label : 'Assets',
1627
1627
  Target : 'assets/@UI.LineItem',
1628
- ![@UI.Hidden]: (not hasAssets)
1628
+ @UI.Hidden: (not hasAssets)
1629
1629
  },
1630
1630
  {
1631
1631
  $Type : 'UI.ReferenceFacet',
@@ -1860,7 +1860,7 @@ annotate srv.Accounts with @(
1860
1860
  $Type : 'UI.ReferenceFacet',
1861
1861
  Label : 'Addresses',
1862
1862
  Target : 'Address/@UI.LineItem',
1863
- ![@UI.Hidden]: (not hasAddresses)
1863
+ @UI.Hidden: (not hasAddresses)
1864
1864
  }
1865
1865
  ],
1866
1866
 
@@ -2301,19 +2301,19 @@ annotate txsrv.TransactionBuilds with @(
2301
2301
  $Type : 'UI.ReferenceFacet',
2302
2302
  Label : 'Inputs',
2303
2303
  Target : 'inputs/@UI.LineItem',
2304
- ![@UI.Hidden]: (not hasInputs)
2304
+ @UI.Hidden: (not hasInputs)
2305
2305
  },
2306
2306
  {
2307
2307
  $Type : 'UI.ReferenceFacet',
2308
2308
  Label : 'Outputs',
2309
2309
  Target : 'outputs/@UI.LineItem',
2310
- ![@UI.Hidden]: (not hasOutputs)
2310
+ @UI.Hidden: (not hasOutputs)
2311
2311
  },
2312
2312
  {
2313
2313
  $Type : 'UI.ReferenceFacet',
2314
2314
  Label : 'Submission',
2315
2315
  Target : 'submission/@UI.FieldGroup#SubmissionDetails',
2316
- ![@UI.Hidden]: (not wasSubmitted)
2316
+ @UI.Hidden: (not wasSubmitted)
2317
2317
  }
2318
2318
  ],
2319
2319
 
@@ -2439,7 +2439,7 @@ annotate txsrv.TransactionBuildInputs with @(
2439
2439
  $Type : 'UI.ReferenceFacet',
2440
2440
  Label : 'Assets',
2441
2441
  Target : 'assets/@UI.LineItem',
2442
- ![@UI.Hidden]: (not hasAssets)
2442
+ @UI.Hidden: (not hasAssets)
2443
2443
  },
2444
2444
  {
2445
2445
  $Type : 'UI.ReferenceFacet',
@@ -2611,7 +2611,7 @@ annotate txsrv.TransactionBuildOutputs with @(
2611
2611
  $Type : 'UI.ReferenceFacet',
2612
2612
  Label : 'Assets',
2613
2613
  Target : 'assets/@UI.LineItem',
2614
- ![@UI.Hidden]: (not hasAssets)
2614
+ @UI.Hidden: (not hasAssets)
2615
2615
  },
2616
2616
  {
2617
2617
  $Type : 'UI.ReferenceFacet',
@@ -2796,13 +2796,13 @@ annotate txsrv.TransactionSubmissions with @(
2796
2796
  $Type : 'UI.ReferenceFacet',
2797
2797
  Label : 'Error Details',
2798
2798
  Target : '@UI.FieldGroup#ErrorDetails',
2799
- ![@UI.Hidden]: (not hasErrors)
2799
+ @UI.Hidden: (not hasErrors)
2800
2800
  },
2801
2801
  {
2802
2802
  $Type : 'UI.ReferenceFacet',
2803
2803
  Label : 'Errors',
2804
2804
  Target : 'errors/@UI.LineItem',
2805
- ![@UI.Hidden]: (not hasErrors)
2805
+ @UI.Hidden: (not hasErrors)
2806
2806
  }
2807
2807
  ],
2808
2808
 
package/srv/server.js CHANGED
@@ -37,6 +37,10 @@ const agent_grants_config_1 = require("./utils/agent-grants-config");
37
37
  const process_1 = require("process");
38
38
  const logger = cds_1.default.log('ODATANO');
39
39
  const VALID_NETWORKS = ['mainnet', 'preview', 'preprod'];
40
+ function coreCdsConfig() {
41
+ const requires = cds_1.default.env?.requires;
42
+ return requires?.['odatano-core'] ?? {};
43
+ }
40
44
  const VALID_BACKENDS = ['blockfrost', 'koios', 'ogmios', 'odatano'];
41
45
  const CRAWLER_LIMITS = {
42
46
  batchSize: { min: 1, max: 100 },
@@ -238,13 +242,14 @@ async function shutdownAppContext() {
238
242
  * @throws {ConfigError} if any value is invalid
239
243
  */
240
244
  function loadConfigFromEnv() {
241
- const cdsConfig = cds_1.default.env?.requires?.['odatano-core'] ?? {};
245
+ const cdsConfig = coreCdsConfig();
242
246
  const network = (cdsConfig.network || process_1.env.NETWORK || 'preview');
243
247
  if (!VALID_NETWORKS.includes(network)) {
244
248
  throw new errors_1.ConfigError(`Invalid NETWORK "${cdsConfig.network || process_1.env.NETWORK}". Must be one of: ${VALID_NETWORKS.join(', ')}`);
245
249
  }
246
- const backendStrings = cdsConfig.backends
247
- || (process_1.env.BACKENDS ? process_1.env.BACKENDS.split(',').map(b => b.trim()) : ['koios']);
250
+ const backendsRaw = cdsConfig.backends ?? process_1.env.BACKENDS;
251
+ const backendStrings = Array.isArray(backendsRaw) ? backendsRaw
252
+ : backendsRaw ? String(backendsRaw).split(',').map(b => b.trim()) : ['koios'];
248
253
  const invalidBackends = backendStrings.filter(b => !VALID_BACKENDS.includes(b));
249
254
  if (invalidBackends.length > 0) {
250
255
  throw new errors_1.ConfigError(`Invalid BACKENDS: "${invalidBackends.join(', ')}". Must be one of: ${VALID_BACKENDS.join(', ')}`);
@@ -315,7 +320,7 @@ function loadConfigFromEnv() {
315
320
  * Returns undefined when HSM is not enabled.
316
321
  */
317
322
  function loadHsmConfigFromEnv() {
318
- const cdsConfig = cds_1.default.env?.requires?.['odatano-core'] ?? {};
323
+ const cdsConfig = coreCdsConfig();
319
324
  const hsmCds = cdsConfig.hsm ?? {};
320
325
  const hsmEnabled = hsmCds.enabled === true || process_1.env.HSM_ENABLED === 'true';
321
326
  if (!hsmEnabled)
@@ -352,7 +357,7 @@ function loadHsmConfigFromEnv() {
352
357
  * Returns { enabled: false } when the crawler is off (the default).
353
358
  */
354
359
  function loadCrawlerConfigFromEnv() {
355
- const cdsConfig = cds_1.default.env?.requires?.['odatano-core'] ?? {};
360
+ const cdsConfig = coreCdsConfig();
356
361
  const c = cdsConfig.crawler ?? {};
357
362
  // A CDS value, including an explicit `false`, wins over the environment.
358
363
  const enabledRaw = c.enabled !== undefined ? c.enabled : process_1.env.CRAWLER_ENABLED;
@@ -440,7 +445,7 @@ const WALLET_WORKER_LIMITS = {
440
445
  * Returns { enabled: false } when the worker is off (the default).
441
446
  */
442
447
  function loadWalletWorkerConfigFromEnv() {
443
- const cdsConfig = cds_1.default.env?.requires?.['odatano-core'] ?? {};
448
+ const cdsConfig = coreCdsConfig();
444
449
  const w = cdsConfig.walletWorker ?? {};
445
450
  const enabledRaw = w.enabled !== undefined ? w.enabled : process_1.env.WALLET_WORKER_ENABLED;
446
451
  let enabled = false;
@@ -104,10 +104,13 @@ export declare const ED25519_KEY_HASH_HEX_LENGTH = 56;
104
104
  export declare const ED25519_KEY_HASH_REGEX: RegExp;
105
105
  /** Minimum lovelace for a change output carrying native assets (2 ADA) */
106
106
  export declare const MIN_CHANGE_LOVELACE = 2000000;
107
- /** Shelley genesis parameters per network for Buildooor's GenesisInfos (`TxBuilder.posixToSlot()`). */
107
+ /**
108
+ * Shelley genesis parameters per network for Buildooor's GenesisInfos (`TxBuilder.posixToSlot()`)
109
+ * and `slotToPosixSeconds()`. `systemStartPosixMs` is the first Shelley slot's wall-clock time.
110
+ */
108
111
  export declare const GENESIS_INFOS_BY_NETWORK: {
109
112
  readonly mainnet: {
110
- readonly systemStartPosixMs: 1596491091000;
113
+ readonly systemStartPosixMs: 1596059091000;
111
114
  readonly slotLengthMs: 1000;
112
115
  readonly startSlotNo: 4492800;
113
116
  };
@@ -83,9 +83,12 @@ exports.ED25519_KEY_HASH_HEX_LENGTH = 56;
83
83
  exports.ED25519_KEY_HASH_REGEX = /^[a-f0-9]{56}$/i;
84
84
  /** Minimum lovelace for a change output carrying native assets (2 ADA) */
85
85
  exports.MIN_CHANGE_LOVELACE = 2_000_000;
86
- /** Shelley genesis parameters per network for Buildooor's GenesisInfos (`TxBuilder.posixToSlot()`). */
86
+ /**
87
+ * Shelley genesis parameters per network for Buildooor's GenesisInfos (`TxBuilder.posixToSlot()`)
88
+ * and `slotToPosixSeconds()`. `systemStartPosixMs` is the first Shelley slot's wall-clock time.
89
+ */
87
90
  exports.GENESIS_INFOS_BY_NETWORK = {
88
- mainnet: { systemStartPosixMs: 1596491091000, slotLengthMs: 1000, startSlotNo: 4492800 },
91
+ mainnet: { systemStartPosixMs: 1596059091000, slotLengthMs: 1000, startSlotNo: 4492800 }, // 2020-07-29T21:44:51Z
89
92
  preprod: { systemStartPosixMs: 1655683200000, slotLengthMs: 1000, startSlotNo: 0 },
90
93
  preview: { systemStartPosixMs: 1666656000000, slotLengthMs: 1000, startSlotNo: 0 },
91
94
  };
@@ -17,7 +17,6 @@ function packageVersion() {
17
17
  return cachedVersion;
18
18
  try {
19
19
  // srv/utils → package root; the in-place build keeps this path in plugin mode too.
20
- // eslint-disable-next-line @typescript-eslint/no-var-requires
21
20
  const pkg = require(path_1.default.resolve(__dirname, '..', '..', 'package.json'));
22
21
  cachedVersion = String(pkg.version ?? '');
23
22
  }
@@ -31,7 +31,6 @@ async function drain(stream) {
31
31
  function installPostgresInlineJson() {
32
32
  let PostgresService;
33
33
  try {
34
- // eslint-disable-next-line @typescript-eslint/no-require-imports
35
34
  PostgresService = require('@cap-js/postgres/lib/PostgresService');
36
35
  }
37
36
  catch (err) {
@@ -29,7 +29,6 @@ function stripNullsForNotNull(orderBy, rendered) {
29
29
  function installPostgresOrderNulls() {
30
30
  let PostgresService;
31
31
  try {
32
- // eslint-disable-next-line @typescript-eslint/no-require-imports
33
32
  PostgresService = require('@cap-js/postgres/lib/PostgresService');
34
33
  }
35
34
  catch (err) {
@@ -1,5 +1,5 @@
1
1
  import type { JSONValue, MintAction } from './types';
2
- export declare function parseUtxoRefArray(json: string | undefined, fieldName: 'forceInputsJson' | 'referenceInputsJson'): {
2
+ export declare function parseUtxoRefArray(json: string | undefined, fieldName: 'forceInputsJson' | 'referenceInputsJson' | 'protectInputsJson'): {
3
3
  parsed?: Array<{
4
4
  txHash: string;
5
5
  outputIndex: number;
@@ -81,6 +81,47 @@ export declare function parseScriptInputs(json: string | undefined): {
81
81
  parsed?: ParsedScriptInput[];
82
82
  error?: string;
83
83
  };
84
+ /** Upper bound on withdrawals per BuildPlutusTransaction. */
85
+ export declare const MAX_WITHDRAWALS = 16;
86
+ /** One withdrawal of a BuildPlutusTransaction, validated; `stakingScript` still without params applied. */
87
+ export interface ParsedWithdrawal {
88
+ rewardAddress: string;
89
+ lovelace: string;
90
+ stakingScript?: string;
91
+ scriptParams?: JSONValue[];
92
+ referenceScript?: {
93
+ txHash: string;
94
+ outputIndex: number;
95
+ };
96
+ redeemer?: JSONValue;
97
+ redeemerCbor?: string;
98
+ }
99
+ /**
100
+ * Parse and validate withdrawalsJson: distinct reward accounts, lovelace >= 0, optionally a staking
101
+ * script (inline or by reference) with exactly one redeemer form; without a script no redeemer.
102
+ */
103
+ export declare function parseWithdrawals(json: string | undefined): {
104
+ parsed?: ParsedWithdrawal[];
105
+ error?: string;
106
+ };
107
+ /** Optional staking script (inline with params, or by reference) plus its redeemer, shared by withdrawals and certificates. */
108
+ type ParsedStakingScriptWitness = Pick<ParsedWithdrawal, 'stakingScript' | 'scriptParams' | 'referenceScript' | 'redeemer' | 'redeemerCbor'>;
109
+ /** Upper bound on certificates per BuildPlutusTransaction. */
110
+ export declare const MAX_CERTIFICATES = 16;
111
+ /** One certificate of a BuildPlutusTransaction, validated; `stakingScript` still without params applied. */
112
+ export interface ParsedCertificate extends ParsedStakingScriptWitness {
113
+ type: 'registerStake' | 'deregisterStake';
114
+ stakeAddress: string;
115
+ deposit?: string;
116
+ }
117
+ /**
118
+ * Parse and validate certificatesJson: stake registrations and deregistrations, each with an
119
+ * optional staking script (inline or by reference) and exactly one redeemer form when scripted.
120
+ */
121
+ export declare function parseCertificates(json: string | undefined): {
122
+ parsed?: ParsedCertificate[];
123
+ error?: string;
124
+ };
84
125
  /**
85
126
  * Parse mintActionsJson for BuildPlutusTransaction: every action carries its own `mintingPolicyScript`
86
127
  * (no request-level default) and optional `redeemerJson`; `assetUnit` is policyId+assetName, or a bare
@@ -90,4 +131,5 @@ export declare function parsePolicyMintActions(json: string | undefined): {
90
131
  parsed?: MintAction[];
91
132
  error?: string;
92
133
  };
134
+ export {};
93
135
  //# sourceMappingURL=tx-request-parsers.d.ts.map