@odatano/core 2.0.0-rc.5 → 2.0.0-rc.51

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 (239) hide show
  1. package/@cds-models/CardanoAgentService/index.d.ts +99 -51
  2. package/@cds-models/CardanoAgentService/index.js +15 -0
  3. package/@cds-models/CardanoBackendService/index.d.ts +358 -0
  4. package/@cds-models/CardanoBackendService/index.js +41 -0
  5. package/@cds-models/CardanoIndexerService/index.d.ts +594 -11
  6. package/@cds-models/CardanoIndexerService/index.js +74 -0
  7. package/@cds-models/CardanoODataService/index.d.ts +417 -57
  8. package/@cds-models/CardanoODataService/index.js +42 -0
  9. package/@cds-models/CardanoSignService/index.d.ts +45 -19
  10. package/@cds-models/CardanoSignService/index.js +4 -0
  11. package/@cds-models/CardanoTransactionService/index.d.ts +70 -44
  12. package/@cds-models/CardanoTransactionService/index.js +5 -0
  13. package/@cds-models/CardanoWorkerService/index.d.ts +35 -22
  14. package/@cds-models/CardanoWorkerService/index.js +2 -0
  15. package/@cds-models/index.d.ts +114 -4
  16. package/@cds-models/index.js +20 -4
  17. package/@cds-models/odatano/cardano/index.d.ts +451 -32
  18. package/@cds-models/odatano/cardano/index.js +48 -0
  19. package/README.md +103 -167
  20. package/db/schema.cds +2455 -1705
  21. package/db/types.cds +456 -295
  22. package/package.json +41 -53
  23. package/scripts/deploy-schema.mjs +113 -0
  24. package/scripts/migrate-schema.mjs +528 -0
  25. package/scripts/migrate-slot-leader.mjs +96 -0
  26. package/src/index.d.ts +20 -21
  27. package/src/index.js +45 -31
  28. package/src/plugin.js +17 -35
  29. package/srv/blockchain/asset-decimals.d.ts +7 -0
  30. package/srv/blockchain/asset-decimals.js +91 -0
  31. package/srv/blockchain/backends/blockfrost-backend.d.ts +25 -137
  32. package/srv/blockchain/backends/blockfrost-backend.js +125 -215
  33. package/srv/blockchain/backends/call-signal.d.ts +7 -0
  34. package/srv/blockchain/backends/call-signal.js +22 -0
  35. package/srv/blockchain/backends/cardano-backend.d.ts +100 -189
  36. package/srv/blockchain/backends/cardano-backend.js +29 -5
  37. package/srv/blockchain/backends/koios-backend.d.ts +108 -170
  38. package/srv/blockchain/backends/koios-backend.js +488 -482
  39. package/srv/blockchain/backends/odatano-backend.d.ts +55 -0
  40. package/srv/blockchain/backends/odatano-backend.js +211 -0
  41. package/srv/blockchain/backends/ogmios-backend.d.ts +122 -190
  42. package/srv/blockchain/backends/ogmios-backend.js +683 -327
  43. package/srv/blockchain/backends/ogmios-frame-guard.d.ts +14 -0
  44. package/srv/blockchain/backends/ogmios-frame-guard.js +89 -0
  45. package/srv/blockchain/cardano-client.d.ts +71 -241
  46. package/srv/blockchain/cardano-client.js +354 -322
  47. package/srv/blockchain/cardano-indexer.d.ts +295 -283
  48. package/srv/blockchain/cardano-indexer.js +1690 -502
  49. package/srv/blockchain/cardano-tx-builder.d.ts +25 -89
  50. package/srv/blockchain/cardano-tx-builder.js +164 -140
  51. package/srv/blockchain/circuit-breaker.d.ts +2 -13
  52. package/srv/blockchain/circuit-breaker.js +11 -15
  53. package/srv/blockchain/crawler/account-snapshots.d.ts +29 -0
  54. package/srv/blockchain/crawler/account-snapshots.js +173 -0
  55. package/srv/blockchain/crawler/asset-decimals-backfill.d.ts +17 -0
  56. package/srv/blockchain/crawler/asset-decimals-backfill.js +56 -0
  57. package/srv/blockchain/crawler/asset-registry-backfill.d.ts +46 -0
  58. package/srv/blockchain/crawler/asset-registry-backfill.js +157 -0
  59. package/srv/blockchain/crawler/asset-slice-backfill.d.ts +35 -0
  60. package/srv/blockchain/crawler/asset-slice-backfill.js +149 -0
  61. package/srv/blockchain/crawler/certificate-backfill.d.ts +56 -0
  62. package/srv/blockchain/crawler/certificate-backfill.js +174 -0
  63. package/srv/blockchain/crawler/crawler.d.ts +125 -81
  64. package/srv/blockchain/crawler/crawler.js +738 -167
  65. package/srv/blockchain/crawler/credential-backfill.d.ts +30 -0
  66. package/srv/blockchain/crawler/credential-backfill.js +101 -0
  67. package/srv/blockchain/crawler/hooks.d.ts +2 -17
  68. package/srv/blockchain/crawler/index.d.ts +1 -8
  69. package/srv/blockchain/crawler/index.js +31 -17
  70. package/srv/blockchain/crawler/input-asset-copies.d.ts +34 -0
  71. package/srv/blockchain/crawler/input-asset-copies.js +161 -0
  72. package/srv/blockchain/crawler/key-pages.d.ts +12 -0
  73. package/srv/blockchain/crawler/key-pages.js +48 -0
  74. package/srv/blockchain/crawler/metadata-position-backfill.d.ts +22 -0
  75. package/srv/blockchain/crawler/metadata-position-backfill.js +59 -0
  76. package/srv/blockchain/crawler/output-datum-backfill.d.ts +41 -0
  77. package/srv/blockchain/crawler/output-datum-backfill.js +100 -0
  78. package/srv/blockchain/crawler/sync-state.d.ts +31 -47
  79. package/srv/blockchain/crawler/sync-state.js +135 -128
  80. package/srv/blockchain/crawler/transaction-backfill.d.ts +46 -0
  81. package/srv/blockchain/crawler/transaction-backfill.js +271 -0
  82. package/srv/blockchain/crawler/utxo-set-import.d.ts +66 -0
  83. package/srv/blockchain/crawler/utxo-set-import.js +399 -0
  84. package/srv/blockchain/crawler/window-plan.d.ts +31 -0
  85. package/srv/blockchain/crawler/window-plan.js +59 -0
  86. package/srv/blockchain/ledger-state.d.ts +62 -0
  87. package/srv/blockchain/ledger-state.js +521 -0
  88. package/srv/blockchain/pending-spends.d.ts +16 -0
  89. package/srv/blockchain/pending-spends.js +81 -0
  90. package/srv/blockchain/pool-metadata.d.ts +15 -0
  91. package/srv/blockchain/pool-metadata.js +132 -0
  92. package/srv/blockchain/request-coalescer.d.ts +2 -16
  93. package/srv/blockchain/request-coalescer.js +2 -16
  94. package/srv/blockchain/signing/cose-verifier.d.ts +3 -17
  95. package/srv/blockchain/signing/cose-verifier.js +146 -70
  96. package/srv/blockchain/signing/external-signer.d.ts +15 -115
  97. package/srv/blockchain/signing/external-signer.js +22 -131
  98. package/srv/blockchain/signing/failed-recheck.d.ts +17 -0
  99. package/srv/blockchain/signing/failed-recheck.js +135 -0
  100. package/srv/blockchain/signing/hsm-signer.d.ts +10 -54
  101. package/srv/blockchain/signing/hsm-signer.js +28 -79
  102. package/srv/blockchain/signing/landing-proof.d.ts +60 -0
  103. package/srv/blockchain/signing/landing-proof.js +224 -0
  104. package/srv/blockchain/signing/signature-verifier.d.ts +9 -47
  105. package/srv/blockchain/signing/signature-verifier.js +71 -87
  106. package/srv/blockchain/signing/submission-finalizer.d.ts +37 -45
  107. package/srv/blockchain/signing/submission-finalizer.js +280 -86
  108. package/srv/blockchain/stored-chain.d.ts +19 -0
  109. package/srv/blockchain/stored-chain.js +258 -0
  110. package/srv/blockchain/transaction-building/buildooor-tx.d.ts +31 -229
  111. package/srv/blockchain/transaction-building/buildooor-tx.js +663 -421
  112. package/srv/blockchain/transaction-building/cardano-tx.d.ts +9 -37
  113. package/srv/blockchain/transaction-presence.d.ts +12 -0
  114. package/srv/blockchain/transaction-presence.js +29 -0
  115. package/srv/blockchain/transaction-rows.d.ts +12 -0
  116. package/srv/blockchain/transaction-rows.js +44 -0
  117. package/srv/blockchain/wallet-worker/build-request.d.ts +8 -23
  118. package/srv/blockchain/wallet-worker/build-request.js +40 -353
  119. package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +27 -47
  120. package/srv/blockchain/wallet-worker/confirmation-tracker.js +158 -61
  121. package/srv/blockchain/wallet-worker/index.d.ts +1 -1
  122. package/srv/blockchain/wallet-worker/index.js +3 -11
  123. package/srv/blockchain/wallet-worker/invalidation.d.ts +35 -0
  124. package/srv/blockchain/wallet-worker/invalidation.js +128 -0
  125. package/srv/blockchain/wallet-worker/job-store.d.ts +58 -150
  126. package/srv/blockchain/wallet-worker/job-store.js +200 -273
  127. package/srv/blockchain/wallet-worker/lease-heartbeat.d.ts +2 -26
  128. package/srv/blockchain/wallet-worker/lease-heartbeat.js +6 -28
  129. package/srv/blockchain/wallet-worker/signers.d.ts +5 -24
  130. package/srv/blockchain/wallet-worker/signers.js +4 -12
  131. package/srv/blockchain/wallet-worker/wallet-worker.d.ts +29 -82
  132. package/srv/blockchain/wallet-worker/wallet-worker.js +334 -198
  133. package/srv/cardano-agent-service.cds +122 -84
  134. package/srv/cardano-agent-service.js +12 -9
  135. package/srv/cardano-backend-service.cds +81 -0
  136. package/srv/cardano-backend-service.d.ts +2 -0
  137. package/srv/cardano-backend-service.js +259 -0
  138. package/srv/cardano-indexer-service.cds +393 -18
  139. package/srv/cardano-indexer-service.d.ts +5 -1
  140. package/srv/cardano-indexer-service.js +477 -16
  141. package/srv/cardano-service.cds +426 -269
  142. package/srv/cardano-service.js +640 -217
  143. package/srv/cardano-sign-service.cds +211 -180
  144. package/srv/cardano-sign-service.js +210 -287
  145. package/srv/cardano-tx-service.cds +462 -370
  146. package/srv/cardano-tx-service.js +283 -800
  147. package/srv/cardano-ui.cds +16 -16
  148. package/srv/cardano-worker-service.cds +141 -125
  149. package/srv/cardano-worker-service.js +104 -61
  150. package/srv/cbor/cip68.d.ts +13 -0
  151. package/srv/cbor/cip68.js +56 -0
  152. package/srv/cbor/index.d.ts +3 -1
  153. package/srv/cbor/index.js +9 -1
  154. package/srv/cbor/parse.d.ts +30 -18
  155. package/srv/cbor/parse.js +44 -9
  156. package/srv/cbor/plutus-data-json.d.ts +20 -0
  157. package/srv/cbor/plutus-data-json.js +32 -0
  158. package/srv/config.d.ts +117 -0
  159. package/srv/config.js +419 -0
  160. package/srv/server.d.ts +15 -110
  161. package/srv/server.js +83 -405
  162. package/srv/utils/agent-access.d.ts +11 -0
  163. package/srv/utils/agent-access.js +86 -0
  164. package/srv/utils/agent-grants-config.d.ts +0 -46
  165. package/srv/utils/agent-grants-config.js +17 -85
  166. package/srv/utils/agent-grants.d.ts +106 -122
  167. package/srv/utils/agent-grants.js +538 -237
  168. package/srv/utils/agent-token-auth.d.ts +4 -99
  169. package/srv/utils/agent-token-auth.js +62 -186
  170. package/srv/utils/backend-request-handler.d.ts +3 -17
  171. package/srv/utils/backend-request-handler.js +3 -18
  172. package/srv/utils/build-request.d.ts +52 -0
  173. package/srv/utils/build-request.js +487 -0
  174. package/srv/utils/collections.d.ts +4 -10
  175. package/srv/utils/collections.js +14 -10
  176. package/srv/utils/const.d.ts +32 -75
  177. package/srv/utils/const.js +40 -80
  178. package/srv/utils/crypto.d.ts +3 -12
  179. package/srv/utils/crypto.js +11 -25
  180. package/srv/utils/db-indexes.d.ts +31 -0
  181. package/srv/utils/db-indexes.js +185 -0
  182. package/srv/utils/db-kind.d.ts +23 -0
  183. package/srv/utils/db-kind.js +42 -0
  184. package/srv/utils/db-sanitize.d.ts +20 -0
  185. package/srv/utils/db-sanitize.js +80 -0
  186. package/srv/utils/deep-json.d.ts +6 -0
  187. package/srv/utils/deep-json.js +240 -0
  188. package/srv/utils/detached-run.d.ts +41 -0
  189. package/srv/utils/detached-run.js +101 -0
  190. package/srv/utils/epoch-slots.d.ts +14 -0
  191. package/srv/utils/epoch-slots.js +45 -0
  192. package/srv/utils/error-codes.d.ts +26 -75
  193. package/srv/utils/error-codes.js +27 -72
  194. package/srv/utils/errors.d.ts +55 -187
  195. package/srv/utils/errors.js +161 -235
  196. package/srv/utils/lease.d.ts +20 -0
  197. package/srv/utils/lease.js +62 -0
  198. package/srv/utils/liveness.d.ts +12 -0
  199. package/srv/utils/liveness.js +35 -0
  200. package/srv/utils/mappers.d.ts +111 -223
  201. package/srv/utils/mappers.js +432 -371
  202. package/srv/utils/navigation.d.ts +17 -0
  203. package/srv/utils/navigation.js +52 -0
  204. package/srv/utils/network-context.d.ts +0 -1
  205. package/srv/utils/network-context.js +9 -15
  206. package/srv/utils/paging.d.ts +31 -0
  207. package/srv/utils/paging.js +43 -0
  208. package/srv/utils/pg-inline-json.d.ts +8 -0
  209. package/srv/utils/pg-inline-json.js +58 -0
  210. package/srv/utils/pg-order-nulls.d.ts +14 -0
  211. package/srv/utils/pg-order-nulls.js +54 -0
  212. package/srv/utils/plutus-placeholders.d.ts +16 -22
  213. package/srv/utils/plutus-placeholders.js +62 -33
  214. package/srv/utils/rate-limiter.d.ts +2 -21
  215. package/srv/utils/rate-limiter.js +5 -17
  216. package/srv/utils/readiness.d.ts +12 -0
  217. package/srv/utils/readiness.js +29 -0
  218. package/srv/utils/reference-script.d.ts +19 -0
  219. package/srv/utils/reference-script.js +84 -0
  220. package/srv/utils/resolution.d.ts +13 -0
  221. package/srv/utils/resolution.js +47 -0
  222. package/srv/utils/result-numbers.d.ts +15 -0
  223. package/srv/utils/result-numbers.js +61 -0
  224. package/srv/utils/row-values.d.ts +7 -0
  225. package/srv/utils/row-values.js +27 -0
  226. package/srv/utils/service-events.d.ts +0 -24
  227. package/srv/utils/service-events.js +3 -25
  228. package/srv/utils/signing-helper.d.ts +3 -20
  229. package/srv/utils/signing-helper.js +35 -64
  230. package/srv/utils/tx-build-helper.d.ts +25 -105
  231. package/srv/utils/tx-build-helper.js +108 -156
  232. package/srv/utils/tx-request-parsers.d.ts +82 -33
  233. package/srv/utils/tx-request-parsers.js +401 -49
  234. package/srv/utils/tx-utils.d.ts +3 -27
  235. package/srv/utils/tx-utils.js +32 -50
  236. package/srv/utils/types.d.ts +294 -232
  237. package/srv/utils/types.js +2 -22
  238. package/srv/utils/validators.d.ts +22 -92
  239. package/srv/utils/validators.js +60 -170
@@ -1,44 +1,36 @@
1
1
  import { LedgerProtocolParameter } from "#cds-models/odatano/cardano";
2
- /**
3
- * Hex-encoded string (lower/upper-case depending on source)
4
- */
2
+ import type { ReferenceScriptType } from "./reference-script";
3
+ import type { SigningStatus } from '../../@cds-models';
4
+ export type { ReferenceScriptType };
5
+ /** Hex-encoded string (case depends on source) */
5
6
  export type Hex = string;
6
- /**
7
- * Lovelace amount (integer) - represented as string to preserve precision for values > Number.MAX_SAFE_INTEGER.
8
- * Cardano max supply = 45B ADA = 45,000,000,000,000,000 lovelace (exceeds MAX_SAFE_INTEGER).
9
- * Provider APIs (Blockfrost, Koios) return lovelace as strings. Harmonic Labs uses bigint internally.
10
- */
7
+ /** Lovelace amount; a string preserves precision above Number.MAX_SAFE_INTEGER (max supply is 4.5e16). */
11
8
  export type Lovelace = number | string;
12
- /**
13
- * JSON Value Type - Represents any valid JSON value
14
- */
15
- export type JSONValue = string | number | boolean | {
9
+ /** Any JSON value; an integer literal too long for a double is read as bigint */
10
+ export type JSONValue = string | number | bigint | boolean | {
16
11
  [key: string]: JSONValue;
17
12
  } | JSONValue[] | null;
18
- /**
19
- * Amount Data Structure Type - Multi-asset amount line as returned by common Cardano APIs
20
- */
13
+ /** Multi-asset amount line as returned by common Cardano APIs */
21
14
  export interface Amount {
22
15
  unit: string;
23
16
  quantity: string;
24
17
  }
25
- /**
26
- * Transaction Input Data Structure Type
27
- */
18
+ /** Transaction input */
28
19
  export interface TxInputLine {
29
20
  address: string;
30
21
  amount: Amount[];
31
22
  txHash: Hex;
32
23
  outputIndex: number;
24
+ spentTxSeq?: number | null;
33
25
  dataHash?: Hex | null;
34
26
  inlineDatum?: string | null;
35
27
  referenceScriptHash?: Hex | null;
28
+ referenceScriptSize?: number | null;
29
+ referenceScriptType?: ReferenceScriptType | null;
36
30
  isCollateral?: boolean;
37
31
  isReference?: boolean;
38
32
  }
39
- /**
40
- * Transaction Output Data Structure Type
41
- */
33
+ /** Transaction output */
42
34
  export interface TxOutputLine {
43
35
  address: string;
44
36
  amount: Amount[];
@@ -48,18 +40,72 @@ export interface TxOutputLine {
48
40
  inlineDatum: string | null;
49
41
  isCollateral: boolean;
50
42
  referenceScriptHash?: Hex | null;
43
+ referenceScriptSize?: number | null;
44
+ referenceScriptType?: ReferenceScriptType | null;
51
45
  }
52
- /**
53
- * Transaction Data Structure Type - Normalized transaction structure
54
- */
46
+ export type CertificateKind = 'stake_registration' | 'stake_deregistration' | 'pool_delegation' | 'vote_delegation' | 'pool_registration' | 'pool_retirement' | 'drep_registration' | 'drep_update' | 'drep_retirement' | 'committee_hot_auth' | 'committee_resign' | 'genesis_delegation' | 'treasury_mir' | 'reserve_mir' | 'pot_transfer' | 'param_proposal' | (string & {});
47
+ /** One certificate of a transaction (crawler ledger-state coverage). */
48
+ export interface TxCertificate {
49
+ /** Position in the transaction's certificate list as the source reports it. */
50
+ certIndex: number;
51
+ kind: CertificateKind;
52
+ /** Reward account (bech32) the certificate concerns, when it has one. */
53
+ stakeAddress?: string | null;
54
+ /** Stake pool (bech32) for delegation / registration / retirement. */
55
+ poolId?: string | null;
56
+ /** DRep (CIP-129 bech32), or `drep_always_abstain` / `drep_always_no_confidence`. */
57
+ drepId?: string | null;
58
+ /** Deposit paid or refunded, lovelace as string. */
59
+ deposit?: Lovelace | string | null;
60
+ /** Retirement epoch of a pool retirement. */
61
+ epoch?: number | null;
62
+ }
63
+ /** One reward-account withdrawal of a transaction. */
64
+ export interface TxWithdrawal {
65
+ stakeAddress: string;
66
+ /** Lovelace as string. */
67
+ amount: Lovelace | string;
68
+ }
69
+ /** One redeemer of a transaction. */
70
+ export interface TxRedeemer {
71
+ /** spend | mint | publish | withdraw | vote | propose */
72
+ purpose: string;
73
+ /** Index within its purpose, as the ledger counts it. */
74
+ index: number;
75
+ /** PlutusData CBOR hex. */
76
+ data: string;
77
+ mem: string;
78
+ steps: string;
79
+ /** spend: the redeemed input. */
80
+ txHash?: Hex | null;
81
+ outputIndex?: number | null;
82
+ /** mint: the policy. */
83
+ policyId?: Hex | null;
84
+ }
85
+ /** One datum of a transaction witness set. */
86
+ export interface TxDatum {
87
+ /** Blake2b-256 of the datum bytes. */
88
+ hash: Hex;
89
+ /** PlutusData CBOR hex, the original bytes. */
90
+ cbor: string;
91
+ }
92
+ /** Normalized transaction */
55
93
  export interface Transaction {
56
94
  hash: Hex;
57
95
  blockHash: Hex;
58
96
  blockHeight: number;
59
97
  slot: number;
60
98
  index: number;
99
+ /** What the ledger charged: the declared fee, or on a phase-2 failure the collateral consumed. */
61
100
  fee: Lovelace | string;
62
- deposit: Lovelace | string;
101
+ /** Deposits locked minus deposits refunded; null while the source could not tell. */
102
+ deposit: Lovelace | string | null;
103
+ /** Lovelace donated to the treasury; only set by sources that report it. */
104
+ treasuryDonation?: string | null;
105
+ /** True when phase 2 failed and only collateral was consumed. Undefined when the source does not report it. */
106
+ spendsCollaterals?: boolean;
107
+ totalCollateral?: Lovelace | string | null;
108
+ mint?: Amount[];
63
109
  /** Tx size in bytes; null when the source cannot provide it (Ogmios chain-sync). */
64
110
  size: number | null;
65
111
  blockTime: number;
@@ -67,10 +113,16 @@ export interface Transaction {
67
113
  inputs: TxInputLine[];
68
114
  outputs: TxOutputLine[];
69
115
  metadata?: MetadataLabelTx[];
116
+ /** Certificates; `[]` when the tx has none, undefined when the source does not report them (Blockfrost). */
117
+ certificates?: TxCertificate[];
118
+ /** Reward-account withdrawals; same `[]` vs undefined convention as `certificates`. */
119
+ withdrawals?: TxWithdrawal[];
120
+ /** Redeemers; `[]` when the tx has none, undefined when the source does not report them (Blockfrost, Koios). */
121
+ redeemers?: TxRedeemer[];
122
+ /** Witness-set datums; same `[]` vs undefined convention as `redeemers`. */
123
+ datums?: TxDatum[];
70
124
  }
71
- /**
72
- * Address Data Structure Type - Address view, including current value and known UTxOs
73
- */
125
+ /** Address view with current value and known UTxOs */
74
126
  export interface Address {
75
127
  address: string;
76
128
  stakeAddress: string | null;
@@ -80,9 +132,7 @@ export interface Address {
80
132
  utxos: UTxO[];
81
133
  transactions?: Transaction[];
82
134
  }
83
- /**
84
- * UTxO Data Structure Type - Unspent transaction outputs (UTxOs)
85
- */
135
+ /** Unspent transaction output */
86
136
  export interface UTxO {
87
137
  txHash: Hex;
88
138
  outputIndex: number;
@@ -91,11 +141,14 @@ export interface UTxO {
91
141
  blockHash?: Hex;
92
142
  datumHash?: Hex | null;
93
143
  scriptRef?: Hex | null;
144
+ /** Full CBOR of the reference script (Plutus) when the source delivers it; builder use only. */
145
+ scriptRefCbor?: Hex | null;
146
+ /** Bytes the ledger charges for the reference script; null when the source reports the hash only. */
147
+ scriptRefSize?: number | null;
148
+ scriptRefType?: ReferenceScriptType | null;
94
149
  inlineDatum?: string | null;
95
150
  }
96
- /**
97
- * Block Data Structure Type - Basic block information structure
98
- */
151
+ /** Basic block information */
99
152
  export interface BlockData {
100
153
  time: number;
101
154
  height: number | null;
@@ -107,94 +160,99 @@ export interface BlockData {
107
160
  size: number;
108
161
  txCount: number;
109
162
  fees?: string | null;
163
+ /** Hash of the block before this one; undefined when the source does not report it. */
164
+ previousHash?: string | null;
165
+ /** Header fields only (ledger tip): size, txCount, fees and slotLeader are placeholders, not block data. */
166
+ headerOnly?: boolean;
110
167
  }
111
- /**
112
- * Supply Data Structure Type - Network supply information
113
- */
168
+ /** Network supply */
169
+ /** Network supply in lovelace; null = the backend does not report the figure. */
114
170
  export interface Supply {
115
171
  max: string;
116
- total: string;
117
- circulating: string;
118
- locked: string;
119
- treasury: string;
120
- reserves: string;
121
- }
122
- /**
123
- * Stake Data Structure Type - Network stake information
124
- */
172
+ total: string | null;
173
+ circulating: string | null;
174
+ locked: string | null;
175
+ treasury: string | null;
176
+ reserves: string | null;
177
+ }
178
+ /** Network stake in lovelace; null = the backend does not report the figure. */
125
179
  export interface Stake {
126
- live: string;
127
- active: string;
180
+ live: string | null;
181
+ active: string | null;
128
182
  }
129
- /**
130
- * Network Information Data Structure Type - Network supply and stake information
131
- */
183
+ /** Network supply and stake */
132
184
  export interface NetworkInformation {
133
185
  supply: Supply;
134
186
  stake: Stake;
135
187
  }
136
- /**
137
- * Epoch Data Structure Type - Epoch information
138
- */
188
+ /** Epoch information */
139
189
  export interface EpochData {
140
190
  epoch: number;
141
191
  start_time: number;
142
192
  end_time: number;
143
- first_block_time: number;
193
+ first_block_time: number | null;
144
194
  last_block_time: number;
145
- block_count: number;
146
- tx_count: number;
147
- output: string;
148
- fees: string;
195
+ block_count: number | null;
196
+ tx_count: number | null;
197
+ output: string | null;
198
+ fees: string | null;
149
199
  active_stake: string | null;
150
200
  }
151
- /**
152
- * Metadata Label Transaction Data Structure Type - Transaction metadata under a specific label
153
- */
201
+ /** Transaction metadata under one label */
154
202
  export interface MetadataLabelTx {
155
203
  txHash: Hex;
156
204
  label: number | string;
157
205
  json?: JSONValue;
158
206
  }
159
- /**
160
- * Account Data Structure Type - Stake account information
161
- */
207
+ /** Stake account information */
162
208
  export interface AccountData {
163
209
  stakeaddress: string;
164
210
  active: boolean;
165
- activeEpoch: number;
166
- controlledAmount: string;
167
- rewardsSum: string;
168
- withdrawalsSum: string;
169
- reservesSum: string;
170
- treasurySum: string;
171
- withdrawableAmount: string;
211
+ activeEpoch: number | null;
212
+ controlledAmount: string | null;
213
+ rewardsSum: string | null;
214
+ withdrawalsSum: string | null;
215
+ reservesSum: string | null;
216
+ treasurySum: string | null;
217
+ withdrawableAmount: string | null;
172
218
  poolId: string | null;
173
219
  drepId: string | null;
174
- addresses: Address[];
220
+ /** Bech32 addresses under the stake key, as the backend lists them; their UTxOs are read separately. */
221
+ addresses: string[];
175
222
  }
176
- /**
177
- * Pool Data Structure Type - Pool information
178
- */
223
+ /** Pool information */
179
224
  export interface PoolData {
180
225
  poolId: string;
181
226
  vrfKeyHash: string;
182
- blocksMinted: number;
183
- blocksEpoch: number;
227
+ /** Null when the source does not count blocks (Ogmios ledger state). */
228
+ blocksMinted: number | null;
229
+ /** Blocks minted in the current epoch; null when the backend has no such figure (Koios). */
230
+ blocksEpoch: number | null;
184
231
  liveStake: string;
185
- liveSize: number;
186
- liveSaturation: number;
187
- liveDelegators: number;
188
- activeStake: string;
189
- activeSize: number;
232
+ /** Share of the total live stake; null when the backend has no such figure (Koios). */
233
+ liveSize: number | null;
234
+ /** Fraction of the ideal (saturated) pool size, NOT percent: 0.7542 = 75.42 %. Null when unknown. */
235
+ liveSaturation: number | null;
236
+ /** Null when the source cannot count delegators (Ogmios ledger state). */
237
+ liveDelegators: number | null;
238
+ /** Null when the source has no active stake (the node's live pool view). */
239
+ activeStake: string | null;
240
+ activeSize: number | null;
190
241
  pledge: string;
191
242
  margin: number;
192
243
  fixedCost: string;
193
244
  rewardAccount: string;
245
+ /** URL of the metadata file as registered; null without one. */
246
+ metadataUrl?: string | null;
247
+ /** hex; blake2b-256 the registration names for that file */
248
+ metadataHash?: string | null;
249
+ /** From the metadata file; null while it is unknown or failed its checks. */
250
+ name?: string | null;
251
+ ticker?: string | null;
252
+ homepage?: string | null;
253
+ description?: string | null;
194
254
  }
195
- /**
196
- * Drep Data Structure Type - Drep information
197
- */
255
+ /** DRep information */
198
256
  export interface DrepData {
199
257
  drepId: string;
200
258
  hex: string;
@@ -203,12 +261,14 @@ export interface DrepData {
203
261
  lastActiveEpoch: number;
204
262
  retired: boolean;
205
263
  expired: boolean;
264
+ /** Registration deposit (lovelace); only set by sources that report it. */
265
+ deposit?: string | null;
266
+ /** Epoch the mandate runs out; only set by sources that report it. */
267
+ expiresEpoch?: number | null;
268
+ /** Stake credentials delegated to the DRep; only set by sources that report it. */
269
+ delegatorCount?: number | null;
206
270
  }
207
- /**
208
- * Asset Info Data Structure Type - Normalized native-asset metadata + supply.
209
- * Backends provide overlapping but non-identical fields; the mapper produces
210
- * this canonical shape. Fields that one backend doesn't expose are null.
211
- */
271
+ /** Normalized native-asset metadata and supply; fields a backend does not expose are null. */
212
272
  export interface AssetInfo {
213
273
  unit: string;
214
274
  policyId: string;
@@ -227,10 +287,7 @@ export interface AssetInfo {
227
287
  registryUrl: string | null;
228
288
  registryLogo: string | null;
229
289
  }
230
- /**
231
- * Asset History Entry - single mint or burn event.
232
- * `quantity` is always the ABSOLUTE amount; sign info lives in `action`.
233
- */
290
+ /** One mint or burn event; `quantity` is absolute, the sign lives in `action`. */
234
291
  export interface AssetHistoryEntry {
235
292
  unit: string;
236
293
  txHash: string;
@@ -239,9 +296,7 @@ export interface AssetHistoryEntry {
239
296
  blockTime: number | null;
240
297
  blockHeight: number | null;
241
298
  }
242
- /**
243
- * Ledger Protocol Parameters Data Structure Type - Current protocol parameters
244
- */
299
+ /** Current protocol parameters */
245
300
  export type LedgerProtocolParameters = {
246
301
  network: string;
247
302
  epoch: number;
@@ -275,38 +330,27 @@ export type LedgerProtocolParameters = {
275
330
  collateralPercent: number | null;
276
331
  maxCollateralInputs: number | null;
277
332
  coinsPerUtxoSize: string | null;
333
+ minFeeRefScriptCostPerByte: number | null;
278
334
  fetchedAt: string;
279
335
  source: string;
280
336
  };
281
- /**
282
- * Mint/Burn Asset Action Type
283
- */
337
+ /** Mint/burn action */
284
338
  export type MintAction = {
285
339
  /** Asset unit to mint/burn (policyId + assetName) */
286
340
  assetUnit: string;
287
- /** Quantity to mint (positive) or burn (negative) */
341
+ /** Positive to mint, negative to burn */
288
342
  quantity: bigint;
289
- /** Optional redeemer data (integer). Defaults to 0 if not specified. */
343
+ /** Optional integer redeemer, default 0 */
290
344
  redeemer?: number;
291
- /**
292
- * Optional PER-ACTION minting policy (CBOR hex). When set, this action
293
- * mints under THIS script instead of the request's top-level
294
- * mintingPolicyScript, enabling multiple policies in one transaction.
295
- * Passed as-is (a parameterized script must be pre-applied); the action's
296
- * assetUnit must carry this script's policyId.
297
- */
298
345
  mintingPolicyScript?: string;
299
- /**
300
- * Optional PER-ACTION redeemer (parsed PlutusData JSON). Only valid
301
- * together with mintingPolicyScript; falls back to the request's
302
- * mintRedeemer when absent. Actions resolving to the SAME policy must
303
- * agree on their redeemer (the ledger carries one redeemer per policy).
304
- */
346
+ /** BuildPlutusTransaction only: UTxO that carries the policy as reference script; exclusive with mintingPolicyScript. */
347
+ referenceScript?: {
348
+ txHash: string;
349
+ outputIndex: number;
350
+ };
305
351
  redeemerJson?: JSONValue;
306
352
  };
307
- /**
308
- * Plutus Script Execution Type - For spending from script addresses
309
- */
353
+ /** Plutus script execution for spending from a script address */
310
354
  export type PlutusScriptExecution = {
311
355
  /** Validator script (CBOR hex) */
312
356
  validatorScript: string;
@@ -317,12 +361,10 @@ export type PlutusScriptExecution = {
317
361
  };
318
362
  /** Redeemer data (JSON value that will be converted to PlutusData) */
319
363
  redeemer: JSONValue;
320
- /** Datum data (JSON value, optional - required for hash-based datums) */
364
+ /** Datum (JSON value), required for hash-based datums */
321
365
  datum?: JSONValue;
322
366
  };
323
- /**
324
- * Transaction Build Request Type - Parameters for building a transaction, including optional minting and Plutus execution details
325
- */
367
+ /** Parameters for building a transaction, with optional minting and Plutus execution */
326
368
  export type TxBuildRequest = {
327
369
  network: 'mainnet' | 'preprod' | 'preview';
328
370
  senderAddress: string;
@@ -340,9 +382,13 @@ export type TxBuildRequest = {
340
382
  plutusScriptExecution?: PlutusScriptExecution;
341
383
  /** Inline datum to attach to the recipient output (optional) - for locking at script addresses */
342
384
  outputDatum?: JSONValue;
385
+ /** PlutusData CBOR hex; optional; inline datum on the recipient output, written byte for byte. Excludes outputDatum. */
386
+ outputDatumCbor?: string;
387
+ /** Raise lovelaceAmount to the recipient output's min-ADA instead of rejecting the request. */
388
+ ensureMinAda?: boolean;
343
389
  /** Required signers - Ed25519 key hashes (hex, 28 bytes each) */
344
390
  requiredSigners?: string[];
345
- /** Script parameters — PlutusData JSON array applied to script before building */
391
+ /** Script parameters (PlutusData JSON array) applied to the script before building */
346
392
  scriptParams?: JSONValue[];
347
393
  /** Optional inline datum for minted token output (PlutusData JSON, parsed) */
348
394
  inlineDatum?: JSONValue;
@@ -350,30 +396,22 @@ export type TxBuildRequest = {
350
396
  mintRedeemer?: JSONValue;
351
397
  /** When true, route output to enterprise script address derived from applied script hash */
352
398
  lockOnScript?: boolean;
353
- /**
354
- * Optional UTxOs that MUST be consumed as inputs. Resolved and added to the TxBuilder
355
- * BEFORE coin selection runs. Coin selection then only covers the remaining shortfall.
356
- * Deduplicated against plutusScriptExecution.scriptUtxo in spend transactions.
357
- * Primary use case: one-shot minting seeds (policy parameterized with a specific TxOutRef).
358
- */
399
+ /** UTxOs that must be spent, such as one-shot minting seeds. Added before coin selection. */
359
400
  forceInputs?: Array<{
360
401
  txHash: string;
361
402
  outputIndex: number;
362
403
  }>;
363
- /**
364
- * Optional CIP-31 reference inputs (read-only, not consumed). Resolved to full UTxOs
365
- * and passed as readonlyRefInputs to Buildooor. The validator can read these UTxOs'
366
- * datums/values without consuming them (e.g., oracle feeds, shared config).
367
- */
404
+ /** UTxOs the build must never spend: left out of coin selection and collateral. */
405
+ protectInputs?: Array<{
406
+ txHash: string;
407
+ outputIndex: number;
408
+ }>;
409
+ /** CIP-31 reference inputs (read-only, not consumed), passed as readonlyRefInputs to Buildooor. */
368
410
  referenceInputs?: Array<{
369
411
  txHash: string;
370
412
  outputIndex: number;
371
413
  }>;
372
- /**
373
- * Optional additional outputs appended after the primary recipient output, before change.
374
- * Each extra output is independently min-ADA checked. Used for multi-output state-machine
375
- * transitions (e.g. counter update + batch NFT outputs in a single transaction).
376
- */
414
+ /** Additional outputs after the primary recipient output, before change; each min-ADA checked. */
377
415
  extraOutputs?: Array<{
378
416
  address: string;
379
417
  lovelaceAmount: string;
@@ -384,52 +422,95 @@ export type TxBuildRequest = {
384
422
  inlineDatum?: JSONValue;
385
423
  referenceScript?: string;
386
424
  }>;
387
- /**
388
- * Optional Plutus V3 validator CBOR hex to attach as a referenceScript on the primary
389
- * recipient output (CIP-33). Adding a ref script significantly increases the output's
390
- * min-ADA — consumers must provide enough lovelaceAmount to cover it.
391
- */
425
+ /** Plutus V3 validator CBOR hex attached as CIP-33 reference script on the recipient output; raises its min-ADA. */
392
426
  referenceScript?: string;
393
- /**
394
- * Optional validity-interval start in Posix milliseconds. Sets `invalidBefore`
395
- * on the built transaction so that Plutus validators checking
396
- * `expect Finite(lower) = tx.validity_range.lower_bound.bound_type` see a finite bound.
397
- * Defaults inside the builder to `Date.now() - 120_000` (script builds only).
398
- */
427
+ /** Validity start in Posix ms (`invalidBefore`); builder default `now - 120_000` for script builds. */
399
428
  validityStartMs?: string;
400
- /**
401
- * Optional validity-interval end in Posix milliseconds. Sets `invalidAfter` (ledger TTL).
402
- * Defaults inside the builder to `Date.now() + 3_600_000` (script builds only).
403
- */
429
+ /** Validity end in Posix ms (`invalidAfter`, ledger TTL); builder default `now + 3_600_000` for script builds. */
404
430
  validityEndMs?: string;
405
431
  };
406
- /**
407
- * Transaction Build Request for Mint/Burn operations - requires mintActions and mintingPolicyScript
408
- */
432
+ /** Mint/burn build request: mintActions and mintingPolicyScript required */
409
433
  export type TxBuildMintRequest = TxBuildRequest & {
410
434
  mintActions: MintAction[];
411
435
  mintingPolicyScript: string;
412
436
  };
413
- /**
414
- * Transaction Build Request for Plutus spending - requires plutusScriptExecution
415
- */
437
+ /** Plutus spend build request: plutusScriptExecution required */
416
438
  export type TxBuildPlutusSpendRequest = TxBuildRequest & {
417
439
  plutusScriptExecution: PlutusScriptExecution;
418
440
  };
419
- /**
420
- * Execution Budget for Plutus scripts
421
- */
441
+ /** One script UTxO spent by a BuildPlutusTransaction: an inline validator or a UTxO carrying the script. */
442
+ export type ScriptInput = {
443
+ txHash: string;
444
+ outputIndex: number;
445
+ /** Validator CBOR hex (script params already applied); exclusive with referenceScript. */
446
+ validatorScript?: string;
447
+ /** UTxO that carries the validator as reference script; added as reference input. */
448
+ referenceScript?: {
449
+ txHash: string;
450
+ outputIndex: number;
451
+ };
452
+ /** Redeemer (PlutusData JSON); `__INPUT_IDX__` placeholders resolve against the final inputs. */
453
+ redeemer: JSONValue;
454
+ /** Redeemer as PlutusData CBOR hex; wins over `redeemer`, no placeholders. */
455
+ redeemerCbor?: string;
456
+ /** Datum preimage (PlutusData JSON) for a hash-datum UTxO; inline datums are read from the UTxO. */
457
+ datum?: JSONValue;
458
+ /** Datum preimage as PlutusData CBOR hex; wins over `datum`. */
459
+ datumCbor?: string;
460
+ };
461
+ /** Output of a BuildPlutusTransaction, kept in the given order. */
462
+ export type PlutusTxOutput = NonNullable<TxBuildRequest['extraOutputs']>[number] & {
463
+ /** Datum hash to lock the output with (hex); exclusive with inlineDatum. */
464
+ datumHash?: string;
465
+ /** Inline datum as PlutusData CBOR hex, taken byte for byte; exclusive with inlineDatum. */
466
+ inlineDatumCbor?: string;
467
+ };
468
+ export type WithdrawalInput = {
469
+ /** Bech32 reward account (stake address). */
470
+ rewardAddress: string;
471
+ /** Withdrawn lovelace; 0 for the withdraw-zero pattern. */
472
+ lovelace: string;
473
+ /** Staking script CBOR hex (script params already applied); exclusive with referenceScript. */
474
+ stakingScript?: string;
475
+ /** UTxO that carries the staking script as reference script; added as reference input. */
476
+ referenceScript?: {
477
+ txHash: string;
478
+ outputIndex: number;
479
+ };
480
+ /** Redeemer (PlutusData JSON); `__INPUT_IDX__` placeholders resolve against the final inputs. */
481
+ redeemer?: JSONValue;
482
+ /** Redeemer as PlutusData CBOR hex; wins over `redeemer`, no placeholders. */
483
+ redeemerCbor?: string;
484
+ };
485
+ export type CertificateInput = {
486
+ type: 'registerStake' | 'deregisterStake';
487
+ /** Bech32 stake address of the credential. */
488
+ stakeAddress: string;
489
+ /** Explicit deposit (lovelace) for the Conway forms; defaults to the protocol's stake deposit. */
490
+ deposit?: string;
491
+ stakingScript?: string;
492
+ referenceScript?: {
493
+ txHash: string;
494
+ outputIndex: number;
495
+ };
496
+ redeemer?: JSONValue;
497
+ redeemerCbor?: string;
498
+ };
499
+ /** BuildPlutusTransaction: several script inputs, the outputs as given, change after them. */
500
+ export type TxBuildPlutusRequest = Pick<TxBuildRequest, 'network' | 'senderAddress' | 'changeAddress' | 'requiredSigners' | 'forceInputs' | 'protectInputs' | 'referenceInputs' | 'mintActions' | 'validityStartMs' | 'validityEndMs'> & {
501
+ scriptInputs: ScriptInput[];
502
+ outputs: PlutusTxOutput[];
503
+ /** Reward-account withdrawals, with or without a staking script. */
504
+ withdrawals?: WithdrawalInput[];
505
+ /** Stake-credential registrations and deregistrations. */
506
+ certificates?: CertificateInput[];
507
+ };
508
+ /** Execution budget for Plutus scripts */
422
509
  export type ExecutionBudget = {
423
510
  memory: number;
424
511
  cpu: number;
425
512
  };
426
- /**
427
- * Script evaluation result from Ogmios
428
- */
429
- /**
430
- * Ogmios validator descriptor — `purpose:index` (e.g., "spend:0", "mint:1")
431
- * or a structured object with purpose + index fields depending on Ogmios version.
432
- */
513
+ /** Ogmios validator descriptor: `purpose:index` (e.g. "spend:0") or `{ purpose, index }` depending on version */
433
514
  export type ScriptValidator = string | {
434
515
  purpose: string;
435
516
  index: number;
@@ -438,13 +519,9 @@ export type ScriptEvaluationResult = {
438
519
  validator: ScriptValidator;
439
520
  budget: ExecutionBudget;
440
521
  };
441
- /**
442
- * Transaction evaluator function type - evaluates script execution units
443
- */
522
+ /** Evaluates script execution units of an unsigned tx */
444
523
  export type TxEvaluator = (unsignedTxCbor: string) => Promise<ScriptEvaluationResult[]>;
445
- /**
446
- * Transaction Build Context Type - Context for building a transaction
447
- */
524
+ /** Context for building a transaction */
448
525
  export type TxBuildContext = {
449
526
  utxos: UTxO[];
450
527
  protocolParameters: LedgerProtocolParameter;
@@ -453,9 +530,7 @@ export type TxBuildContext = {
453
530
  /** CIP-31 reference input UTxOs (read-only, not consumed). Resolved from referenceInputs refs. */
454
531
  referenceInputUtxos?: UTxO[];
455
532
  };
456
- /**
457
- * Transaction Build Result Type
458
- */
533
+ /** Transaction build result */
459
534
  export type TxBuildResult = {
460
535
  senderAddress?: string;
461
536
  network?: 'mainnet' | 'preprod' | 'preview';
@@ -474,10 +549,8 @@ export type TxBuildResult = {
474
549
  lovelace: string;
475
550
  }>;
476
551
  metaDataCborHex?: string;
477
- changeOutput?: {
478
- address: string;
479
- lovelace: string;
480
- };
552
+ /** Address the builder sent the change to: the request's changeAddress, else the sender. */
553
+ changeAddress?: string;
481
554
  warnings: string[];
482
555
  /** Blake2b-224 hash of the script (= policy ID for minting), if a script was provided */
483
556
  scriptHash?: string;
@@ -489,10 +562,15 @@ export type TxBuildResult = {
489
562
  forcedInputsUsed?: number;
490
563
  /** Number of CIP-31 reference inputs included in the built transaction (0 if referenceInputs was not used). */
491
564
  referenceInputsUsed?: number;
565
+ /** Execution units stamped on each redeemer (script builds). */
566
+ redeemers?: Array<{
567
+ tag: string;
568
+ index: number;
569
+ mem: string;
570
+ steps: string;
571
+ }>;
492
572
  };
493
- /**
494
- * Supported external signer types
495
- */
573
+ /** Supported external signer types */
496
574
  export declare enum ExternalSignerType {
497
575
  /** Cardano CLI - Reference implementation for signing */
498
576
  CARDANO_CLI = "cardano-cli",
@@ -505,26 +583,9 @@ export declare enum ExternalSignerType {
505
583
  /** Hardware Security Module (server-side PKCS#11) */
506
584
  HSM = "hsm"
507
585
  }
508
- /**
509
- * Signing request status
510
- */
511
- export declare enum SigningStatus {
512
- /** Request created, awaiting signing */
513
- PENDING = "pending",
514
- /** Transaction has been signed */
515
- SIGNED = "signed",
516
- /** Signature verified, ready for submission */
517
- VERIFIED = "verified",
518
- /** Transaction submitted to network */
519
- SUBMITTED = "submitted",
520
- /** Signing or verification failed */
521
- FAILED = "failed",
522
- /** Request expired (not signed within TTL) */
523
- EXPIRED = "expired"
524
- }
525
- /**
526
- * Instructions for external signers
527
- */
586
+ /** Signing request status: the generated enum type of the model. */
587
+ export type { SigningStatus } from '../../@cds-models';
588
+ /** Instructions for external signers */
528
589
  export interface SigningInstructions {
529
590
  /** Signer type hint (which tool/wallet to use) */
530
591
  signerTypeHint: ExternalSignerType;
@@ -542,12 +603,7 @@ export interface SigningInstructions {
542
603
  /** Copy-pasteable cardano-cli signing recipe (for CLI/hardware signers) */
543
604
  cardanoCliCommand?: string;
544
605
  }
545
- /**
546
- * Unsigned transaction export payload for external signers
547
- *
548
- * This is the standardized format returned by BuildTransaction actions.
549
- * External signers use this payload to sign the transaction.
550
- */
606
+ /** Unsigned transaction payload returned by the Build actions for external signers */
551
607
  export interface UnsignedTxExportPayload {
552
608
  /** Unique identifier for this signing request */
553
609
  signingRequestId: string;
@@ -568,9 +624,7 @@ export interface UnsignedTxExportPayload {
568
624
  /** Signing instructions for the external signer */
569
625
  signingInstructions: SigningInstructions;
570
626
  }
571
- /**
572
- * Signed transaction submission payload
573
- */
627
+ /** Signed transaction submission payload */
574
628
  export interface SignedTxPayload {
575
629
  /** Original signing request ID */
576
630
  signingRequestId: string;
@@ -583,9 +637,7 @@ export interface SignedTxPayload {
583
637
  /** Optional: Signer identification (wallet name, etc.) */
584
638
  signerInfo?: string;
585
639
  }
586
- /**
587
- * Signing workflow state
588
- */
640
+ /** Signing workflow state */
589
641
  export interface SigningWorkflowState {
590
642
  /** Current status of the signing workflow */
591
643
  status: SigningStatus;
@@ -608,9 +660,25 @@ export interface SigningWorkflowState {
608
660
  failed?: string;
609
661
  };
610
662
  }
611
- /**
612
- * Result of signature verification
613
- */
663
+ /** Depth of a transaction in the chain. Depth 1 means it sits in the tip block. */
664
+ export interface TransactionConfirmations {
665
+ txHash: string;
666
+ /** null while the tx is not on chain. */
667
+ blockHeight: number | null;
668
+ tipHeight: number | null;
669
+ /** 0 while the tx is not on chain. */
670
+ confirmations: number;
671
+ }
672
+ /** Result of verifyTxWitnesses: every vkey signature checked against the body hash. */
673
+ export interface TxWitnessVerification {
674
+ valid: boolean;
675
+ /** null when the CBOR could not be read. */
676
+ txBodyHash: string | null;
677
+ /** blake2b-224 of each vkey whose signature verifies. */
678
+ signerKeyHashes: string[];
679
+ errors: string[];
680
+ }
681
+ /** Result of signature verification */
614
682
  export interface SignatureVerificationResult {
615
683
  /** Whether the signature is valid */
616
684
  isValid: boolean;
@@ -625,9 +693,7 @@ export interface SignatureVerificationResult {
625
693
  /** Error message if verification failed */
626
694
  errorMessage?: string;
627
695
  }
628
- /**
629
- * Options for signature verification
630
- */
696
+ /** Options for signature verification */
631
697
  export interface VerificationOptions {
632
698
  /** Expected transaction body hash (from the build) */
633
699
  expectedTxBodyHash?: string;
@@ -636,9 +702,7 @@ export interface VerificationOptions {
636
702
  /** List of required signer key hashes (public key hashes) */
637
703
  requiredSigners?: string[];
638
704
  }
639
- /**
640
- * HSM Configuration for PKCS#11 integration
641
- */
705
+ /** HSM configuration for PKCS#11 integration */
642
706
  export interface HsmConfig {
643
707
  /** Whether HSM signing is enabled */
644
708
  enabled: boolean;
@@ -652,12 +716,10 @@ export interface HsmConfig {
652
716
  keyId?: string;
653
717
  /** Key label for CKA_LABEL lookup */
654
718
  keyLabel?: string;
655
- /** Optional CDS role required for HSM actions (SignWithHsm, SignAndSubmitWithHsm, GetHsmStatus). When set, only users with this role can invoke HSM operations. */
719
+ /** CDS role required for the HSM actions (SignWithHsm, SignAndSubmitWithHsm, GetHsmStatus) */
656
720
  requiresRole?: string;
657
721
  }
658
- /**
659
- * HSM signing result
660
- */
722
+ /** HSM signing result */
661
723
  export interface HsmSignResult {
662
724
  /** Ed25519 signature (64 bytes, hex) */
663
725
  signatureHex: string;