@odatano/core 0.3.1

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 (98) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +212 -0
  3. package/cds-plugin.js +5 -0
  4. package/config/preview/cardano-node/alonzo-genesis.json +196 -0
  5. package/config/preview/cardano-node/byron-genesis.json +117 -0
  6. package/config/preview/cardano-node/config.json +118 -0
  7. package/config/preview/cardano-node/conway-genesis.json +297 -0
  8. package/config/preview/cardano-node/shelley-genesis.json +68 -0
  9. package/config/preview/cardano-node/topology.json +19 -0
  10. package/db/schema.cds +1318 -0
  11. package/package.json +125 -0
  12. package/src/index.d.ts.map +1 -0
  13. package/src/index.js +96 -0
  14. package/src/index.js.map +1 -0
  15. package/src/plugin.d.ts.map +1 -0
  16. package/src/plugin.js +92 -0
  17. package/src/plugin.js.map +1 -0
  18. package/srv/blockchain/backends/blockfrost-backend.d.ts.map +1 -0
  19. package/srv/blockchain/backends/blockfrost-backend.js +398 -0
  20. package/srv/blockchain/backends/blockfrost-backend.js.map +1 -0
  21. package/srv/blockchain/backends/cardano-backend.d.ts.map +1 -0
  22. package/srv/blockchain/backends/cardano-backend.js +12 -0
  23. package/srv/blockchain/backends/cardano-backend.js.map +1 -0
  24. package/srv/blockchain/backends/koios-backend.d.ts.map +1 -0
  25. package/srv/blockchain/backends/koios-backend.js +537 -0
  26. package/srv/blockchain/backends/koios-backend.js.map +1 -0
  27. package/srv/blockchain/backends/ogmios-backend.d.ts.map +1 -0
  28. package/srv/blockchain/backends/ogmios-backend.js +516 -0
  29. package/srv/blockchain/backends/ogmios-backend.js.map +1 -0
  30. package/srv/blockchain/cardano-client.d.ts.map +1 -0
  31. package/srv/blockchain/cardano-client.js +377 -0
  32. package/srv/blockchain/cardano-client.js.map +1 -0
  33. package/srv/blockchain/cardano-indexer.d.ts.map +1 -0
  34. package/srv/blockchain/cardano-indexer.js +542 -0
  35. package/srv/blockchain/cardano-indexer.js.map +1 -0
  36. package/srv/blockchain/cardano-tx-builder.d.ts.map +1 -0
  37. package/srv/blockchain/cardano-tx-builder.js +232 -0
  38. package/srv/blockchain/cardano-tx-builder.js.map +1 -0
  39. package/srv/blockchain/circuit-breaker.d.ts.map +1 -0
  40. package/srv/blockchain/circuit-breaker.js +110 -0
  41. package/srv/blockchain/circuit-breaker.js.map +1 -0
  42. package/srv/blockchain/signing/external-signer.d.ts.map +1 -0
  43. package/srv/blockchain/signing/external-signer.js +302 -0
  44. package/srv/blockchain/signing/external-signer.js.map +1 -0
  45. package/srv/blockchain/signing/signature-verifier.d.ts.map +1 -0
  46. package/srv/blockchain/signing/signature-verifier.js +249 -0
  47. package/srv/blockchain/signing/signature-verifier.js.map +1 -0
  48. package/srv/blockchain/transaction-building/buildooor-tx.d.ts.map +1 -0
  49. package/srv/blockchain/transaction-building/buildooor-tx.js +636 -0
  50. package/srv/blockchain/transaction-building/buildooor-tx.js.map +1 -0
  51. package/srv/blockchain/transaction-building/cardano-tx.d.ts.map +1 -0
  52. package/srv/blockchain/transaction-building/cardano-tx.js +3 -0
  53. package/srv/blockchain/transaction-building/cardano-tx.js.map +1 -0
  54. package/srv/blockchain/transaction-building/csl-tx.d.ts.map +1 -0
  55. package/srv/blockchain/transaction-building/csl-tx.js +766 -0
  56. package/srv/blockchain/transaction-building/csl-tx.js.map +1 -0
  57. package/srv/blockchain/transaction-building/tx-builder-registry.d.ts.map +1 -0
  58. package/srv/blockchain/transaction-building/tx-builder-registry.js +67 -0
  59. package/srv/blockchain/transaction-building/tx-builder-registry.js.map +1 -0
  60. package/srv/cardano-service.cds +179 -0
  61. package/srv/cardano-service.d.ts.map +1 -0
  62. package/srv/cardano-service.js +227 -0
  63. package/srv/cardano-service.js.map +1 -0
  64. package/srv/cardano-tx-service.cds +298 -0
  65. package/srv/cardano-tx-service.d.ts.map +1 -0
  66. package/srv/cardano-tx-service.js +646 -0
  67. package/srv/cardano-tx-service.js.map +1 -0
  68. package/srv/cardano-ui.cds +2949 -0
  69. package/srv/server.d.ts.map +1 -0
  70. package/srv/server.js +212 -0
  71. package/srv/server.js.map +1 -0
  72. package/srv/utils/backend-request-handler.d.ts.map +1 -0
  73. package/srv/utils/backend-request-handler.js +47 -0
  74. package/srv/utils/backend-request-handler.js.map +1 -0
  75. package/srv/utils/const.d.ts.map +1 -0
  76. package/srv/utils/const.js +86 -0
  77. package/srv/utils/const.js.map +1 -0
  78. package/srv/utils/error-codes.d.ts.map +1 -0
  79. package/srv/utils/error-codes.js +49 -0
  80. package/srv/utils/error-codes.js.map +1 -0
  81. package/srv/utils/errors.d.ts.map +1 -0
  82. package/srv/utils/errors.js +389 -0
  83. package/srv/utils/errors.js.map +1 -0
  84. package/srv/utils/mappers.d.ts.map +1 -0
  85. package/srv/utils/mappers.js +723 -0
  86. package/srv/utils/mappers.js.map +1 -0
  87. package/srv/utils/signing-helper.d.ts.map +1 -0
  88. package/srv/utils/signing-helper.js +128 -0
  89. package/srv/utils/signing-helper.js.map +1 -0
  90. package/srv/utils/tx-build-helper.d.ts.map +1 -0
  91. package/srv/utils/tx-build-helper.js +135 -0
  92. package/srv/utils/tx-build-helper.js.map +1 -0
  93. package/srv/utils/types.d.ts.map +1 -0
  94. package/srv/utils/types.js +36 -0
  95. package/srv/utils/types.js.map +1 -0
  96. package/srv/utils/validators.d.ts.map +1 -0
  97. package/srv/utils/validators.js +382 -0
  98. package/srv/utils/validators.js.map +1 -0
package/db/schema.cds ADDED
@@ -0,0 +1,1318 @@
1
+ using {temporal, } from '@sap/cds/common';
2
+
3
+ namespace odatano.cardano;
4
+
5
+ // -----------------------------------------------------
6
+ // Basic Cardano Types
7
+ // -----------------------------------------------------
8
+ @title : 'Blake2b224'
9
+ @description: '28 bytes Blake2b hash as hex string'
10
+ type Blake2b224 : String(56);
11
+
12
+ @title : 'Blake2b256'
13
+ @description: '32 bytes Blake2b hash as hex string'
14
+ type Blake2b256 : String(64);
15
+
16
+ @title : 'HexBytes'
17
+ @description: 'CBOR / bytes as hex string'
18
+ type HexBytes : String(5000);
19
+
20
+ @title : 'Lovelace'
21
+ @description: 'Amount of ADA in lovelace (1 ADA = 1_000_000 lovelace)'
22
+ type Lovelace : Decimal(20, 0);
23
+
24
+ @title : 'Asset Unit'
25
+ @description: 'Concatenation of policyId and assetNameHex representing a unique asset'
26
+ type AssetUnit : String(120);
27
+
28
+ @title : 'Metadata Label'
29
+ @description: 'Metadata label as string (max 5 digits)'
30
+ type MetadataLabel : String(5);
31
+
32
+ @title : 'Bech32 Address'
33
+ @description: 'Bech32 encoded address string'
34
+ type Bech32 : String(120);
35
+
36
+ // -----------------------------------------------------
37
+ // Shared structural slices
38
+ // -----------------------------------------------------
39
+ @title : 'Asset Slice'
40
+ @description: 'Structural slice for asset details'
41
+ type AssetSlice {
42
+
43
+ @title : 'Asset Quantity'
44
+ @description: 'Quantity of the Asset'
45
+ quantity : Lovelace;
46
+
47
+ @title : 'Asset Policy Id'
48
+ @description: 'Policy Id of the Asset'
49
+ policyId : Blake2b224;
50
+
51
+ @title : 'Asset Name Hex'
52
+ @description: 'Asset Name as Hex String'
53
+ assetNameHex : String(64);
54
+
55
+ @title : 'Asset Name'
56
+ @description: 'Asset Name as UTF-8 String'
57
+ assetName : String(128);
58
+
59
+ @title : 'Asset Fingerprint'
60
+ @description: 'CIP-14 Asset Fingerprint'
61
+ fingerprint : String(44);
62
+ }
63
+
64
+ @title : 'Metadata Slice'
65
+ @description: 'Structural slice for metadata details'
66
+ type MetadataSlice {
67
+
68
+ @title : 'Metadata Label'
69
+ @description: 'Metadata label as string (max 5 digits)'
70
+ label : MetadataLabel;
71
+
72
+ @title : 'Metadata Payload'
73
+ @description: 'Metadata payload as JSON string'
74
+ payload : LargeString;
75
+ }
76
+
77
+ @title : 'UTxO Data Slice'
78
+ @description: 'Structural slice for UTxO specific data'
79
+ type UTxODataSlice {
80
+
81
+ @title : 'Datum Hash'
82
+ @description: 'The datum hash associated with the UTxO'
83
+ dataHash : Blake2b256;
84
+
85
+ @title : 'Inline Datum'
86
+ @description: 'The inline datum associated with the UTxO as hex CBOR'
87
+ inlineDatum : LargeString;
88
+
89
+ @title : 'Reference Script Hash'
90
+ @description: 'The reference script hash associated with the UTxO'
91
+ referenceScriptHash : Blake2b256;
92
+ }
93
+
94
+ @title : 'Network Information Entity'
95
+ @description: 'General information entity definition'
96
+ entity NetworkInformation : temporal {
97
+
98
+ @title : 'Network (key)'
99
+ @description: 'The Cardano network type mainnet | preprod | preview'
100
+ key network : String(10);
101
+
102
+ @title : 'Max Supply'
103
+ @description: 'The maximum supply of ADA'
104
+ maxSupply : Lovelace;
105
+
106
+ @title : 'Total Supply'
107
+ @description: 'Current total supply of ADA'
108
+ totalSupply : Lovelace;
109
+
110
+ @title : 'Circulating Supply'
111
+ @description: 'Current circulating supply of ADA'
112
+ circulatingSupply : Lovelace;
113
+
114
+ @title : 'Locked Supply'
115
+ @description: 'Current locked supply of ADA'
116
+ lockedSupply : Lovelace;
117
+
118
+ @title : 'Treasury Supply'
119
+ @description: 'Current treasury supply of ADA'
120
+ treasurySupply : Lovelace;
121
+
122
+ @title : 'Reserves Supply'
123
+ @description: 'Current reserves supply of ADA'
124
+ reservesSupply : Lovelace;
125
+
126
+ @title : 'Live Stake'
127
+ @description: 'Current live stake of ADA'
128
+ liveStake : Lovelace;
129
+
130
+ @title : 'Active Stake'
131
+ @description: 'Current active stake of ADA'
132
+ activeStake : Lovelace;
133
+ }
134
+
135
+ @title : 'Block Entity'
136
+ @description: 'Block information entity definition'
137
+ @readonly
138
+ entity Blocks {
139
+
140
+ @title : 'Block Hash (Key)'
141
+ @description: 'Block hash as hex string'
142
+ key hash : String(64);
143
+
144
+ @title : 'Block Time'
145
+ @description: 'Block time as ISO 8601 string'
146
+ time : String;
147
+
148
+ @title : 'Block Height'
149
+ @description: 'Block height as integer'
150
+ height : Integer;
151
+
152
+ @title : 'Block SlotLeader'
153
+ @description: 'Slot leader id as hex string'
154
+ slotLeader : String;
155
+
156
+ @title : 'Block Epoch Number'
157
+ @description: 'Epoch number as integer'
158
+ epochNumber : Integer;
159
+
160
+ @title : 'Block epoch Association'
161
+ @description: 'Association to Epochs entity'
162
+ epoch : Association to Epochs
163
+ on epoch.epoch = $self.epochNumber;
164
+
165
+ @title : 'Block Slot within Epoch'
166
+ @description: 'Slot number within the epoch as integer'
167
+ epochSlot : Integer;
168
+
169
+ @title : 'Block Size'
170
+ @description: 'Block size in bytes'
171
+ size : Integer;
172
+
173
+ @title : 'Block Transaction Count'
174
+ @description: 'Number of transactions in the block'
175
+ txCount : Integer;
176
+
177
+ @title : 'Block Fees'
178
+ @description: 'Total fees in the block'
179
+ fees : Lovelace;
180
+ }
181
+
182
+ @title : 'Epoch Entity'
183
+ @description: 'Epoch information entity definition'
184
+ @readonly
185
+ entity Epochs {
186
+
187
+ @title : 'Epoch Number (Key)'
188
+ @description: 'Epoch number as integer'
189
+ key epoch : Integer;
190
+
191
+ @title : 'Epoch Start Time'
192
+ @description: 'Epoch start time as unix timestamp'
193
+ startTime : Integer;
194
+
195
+ @title : 'Epoch End Time'
196
+ @description: 'Epoch end time as unix timestamp'
197
+ endTime : Integer;
198
+
199
+ @title : 'First Block Time'
200
+ @description: 'First block time as unix timestamp'
201
+ firstBlockTime : Integer;
202
+
203
+ @title : 'Last Block Time'
204
+ @description: 'Last block time as unix timestamp'
205
+ lastBlockTime : Integer;
206
+
207
+ @title : 'Block Count'
208
+ @description: 'Number of blocks in the epoch'
209
+ blockCount : Integer;
210
+
211
+ @title : 'Transaction Count'
212
+ @description: 'Number of transactions in the epoch'
213
+ txCount : Integer;
214
+
215
+ @title : 'Total Output'
216
+ @description: 'Total output in the epoch as string to avoid precision issues'
217
+ output : String;
218
+
219
+ @title : 'Total Fees'
220
+ @description: 'Total fees in the epoch'
221
+ fees : Lovelace;
222
+
223
+ @title : 'Active Stake'
224
+ @description: 'Total active stake in the epoch'
225
+ activeStake : Lovelace;
226
+ }
227
+
228
+ @title : 'Pool Entity'
229
+ @description: 'Stake pool information entity definition'
230
+ entity Pools {
231
+
232
+ @title : 'Pool Id (Key)'
233
+ @description: 'Unique stake pool identifier'
234
+ key poolId : String;
235
+
236
+ @title : 'VRF Key Hash'
237
+ @description: 'Pool VRF key hash as hex string'
238
+ vrfKeyHash : String;
239
+
240
+ @title : 'Blocks Minted'
241
+ @description: 'Total number of blocks minted by the pool'
242
+ blocksMinted : Integer;
243
+
244
+ @title : 'Blocks in Epoch'
245
+ @description: 'Number of blocks minted in the current epoch'
246
+ blocksEpoch : Integer;
247
+
248
+ @title : 'Live Stake'
249
+ @description: 'Current live stake delegated to the pool'
250
+ liveStake : Lovelace;
251
+
252
+ @title : 'Live Size'
253
+ @description: 'Current live size as fraction of total active stake'
254
+ liveSize : Decimal(5, 4);
255
+
256
+ @title : 'Live Saturation'
257
+ @description: 'Current live saturation as fraction of ideal size'
258
+ liveSaturation : Decimal(5, 4);
259
+
260
+ @title : 'Live Delegators'
261
+ @description: 'Current number of live delegators'
262
+ liveDelegators : Integer;
263
+
264
+ @title : 'Active Stake'
265
+ @description: 'Current active stake delegated to the pool'
266
+ activeStake : Lovelace;
267
+
268
+ @title : 'Active Size'
269
+ @description: 'Current active size as fraction'
270
+ activeSize : Decimal(5, 4);
271
+
272
+ @title : 'Pledge'
273
+ @description: 'Pool pledge in lovelace'
274
+ pledge : Lovelace;
275
+
276
+ @title : 'Margin'
277
+ @description: 'Pool margin as fraction'
278
+ margin : Decimal(5, 4);
279
+
280
+ @title : 'Fixed Cost'
281
+ @description: 'Pool fixed cost in lovelace'
282
+ fixedCost : Lovelace;
283
+
284
+ @title : 'Reward Account'
285
+ @description: 'Pool reward account in bech32 format'
286
+ rewardAccount : String;
287
+ }
288
+
289
+ @title : 'Drep Entity'
290
+ @description: 'Drep information entity definition'
291
+ entity Dreps {
292
+
293
+ @title : 'Drep Id (Key)'
294
+ @description: 'Unique drep identifier'
295
+ key drepId : String;
296
+
297
+ @title : 'Drep VRF Key Hash'
298
+ @description: 'Drep VRF key hash as hex string'
299
+ hex : String;
300
+
301
+ @title : 'Vote Power'
302
+ @description: 'Amount of vote power in lovelace'
303
+ amount : Lovelace;
304
+
305
+ @title : 'Has Script'
306
+ @description: 'Indicates if drep is a script drep'
307
+ hasScript : Boolean;
308
+
309
+ @title : 'Last Active Epoch'
310
+ @description: 'Epoch number of last activity'
311
+ lastActiveEpoch : Integer;
312
+
313
+ @title : 'Retired'
314
+ @description: 'Indicates if drep is retired'
315
+ retired : Boolean;
316
+
317
+ @title : 'Expired'
318
+ @description: 'Indicates if drep is expired'
319
+ expired : Boolean;
320
+ }
321
+
322
+ @title : 'Address Entity'
323
+ @description: 'Address information entity definition'
324
+ entity Addresses : temporal {
325
+
326
+ @title : 'Bech32 Address (Key)'
327
+ @description: 'The Bech32 encoded address string'
328
+ key address : Bech32;
329
+
330
+ @title : 'Associated Stake Address'
331
+ @description: 'The associated stake address in bech32 format'
332
+ stakeAddress : Bech32;
333
+
334
+ @title : 'Address Type'
335
+ @description: 'The type of address (base | enterprise | pointer | reward | script | unknown)'
336
+ type : String(20);
337
+
338
+ @title : 'Is Script Address'
339
+ @description: 'Indicates if the address is a script address'
340
+ isScript : Boolean;
341
+
342
+ @title : 'Total Lovelace'
343
+ @description: 'Total lovelace on this address'
344
+ totalLovelace : Lovelace;
345
+
346
+ @title : 'Address Transactions'
347
+ @description : 'Composition of all transactions involving this address'
348
+ transactions : Composition of many AddressTransactions
349
+ on transactions.address = $self;
350
+
351
+ @title : 'Address Assets'
352
+ @description: 'Composition of all assets on this address'
353
+ assets : Composition of many AddressAssets
354
+ on assets.address = $self;
355
+
356
+ @title : 'Address UTxOs'
357
+ @description: 'Composition of all UTxOs on this address'
358
+ utxos : Composition of many AddressUTxOs
359
+ on utxos.address = $self;
360
+
361
+ @title : 'Address Has Transactions'
362
+ @description : 'Indicates if address has transactions'
363
+ hasTransactions : Boolean;
364
+
365
+ @title : 'Address Has Assets'
366
+ @description: 'Indicates if address has native assets'
367
+ hasAssets : Boolean;
368
+
369
+ @title : 'Address Has UTxOs'
370
+ @description: 'Indicates if address has UTxOs'
371
+ hasUTxOs : Boolean;
372
+
373
+
374
+ }
375
+
376
+ @title : 'Address Assets'
377
+ @description: 'Association entity for assets held by an address'
378
+ entity AddressAssets : temporal {
379
+
380
+ @title : 'Address (key)'
381
+ @description: 'The Bech32 encoded address associated with the asset'
382
+ key address : Association to Addresses;
383
+
384
+ @title : 'Asset Unit (key)'
385
+ @description: 'The unique identifier for the asset unit'
386
+ key unit : AssetUnit;
387
+
388
+ @title : 'Asset Details'
389
+ @description: 'Structural slice for asset details'
390
+ asset : AssetSlice;
391
+ }
392
+
393
+ @title : 'Address UTxOs'
394
+ @description: 'Association entity for UTxOs held by an address'
395
+ entity AddressUTxOs : temporal {
396
+
397
+ @title : 'Address (key)'
398
+ @description: 'The Bech32 encoded address associated with the UTxO'
399
+ key address : Association to Addresses;
400
+
401
+ @title : 'UTxO Key (key)'
402
+ @description: 'The unique identifier for the UTxO (tx hash + index)'
403
+ key hash : Blake2b256;
404
+
405
+ @title : 'UTxO Index (key)'
406
+ @description: 'The output index of the UTxO'
407
+ key index : Integer;
408
+
409
+ @title : 'Block Hash'
410
+ @description: 'Block hash containing the UTxO'
411
+ blockHash : Blake2b256;
412
+
413
+ @title : 'UTxO Data'
414
+ @description: 'UTxO specific data'
415
+ utxodata : UTxODataSlice;
416
+
417
+ @title : 'Lovelace Amount'
418
+ @description: 'Lovelace amount in the UTxO'
419
+ lovelace : Lovelace;
420
+
421
+ @title : 'UTxO Assets'
422
+ @description: 'Assets in this UTxO'
423
+ assets : Composition of many UTxOAssets
424
+ on assets.utxo = $self;
425
+
426
+ @title : 'UTxO Has Assets'
427
+ @description: 'Indicates if utxo has assets'
428
+ hasAssets : Boolean;
429
+ }
430
+
431
+ @title : 'UTxO Assets'
432
+ @description: 'Association entity for assets held by a UTxO'
433
+ entity UTxOAssets : temporal {
434
+
435
+ @title: 'UTxO (key)'
436
+ key utxo : Association to AddressUTxOs; // utxo association
437
+
438
+ @title : 'Asset Unit (key)'
439
+ @description: 'The unique identifier for the asset unit'
440
+ key unit : AssetUnit; // asset unit - must be key since one UTxO can hold multiple assets
441
+
442
+ @title : 'Asset Details'
443
+ @description: 'Structural slice for asset details'
444
+ asset : AssetSlice; // asset details
445
+ }
446
+
447
+ @title : 'Accounts Entity'
448
+ @description: 'Account information entity definition'
449
+ entity Accounts : temporal {
450
+
451
+ @title : 'Stake Address (Key)'
452
+ @description: 'The Bech32 encoded stake address string'
453
+ key stakeAddress : String;
454
+
455
+ @title : 'Active Status'
456
+ @description: 'Indicates if the account is active'
457
+ active : Boolean;
458
+
459
+ @title : 'Last Active Epoch'
460
+ @description: 'Epoch number of last activity'
461
+ activeEpoch : Integer;
462
+
463
+ @title : 'Controlled Amount'
464
+ @description: 'Total controlled amount in lovelace'
465
+ controlledAmount : Lovelace;
466
+
467
+ @title : 'Rewards Sum'
468
+ @description: 'Total rewards sum in lovelace'
469
+ rewardsSum : Lovelace;
470
+
471
+ @title : 'Withdrawals Sum'
472
+ @description: 'Total withdrawals sum in lovelace'
473
+ withdrawalsSum : Lovelace;
474
+
475
+ @title : 'Reserves Sum'
476
+ @description: 'Total reserves sum in lovelace'
477
+ reservesSum : Lovelace;
478
+
479
+ @title : 'Treasury Sum'
480
+ @description: 'Total treasury sum in lovelace'
481
+ treasurySum : Lovelace;
482
+
483
+ @title : 'Withdrawable Amount'
484
+ @description: 'Total withdrawable amount in lovelace'
485
+ withdrawableAmount : Lovelace;
486
+
487
+ @title : 'Pool ID'
488
+ @description: 'Associated pool ID'
489
+ poolId : Association to Pools;
490
+
491
+ @title : 'DRep ID'
492
+ @description: 'Associated DRep ID'
493
+ drepId : Association to Dreps;
494
+
495
+ @title : 'Addresses'
496
+ @description: 'All addresses for this account'
497
+ Address : Composition of many Addresses
498
+ on Address.stakeAddress = $self.stakeAddress;
499
+
500
+ @title : 'Has Addresses'
501
+ @description: 'Indicates if account has associated addresses'
502
+ hasAddresses : Boolean;
503
+ }
504
+
505
+ @title : 'Transaction Entity'
506
+ @description: 'Transaction information entity definition'
507
+ @readonly
508
+ entity Transactions {
509
+
510
+ @title : 'Transaction Hash (Key)'
511
+ @description: 'The unique transaction identifier as hex string'
512
+ key hash : Blake2b256;
513
+
514
+ @title : 'Transaction Block Hash'
515
+ @description: 'The block hash containing the transaction'
516
+ blockHash : Blake2b256;
517
+
518
+ @title : 'Transaction Block Height'
519
+ @description: 'The block height containing the transaction'
520
+ blockHeight : Integer;
521
+
522
+ @title : 'Transaction Block Time'
523
+ @description: 'The block time as integer unix timestamp'
524
+ blockTime : Integer64;
525
+
526
+ @title : 'Transaction Slot'
527
+ @description: 'The slot number containing the transaction'
528
+ slot : Integer64;
529
+
530
+ @title : 'Transaction Index'
531
+ @description: 'The transaction index within the block'
532
+ txIndex : Integer;
533
+
534
+ @title : 'Transaction Fee'
535
+ @description: 'The transaction fee in lovelace'
536
+ fee : Lovelace;
537
+
538
+ @title : 'Transaction Deposit'
539
+ @description: 'The deposit change in lovelace'
540
+ deposit : Lovelace;
541
+
542
+ @title : 'Transaction Size'
543
+ @description: 'The transaction size in bytes'
544
+ size : Integer;
545
+
546
+ @title : 'Transaction Metadata'
547
+ @description: 'The transaction metadata'
548
+ metadata : Composition of many TransactionMetadata
549
+ on metadata.tx = $self;
550
+
551
+ @title : 'Transaction Inputs'
552
+ @description: 'The transaction inputs composition'
553
+ inputs : Composition of many TransactionInputs
554
+ on inputs.tx = $self;
555
+
556
+ @title : 'Transaction Outputs'
557
+ @description: 'The transaction outputs composition'
558
+ outputs : Composition of many TransactionOutputs
559
+ on outputs.tx = $self;
560
+
561
+ @title : 'Transaction Has Metadata'
562
+ @description: 'Indicates if transaction has metadata'
563
+ hasMetadata : Boolean;
564
+
565
+ @title : 'Transaction Has Inputs'
566
+ @description: 'Indicates if transaction has inputs'
567
+ hasInputs : Boolean;
568
+
569
+ @title : 'Transaction Has Outputs'
570
+ @description: 'Indicates if transaction has outputs'
571
+ hasOutputs : Boolean;
572
+ }
573
+
574
+ @title : 'Transaction Inputs'
575
+ @description: 'Projection for Transaction Inputs'
576
+ @readonly
577
+ entity TransactionInputs {
578
+
579
+ @title : 'Transaction (key)'
580
+ @description: 'The associated transaction'
581
+ key tx : Association to Transactions;
582
+
583
+ @title : 'Input Index (key)'
584
+ @description: 'The input index of the input utxo'
585
+ key inputIndex : Integer;
586
+
587
+ @title : 'Input Address'
588
+ @description: 'The associated address of the input utxo'
589
+ address : Association to Addresses;
590
+
591
+ @title : 'Input UTxO Data'
592
+ @description: 'The UTxO specific data of the input utxo'
593
+ utxoData : UTxODataSlice; // input utxo data
594
+
595
+ @title : 'Input Lovelace Amount'
596
+ @description: 'The lovelace amount of the input utxo'
597
+ isCollateral : Boolean;
598
+
599
+ @title : 'Is Reference Input'
600
+ @description: 'Indicates if the input is used as reference input'
601
+ isReference : Boolean;
602
+
603
+ @title : 'Input Assets'
604
+ @description: 'Composed assets associated with the input utxo'
605
+ assets : Composition of many TransactionInputAssets
606
+ on assets.input = $self;
607
+
608
+ @title : 'Input Has Addresses'
609
+ @description: 'Indicates if input has associated addresses'
610
+ hasAddresses : Boolean;
611
+
612
+ @title : 'Input Has Assets'
613
+ @description: 'Indicates if input has assets'
614
+ hasAssets : Boolean;
615
+ }
616
+
617
+ @title : 'Transaction Input Assets'
618
+ @description: 'Projection for Transaction Input Assets'
619
+ @readonly
620
+ entity TransactionInputAssets {
621
+
622
+ @title : 'Transaction Input (key)'
623
+ @description: 'The associated transaction input'
624
+ key input : Association to TransactionInputs;
625
+
626
+ @title : 'Asset Unit (key)'
627
+ @description: 'The asset unit'
628
+ key unit : AssetUnit;
629
+
630
+ @title : 'Asset Details'
631
+ @description: 'Structural slice for asset details'
632
+ asset : AssetSlice;
633
+ }
634
+
635
+ @title : 'Transaction Outputs'
636
+ @description: 'Projection for Transaction Outputs'
637
+ @readonly
638
+ entity TransactionOutputs {
639
+
640
+ @title : 'Transaction (key)'
641
+ @description: 'The associated transaction'
642
+ key tx : Association to Transactions;
643
+
644
+ @title : 'Output Index (key)'
645
+ @description: 'The output index of the output utxo'
646
+ key outputIndex : Integer;
647
+
648
+ @title : 'Output Address'
649
+ @description: 'The associated address of the output utxo'
650
+ address : Association to Addresses;
651
+
652
+ @title : 'UTxO Data'
653
+ @description: 'The UTxO specific data of the output utxo'
654
+ utxo : UTxODataSlice;
655
+
656
+ @title : 'Transaction Output Assets'
657
+ @description: 'Composed assets associated with the output utxo'
658
+ assets : Composition of many TransactionOutputAssets
659
+ on assets.output = $self;
660
+
661
+ @title : 'Has Addresses'
662
+ @description: 'Indicates if output has associated addresses'
663
+ hasAddresses : Boolean;
664
+
665
+ @title : 'Has Assets'
666
+ @description: 'Indicates if output has assets'
667
+ hasAssets : Boolean;
668
+ }
669
+
670
+ @title : 'Transaction Output Assets'
671
+ @description: 'Projection for Transaction Output Assets'
672
+ @readonly
673
+ entity TransactionOutputAssets {
674
+
675
+ @title : 'Transaction Output (key)'
676
+ @description: 'The associated transaction output'
677
+ key output : Association to TransactionOutputs;
678
+
679
+ @title : 'Asset Unit (key)'
680
+ @description: 'The asset unit'
681
+ key unit : AssetUnit;
682
+
683
+ @title : 'Asset Details'
684
+ @description: 'Structural slice for asset details'
685
+ asset : AssetSlice;
686
+ }
687
+
688
+ @title : 'Transaction Metadata'
689
+ @description: 'Projection for Transaction Metadata'
690
+ @readonly
691
+ entity TransactionMetadata {
692
+
693
+ @title : 'ID (key)'
694
+ @description: 'Unique identifier for the metadata entry'
695
+ key id : Integer;
696
+
697
+ @title : 'Transaction (key)'
698
+ @description: 'The associated transaction'
699
+ key tx : Association to Transactions;
700
+
701
+ @title : 'Label'
702
+ @description: 'The metadata label as string'
703
+ label : String;
704
+
705
+ @title : 'Metadata Payload'
706
+ @description: 'The metadata payload as JSON string'
707
+ payload : LargeString;
708
+ }
709
+
710
+ //-----------------------------------------------------
711
+ // M2 - transaction building and submission entities
712
+ //-----------------------------------------------------
713
+ @title : 'Ledger Protocol Parameters'
714
+ @description: 'Entity for storing ledger protocol parameters for transaction building'
715
+ entity LedgerProtocolParameters {
716
+
717
+ @title : 'Network (key)'
718
+ @description: 'The Cardano network type mainnet | preprod | preview'
719
+ key network : String(16);
720
+
721
+ @title : 'Epoch Number (key)'
722
+ @description: 'The epoch number these parameters are valid for'
723
+ key epoch : Integer;
724
+
725
+ @title : 'Minimum Fee A'
726
+ @description: 'The minimum fee factor a for transaction fee calculation'
727
+ minFeeA : Integer;
728
+
729
+ @title : 'Minimum Fee B'
730
+ @description: 'The minimum fee constant b for transaction fee calculation'
731
+ minFeeB : Integer;
732
+
733
+ @title : 'Maximum Sizes'
734
+ @description: 'Maximum sizes for blocks and transactions'
735
+ maxBlockSize : Integer;
736
+
737
+ @title : 'Maximum Transaction Size'
738
+ @description: 'The maximum size for a transaction in bytes'
739
+ maxTxSize : Integer;
740
+
741
+ @title : 'Maximum Block Header Size'
742
+ @description: 'The maximum size for a block header in bytes'
743
+ maxBlockHeaderSize : Integer;
744
+
745
+ @title : 'Key Deposit'
746
+ @description: 'The key deposit amount in lovelace'
747
+ keyDeposit : String(32);
748
+
749
+ @title : 'Pool Deposit'
750
+ @description: 'The pool deposit amount in lovelace'
751
+ poolDeposit : String(32);
752
+
753
+ @title : 'Epochs for Pool Retirement'
754
+ @description: 'The number of epochs before a retiring pool is removed from the ledger'
755
+ eMax : Integer;
756
+
757
+ @title : 'nOpt Parameter'
758
+ @description: 'Stake pool target number parameter nOpt'
759
+ nOpt : Integer;
760
+
761
+ @title : 'a0 Parameter'
762
+ @description: 'Pool pledge influence parameter a0'
763
+ a0 : Decimal(18, 10);
764
+
765
+ @title : 'Rho Parameter'
766
+ @description: 'Monetary expansion parameter rho'
767
+ rho : Decimal(18, 10);
768
+
769
+ @title : 'Tau Parameter'
770
+ @description: 'Treasury cut parameter tau'
771
+ tau : Decimal(18, 10);
772
+
773
+ @title : 'Minimum Pool Cost'
774
+ @description: 'The minimum pool cost in lovelace'
775
+ minPoolCost : String(32);
776
+
777
+ @title : 'Decentralisation Parameter'
778
+ @description: 'The decentralisation parameter of the network'
779
+ decentralisationParam : Decimal(18, 10);
780
+
781
+ @title : 'Extra Entropy'
782
+ @description: 'The extra entropy for pool key generation'
783
+ extraEntropy : String(128);
784
+
785
+ @title : 'Protocol Major Version'
786
+ @description: 'The major version of the protocol'
787
+ protocolMajorVer : Integer;
788
+
789
+ @title : 'Protocol Minor Version'
790
+ @description: 'The minor version of the protocol'
791
+ protocolMinorVer : Integer;
792
+
793
+ @title : 'Min UTxO Value'
794
+ @description: 'The minimum UTxO value in lovelace'
795
+ minUtxo : String(32);
796
+
797
+ @title : 'Min Pool Cost'
798
+ @description: 'The minimum pool cost in lovelace'
799
+ nonce : String(128);
800
+
801
+ @title : 'Cost Models'
802
+ @description: 'The cost models for script execution as JSON blob'
803
+ costModels : LargeString;
804
+
805
+ @title : 'Execution Prices'
806
+ @description: 'The execution prices for script execution'
807
+ priceMem : Decimal(18, 10);
808
+
809
+ @title : 'Execution Steps Price'
810
+ @description: 'The execution steps price for script execution'
811
+ priceStep : Decimal(18, 10);
812
+
813
+ @title : 'Maximum Execution Units'
814
+ @description: 'The maximum execution units for transactions and blocks'
815
+ maxTxExMem : String(32);
816
+
817
+ @title : 'Maximum Execution Steps'
818
+ @description: 'The maximum execution steps for transactions and blocks'
819
+ maxTxExSteps : String(32);
820
+
821
+ @title : 'Maximum Block Execution Units'
822
+ @description: 'The maximum execution units for blocks'
823
+ maxBlockExMem : String(32);
824
+
825
+ @title : 'Maximum Block Execution Steps'
826
+ @description: 'The maximum execution steps for blocks'
827
+ maxBlockExSteps : String(32);
828
+
829
+ @title : 'Maximum Value Size'
830
+ @description: 'The maximum size for a value in bytes'
831
+ maxValSize : String(32);
832
+
833
+ @title : 'Collateral Percent'
834
+ @description: 'The required collateral percentage for script transactions'
835
+ collateralPercent : Integer;
836
+
837
+ @title : 'Maximum Collateral Inputs'
838
+ @description: 'The maximum number of collateral inputs for script transactions'
839
+ maxCollateralInputs : Integer;
840
+
841
+ @title : 'Coins Per UTxO Size'
842
+ @description: 'The coins per UTxO size parameter for calculating min UTxO value'
843
+ coinsPerUtxoSize : String(32);
844
+
845
+ @title : 'Coins Per UTxO Word'
846
+ @description: 'The coins per UTxO word parameter for calculating min UTxO value (alonzo legacy)'
847
+ coinsPerUtxoWord : String(32);
848
+
849
+ @title : 'Fetched At'
850
+ @description: 'Timestamp when these parameters were fetched'
851
+ fetchedAt : Timestamp;
852
+
853
+ @title : 'Source'
854
+ @description: 'Source from which these parameters were fetched'
855
+ source : String(32);
856
+ }
857
+
858
+ @title : 'Transaction Builds'
859
+ @description: 'Entity for storing transaction build attempts and details'
860
+ entity TransactionBuilds : temporal {
861
+
862
+ @title : 'Build ID (key)'
863
+ @description: 'Unique identifier for the transaction build attempt'
864
+ key id : UUID;
865
+
866
+ @title : 'Network'
867
+ @description: 'The Cardano network type mainnet | preprod | preview'
868
+ network : String(10);
869
+
870
+ @title : 'Builder Engine'
871
+ @description: 'The transaction builder engine used for this build'
872
+ builderEngine : String(20);
873
+
874
+ @title : 'Sender Address'
875
+ @description: 'The sender/source address'
876
+ senderAddress : Bech32;
877
+
878
+ @title : 'Change Address'
879
+ @description: 'The change address (defaults to sender address if not specified)'
880
+ changeAddress : Bech32;
881
+
882
+ @title : 'Unsigned Tx CBOR'
883
+ @description: 'The unsigned transaction CBOR as hex string'
884
+ unsignedTxCbor : LargeString;
885
+
886
+ @title : 'Tx Body Hash'
887
+ @description: 'The transaction body hash as hex string'
888
+ txBodyHash : Blake2b256;
889
+
890
+ @title : 'Estimated Fee'
891
+ @description: 'The estimated transaction fee in lovelace'
892
+ fee : Lovelace;
893
+
894
+ @title : 'Transaction Size'
895
+ @description: 'The transaction size in bytes'
896
+ size : Integer;
897
+
898
+ @title : 'Build Created At'
899
+ @description: 'The timestamp when the build was created'
900
+ createdAt : Integer64;
901
+
902
+ @title : 'Build Inputs'
903
+ @description: 'The inputs used in the transaction build'
904
+ inputs : Composition of many TransactionBuildInputs
905
+ on inputs.build = $self;
906
+
907
+ @title : 'Build Outputs'
908
+ @description: 'The outputs created in the transaction build'
909
+ outputs : Composition of many TransactionBuildOutputs
910
+ on outputs.build = $self;
911
+
912
+ @title : 'Associated Submission'
913
+ @description: 'Association to the transaction submission if submitted'
914
+ submission : Association to one TransactionSubmissions
915
+ on submission.build = $self;
916
+
917
+ @title : 'Has Inputs'
918
+ @description: 'Indicates if the build has inputs'
919
+ hasInputs : Boolean;
920
+
921
+ @title : 'Has Outputs'
922
+ @description: 'Indicates if the build has outputs'
923
+ hasOutputs : Boolean;
924
+
925
+ @title : 'Was Submitted'
926
+ @description: 'Indicates if the build was submitted'
927
+ wasSubmitted : Boolean;
928
+ }
929
+
930
+ @title : 'Transaction Build Inputs'
931
+ @description: 'Entity for storing transaction build input details'
932
+ entity TransactionBuildInputs {
933
+
934
+ @title : 'Build (key)'
935
+ @description: 'Association to parent transaction build'
936
+ key build : Association to TransactionBuilds;
937
+
938
+ @title : 'Input Index (key)'
939
+ @description: 'Index of the input in the transaction build'
940
+ key inputIndex : Integer;
941
+
942
+ @title : 'UTxO Transaction Hash'
943
+ @description: 'UTxO transaction hash'
944
+ txHash : Blake2b256;
945
+
946
+ @title : 'UTxO Output Index'
947
+ @description: 'UTxO output index'
948
+ outputIndex : Integer;
949
+
950
+ @title : 'Input Address'
951
+ @description: 'UTxO address'
952
+ address : Bech32;
953
+
954
+ @title : 'Input Lovelace Amount'
955
+ @description: 'Lovelace amount of the input UTxO'
956
+ lovelace : Lovelace;
957
+
958
+ @title : 'Input Assets'
959
+ @description: 'Assets associated with the input UTxO'
960
+ assets : Composition of many TransactionBuildInputAssets
961
+ on assets.input = $self;
962
+
963
+ @title : 'Input Has Assets'
964
+ @description: 'Indicates if input has native assets'
965
+ hasAssets : Boolean;
966
+ }
967
+
968
+ @title : 'Transaction Build Input Assets'
969
+ @description: 'Entity for storing assets associated with transaction build inputs'
970
+ entity TransactionBuildInputAssets {
971
+
972
+ @title : 'Transaction Build Input (key)'
973
+ @description: 'Build input association'
974
+ key input : Association to TransactionBuildInputs;
975
+
976
+ @title : 'Asset Unit (key)'
977
+ @description: 'Asset unit (policyId + assetNameHex)'
978
+ key unit : AssetUnit;
979
+
980
+ @title : 'Asset Details'
981
+ @description: 'Structural slice for asset details'
982
+ asset : AssetSlice;
983
+ }
984
+
985
+ @title : 'Transaction Build Outputs'
986
+ @description: 'Entity for storing transaction build output details'
987
+ entity TransactionBuildOutputs {
988
+
989
+ @title : 'Build (key)'
990
+ @description: 'Association to parent transaction build'
991
+ key build : Association to TransactionBuilds;
992
+
993
+ @title : 'Output Index (key)'
994
+ @description: 'Index in outputs array'
995
+ key outputIndex : Integer;
996
+
997
+ @title : 'Recipient Address'
998
+ @description: 'Recipient address in bech32 format'
999
+ address : Bech32;
1000
+
1001
+ @title : 'Lovelace Amount'
1002
+ @description: 'Lovelace amount to send'
1003
+ lovelace : Lovelace;
1004
+
1005
+ @title : 'Is Change Output'
1006
+ @description: 'Indicates if this is the change output'
1007
+ isChange : Boolean;
1008
+
1009
+ @title : 'Output Assets'
1010
+ @description: 'Assets associated with this output'
1011
+ assets : Composition of many TransactionBuildOutputAssets
1012
+ on assets.output = $self;
1013
+
1014
+ @title : 'Has Assets'
1015
+ @description: 'Indicates if output has native assets'
1016
+ hasAssets : Boolean;
1017
+ }
1018
+
1019
+ @title : 'Transaction Build Output Assets'
1020
+ @description: 'Entity for storing assets associated with transaction build outputs'
1021
+ entity TransactionBuildOutputAssets {
1022
+
1023
+ @title : 'Transaction Build Output (key)'
1024
+ @description: 'Association to parent transaction build output'
1025
+ key output : Association to TransactionBuildOutputs;
1026
+
1027
+ @title : 'Asset Unit (key)'
1028
+ @description: 'Asset unit (policyId + assetNameHex)'
1029
+ key unit : AssetUnit;
1030
+
1031
+ @title : 'Asset Details'
1032
+ @description: 'Structural slice for asset details'
1033
+ asset : AssetSlice;
1034
+
1035
+ }
1036
+
1037
+ @title : 'Transaction Submissions'
1038
+ @description: 'Entity for storing transaction submission attempts and status'
1039
+ entity TransactionSubmissions {
1040
+
1041
+ @title : 'Submission ID (key)'
1042
+ @description: 'Unique identifier for the transaction submission'
1043
+ key id : UUID;
1044
+
1045
+ @title : 'Associated Build'
1046
+ @description: 'Association to the transaction build being submitted'
1047
+ build : Association to TransactionBuilds;
1048
+
1049
+ @title : 'Signged Tx CBOR'
1050
+ @description: 'The signed transaction CBOR as hex string'
1051
+ signedTxCbor : LargeString;
1052
+
1053
+ @title : 'Transaction Hash'
1054
+ @description: 'Actual transaction hash after signing'
1055
+ txHash : Blake2b256;
1056
+
1057
+ @title : 'Submission Time'
1058
+ @description: 'Submission time as unix timestamp'
1059
+ submittedAt : Integer64;
1060
+
1061
+ @title : 'Submission Status'
1062
+ @description: 'Current status of the transaction submission (pending, submitted, confirmed, failed, rejected)'
1063
+ status : SubmissionStatus default 'pending' @readonly;
1064
+
1065
+ @title : 'Error Code'
1066
+ @description: 'Error code if failed'
1067
+ errorCode : String(50);
1068
+
1069
+ @title : 'Error Message'
1070
+ @description: 'Detailed error message if failed'
1071
+ errorMessage : LargeString;
1072
+
1073
+ @title : 'Retry Count'
1074
+ @description: 'Number of retry attempts'
1075
+ retryCount : Integer;
1076
+
1077
+ @title : 'Submission Errors'
1078
+ @description: 'Composition of errors associated with this submission'
1079
+ errors : Composition of many TransactionSubmissionErrors
1080
+ on errors.submission = $self;
1081
+
1082
+ @title : 'Has Errors'
1083
+ @description: 'Indicates if submission has errors'
1084
+ hasErrors : Boolean;
1085
+ }
1086
+
1087
+ @title : 'Transaction Submission Errors'
1088
+ @description: 'Entity for storing errors encountered during transaction submission'
1089
+ entity TransactionSubmissionErrors {
1090
+
1091
+ @title : 'Error ID (key)'
1092
+ @description: 'Unique identifier for the submission error'
1093
+ key id : UUID;
1094
+
1095
+ @title : 'Associated Submission'
1096
+ @description: 'Association to parent transaction submission'
1097
+ submission : Association to TransactionSubmissions;
1098
+
1099
+ @title : 'Error Occurred At'
1100
+ @description: 'Timestamp when the error occurred as unix timestamp'
1101
+ occurredAt : Integer64;
1102
+
1103
+ @title : 'Error Type'
1104
+ @description: 'Type/category of the error encountered'
1105
+ errorType : String(50);
1106
+
1107
+ @title : 'Error Code'
1108
+ @description: 'Specific error code'
1109
+ errorCode : String(50);
1110
+
1111
+ @title : 'Error Message'
1112
+ @description: 'Detailed error message'
1113
+ errorMessage : LargeString;
1114
+
1115
+ @title : 'Error Details'
1116
+ @description: 'Additional error context as JSON'
1117
+ errorDetails : LargeString;
1118
+
1119
+ @title : 'Is Recoverable'
1120
+ @description: 'Indicates if error is recoverable via retry'
1121
+ isRecoverable : Boolean;
1122
+ }
1123
+
1124
+ @title : 'Submission Status'
1125
+ @description: 'Enum type for transaction submission status'
1126
+ type SubmissionStatus : String(20) enum {
1127
+ pending = 'pending';
1128
+ submitted = 'submitted';
1129
+ confirmed = 'confirmed';
1130
+ failed = 'failed';
1131
+ }
1132
+
1133
+ //-----------------------------------------------------
1134
+ // M3 - External Signing Workflow Entities & Address Additions
1135
+ //-----------------------------------------------------
1136
+ @title : 'Signing Request Status'
1137
+ @description: 'Enum type for signing request status'
1138
+ type SigningStatus : String(20) enum {
1139
+ pending = 'pending';
1140
+ signed = 'signed';
1141
+ verified = 'verified';
1142
+ submitted = 'submitted';
1143
+ expired = 'expired';
1144
+ failed = 'failed';
1145
+ }
1146
+ @title : 'Address Transactions'
1147
+ @description : 'Association entity for transactions involving an address'
1148
+ entity AddressTransactions {
1149
+
1150
+ @title : 'Address (key)'
1151
+ @description: 'The Bech32 encoded address associated with the transaction'
1152
+ key address : Association to Addresses;
1153
+
1154
+ @title : 'Transaction (key)'
1155
+ @description: 'The associated transaction'
1156
+ key tx : Association to Transactions;
1157
+
1158
+ @title : 'Net Amount (Lovelace)'
1159
+ @description: 'Net lovelace change for this address in this transaction (positive = received, negative = sent)'
1160
+ netAmount : Int64;
1161
+
1162
+ @title : 'Block Time'
1163
+ @description: 'Block time of the transaction (denormalized for sorting)'
1164
+ blockTime : Integer64;
1165
+
1166
+ @title : 'Net Assets'
1167
+ @description: 'JSON array of net asset changes [{unit, policyId, assetName, quantity}] (positive = received, negative = sent)'
1168
+ netAssets : LargeString;
1169
+
1170
+ @title : 'Has Assets'
1171
+ @description: 'Indicates if this transaction involves native assets for this address'
1172
+ hasAssets : Boolean default false;
1173
+ }
1174
+
1175
+ @title : 'Address Signing Requests'
1176
+ @description : 'Association entity for signing requests involving an address'
1177
+ entity AddressSigningRequests {
1178
+
1179
+ @title : 'Address (key)'
1180
+ @description: 'The Bech32 encoded address associated with the signing request'
1181
+ key address : Association to Addresses;
1182
+
1183
+ @title : 'Signing Request (key)'
1184
+ @description: 'The associated signing request'
1185
+ key signingRequest : Association to SigningRequests;
1186
+ }
1187
+
1188
+ @title : 'Address Transaction Builds'
1189
+ @description : 'Association entity for transaction builds involving an address'
1190
+ entity AddressTransactionBuilds{
1191
+
1192
+ @title : 'Address (key)'
1193
+ @description: 'The Bech32 encoded address associated with the transaction build'
1194
+ key address : Association to Addresses;
1195
+
1196
+ @title : 'Transaction Build (key)'
1197
+ @description: 'The associated transaction build'
1198
+ key txBuild : Association to TransactionBuilds;
1199
+ }
1200
+
1201
+ @title : 'Signing Requests'
1202
+ @description: 'Entity for tracking external signing requests and their workflow state'
1203
+ entity SigningRequests {
1204
+
1205
+ @title : 'Signing Request ID (key)'
1206
+ @description: 'Unique identifier for the signing request'
1207
+ key id : UUID;
1208
+
1209
+ @title : 'Associated Build'
1210
+ @description: 'Association to the transaction build being signed'
1211
+ build : Association to TransactionBuilds;
1212
+
1213
+ @title : 'Transaction Body Hash'
1214
+ @description: 'The hash of the transaction body (data to be signed)'
1215
+ txBodyHash : Blake2b256;
1216
+
1217
+ @title : 'Unsigned Transaction CBOR'
1218
+ @description: 'The unsigned transaction in CBOR hex format'
1219
+ unsignedTxCbor : LargeString;
1220
+
1221
+ @title : 'Network'
1222
+ @description: 'Cardano network (mainnet | preprod | preview)'
1223
+ network : String(10);
1224
+
1225
+ @title : 'Status'
1226
+ @description: 'Current status of the signing request'
1227
+ status : SigningStatus default 'pending' @readonly;
1228
+
1229
+ @title : 'Created At'
1230
+ @description: 'Timestamp when the signing request was created'
1231
+ createdAt : Timestamp;
1232
+
1233
+ @title : 'Expires At'
1234
+ @description: 'Timestamp when the signing request expires'
1235
+ expiresAt : Timestamp;
1236
+
1237
+ @title : 'Signed At'
1238
+ @description: 'Timestamp when the transaction was signed'
1239
+ signedAt : Timestamp;
1240
+
1241
+ @title : 'Submitted At'
1242
+ @description: 'Timestamp when the transaction was submitted'
1243
+ submittedAt : Timestamp;
1244
+
1245
+ @title : 'Cardano CLI Command'
1246
+ @description: 'Example command to sign with Cardano CLI'
1247
+ cardanoCliCommand : LargeString;
1248
+
1249
+ @title : 'CIP-30 CBOR'
1250
+ @description: 'Transaction CBOR for browser wallet signing (CIP-30)'
1251
+ cip30TxCbor : LargeString;
1252
+
1253
+ @title : 'Signer Type'
1254
+ @description: 'Type of signer used (cardano-cli | browser-wallet | hardware-wallet | custom)'
1255
+ signerType : String(20);
1256
+
1257
+ @title : 'Signer Info'
1258
+ @description: 'Additional information about the signer (wallet name, etc.)'
1259
+ signerInfo : String(100);
1260
+
1261
+ @title : 'Signature Verifications'
1262
+ @description: 'Composition of signature verification attempts'
1263
+ verifications : Composition of many SignatureVerifications
1264
+ on verifications.signingRequest = $self;
1265
+
1266
+ @title : 'Associated Submission'
1267
+ @description: 'Association to the transaction submission (if submitted)'
1268
+ submission : Association to TransactionSubmissions;
1269
+
1270
+ @title : 'Error Message'
1271
+ @description: 'Error message if signing or verification failed'
1272
+ errorMessage : LargeString;
1273
+ }
1274
+
1275
+ @title : 'Signature Verifications'
1276
+ @description: 'Entity for storing signature verification results'
1277
+ entity SignatureVerifications {
1278
+
1279
+ @title : 'Verification ID (key)'
1280
+ @description: 'Unique identifier for the verification attempt'
1281
+ key id : UUID;
1282
+
1283
+ @title : 'Associated Signing Request'
1284
+ @description: 'Association to the parent signing request'
1285
+ signingRequest : Association to SigningRequests;
1286
+
1287
+ @title : 'Signed Transaction CBOR'
1288
+ @description: 'The signed transaction CBOR that was verified'
1289
+ signedTxCbor : LargeString;
1290
+
1291
+ @title : 'Is Valid'
1292
+ @description: 'Whether the signature is valid'
1293
+ isValid : Boolean;
1294
+
1295
+ @title : 'Transaction Body Hash'
1296
+ @description: 'The verified transaction body hash'
1297
+ txBodyHash : Blake2b256;
1298
+
1299
+ @title : 'Witness Count'
1300
+ @description: 'Number of signatures found'
1301
+ witnessCount : Integer;
1302
+
1303
+ @title : 'Signer Key Hashes'
1304
+ @description: 'JSON array of public key hashes that signed the transaction'
1305
+ signerKeyHashes : LargeString;
1306
+
1307
+ @title : 'Error Message'
1308
+ @description: 'Error message if verification failed'
1309
+ errorMessage : LargeString;
1310
+
1311
+ @title : 'Warnings'
1312
+ @description: 'JSON array of warning messages'
1313
+ warnings : LargeString;
1314
+
1315
+ @title : 'Verified At'
1316
+ @description: 'Timestamp when the verification was performed'
1317
+ verifiedAt : Timestamp;
1318
+ }