@odatano/core 2.0.0-rc.41 → 2.0.0-rc.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@cds-models/CardanoIndexerService/index.d.ts +47 -0
- package/@cds-models/CardanoIndexerService/index.js +7 -0
- package/@cds-models/CardanoODataService/index.d.ts +44 -0
- package/@cds-models/CardanoODataService/index.js +4 -0
- package/@cds-models/CardanoSignService/index.d.ts +3 -0
- package/@cds-models/CardanoTransactionService/index.d.ts +3 -0
- package/@cds-models/index.d.ts +3 -0
- package/@cds-models/odatano/cardano/index.d.ts +33 -0
- package/@cds-models/odatano/cardano/index.js +3 -0
- package/README.md +195 -195
- package/db/schema.cds +27 -0
- package/db/types.cds +421 -409
- package/package.json +1 -1
- package/srv/blockchain/backends/blockfrost-backend.js +1 -0
- package/srv/blockchain/backends/koios-backend.js +19 -0
- package/srv/blockchain/backends/ogmios-backend.js +16 -12
- package/srv/blockchain/cardano-indexer.js +26 -9
- package/srv/blockchain/crawler/credential-backfill.d.ts +37 -0
- package/srv/blockchain/crawler/credential-backfill.js +124 -0
- package/srv/blockchain/crawler/transaction-backfill.d.ts +3 -2
- package/srv/blockchain/crawler/transaction-backfill.js +14 -4
- package/srv/blockchain/crawler/utxo-set-import.d.ts +20 -1
- package/srv/blockchain/crawler/utxo-set-import.js +71 -3
- package/srv/blockchain/ledger-state.d.ts +6 -1
- package/srv/blockchain/ledger-state.js +3 -0
- package/srv/blockchain/stored-chain.js +9 -1
- package/srv/blockchain/transaction-building/buildooor-fee-patch.d.ts +17 -0
- package/srv/blockchain/transaction-building/buildooor-fee-patch.js +74 -0
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts +10 -1
- package/srv/blockchain/transaction-building/buildooor-tx.js +55 -19
- package/srv/blockchain/transaction-rows.d.ts +1 -1
- package/srv/blockchain/transaction-rows.js +2 -1
- package/srv/cardano-indexer-service.cds +30 -3
- package/srv/cardano-indexer-service.js +48 -3
- package/srv/cardano-service.cds +344 -332
- package/srv/cardano-service.js +9 -0
- package/srv/cbor/index.d.ts +1 -0
- package/srv/cbor/index.js +4 -1
- package/srv/cbor/plutus-data-json.d.ts +24 -0
- package/srv/cbor/plutus-data-json.js +32 -0
- package/srv/utils/agent-grants.js +1 -1
- package/srv/utils/db-indexes.js +5 -0
- package/srv/utils/mappers.d.ts +6 -2
- package/srv/utils/mappers.js +20 -0
- package/srv/utils/reference-script.d.ts +37 -0
- package/srv/utils/reference-script.js +95 -0
- package/srv/utils/types.d.ts +19 -0
package/srv/cardano-service.cds
CHANGED
|
@@ -1,332 +1,344 @@
|
|
|
1
|
-
using {odatano.cardano as db} from '../db/schema';
|
|
2
|
-
using { Blake2b256, Bech32, AssetUnit, ParsedTransaction, TransactionConfirmations } from '../db/types';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Cardano OData Service
|
|
6
|
-
*
|
|
7
|
-
* Handles external read-only queries for Cardano blockchain data, including:
|
|
8
|
-
* - Retrieving network information, blocks, epochs, pools, dreps, transactions, accounts, addresses, UTxOs, assets, and metadata
|
|
9
|
-
* - Providing actions for fetching specific data by identifiers (hashes, addresses, etc.) and for retrieving the latest blockchain state (latest block, epoch, protocol parameters)
|
|
10
|
-
*
|
|
11
|
-
* ## Security: Authentication & Authorization
|
|
12
|
-
*
|
|
13
|
-
* All services use `@requires: 'authenticated-user'` (service-level gate).
|
|
14
|
-
* The XSUAA scopes defined in xs-security.json (Read, Transact, Sign) are available
|
|
15
|
-
* for consumer-level role assignment but are NOT enforced per-action in ODATANO itself.
|
|
16
|
-
*
|
|
17
|
-
* This is intentional — ODATANO is a blockchain bridge, not a multi-tenant application.
|
|
18
|
-
* Per-resource ownership checks (IDOR prevention) are deliberately omitted because:
|
|
19
|
-
*
|
|
20
|
-
* 1. **Blockchain security model**: Unsigned transaction CBOR is not exploitable without
|
|
21
|
-
* the corresponding private key. Viewing a build/signing request does not enable
|
|
22
|
-
* fund theft — only the key holder can sign and submit.
|
|
23
|
-
*
|
|
24
|
-
* 2. **Cross-address operations are legitimate**: Smart contract interactions routinely
|
|
25
|
-
* require building transactions for addresses the caller does not own — e.g. script
|
|
26
|
-
* redemptions, multi-party Plutus workflows, or DApp backends building on behalf of users.
|
|
27
|
-
* Enforcing sender == authenticated user would break these use cases.
|
|
28
|
-
*
|
|
29
|
-
* 3. **Consumer responsibility**: Consumers deploying ODATANO in multi-user environments
|
|
30
|
-
* should add their own authorization layer (e.g. `@restrict` annotations, custom
|
|
31
|
-
* middleware) that maps JWT claims to allowed wallet addresses if needed.
|
|
32
|
-
*/
|
|
33
|
-
@requires: 'authenticated-user'
|
|
34
|
-
@path: '/odata/v4/cardano'
|
|
35
|
-
service CardanoODataService @(impl: './cardano-service') {
|
|
36
|
-
|
|
37
|
-
// ---------------------------------------------------------------------------
|
|
38
|
-
// Entity Projections
|
|
39
|
-
// ---------------------------------------------------------------------------
|
|
40
|
-
|
|
41
|
-
@readonly
|
|
42
|
-
@title : 'Network Information'
|
|
43
|
-
@description: 'Projection for Network Information'
|
|
44
|
-
entity NetworkInformation as projection on db.NetworkInformation;
|
|
45
|
-
|
|
46
|
-
@readonly
|
|
47
|
-
@title : 'Blocks'
|
|
48
|
-
@description: 'Projection for Blocks'
|
|
49
|
-
entity Blocks as projection on db.Blocks;
|
|
50
|
-
|
|
51
|
-
@readonly
|
|
52
|
-
@title : 'Epochs'
|
|
53
|
-
@description: 'Projection for Epochs'
|
|
54
|
-
entity Epochs as projection on db.Epochs;
|
|
55
|
-
|
|
56
|
-
@readonly
|
|
57
|
-
@title : 'Pools'
|
|
58
|
-
@description: 'Projection for Pools'
|
|
59
|
-
entity Pools as projection on db.Pools;
|
|
60
|
-
|
|
61
|
-
@readonly
|
|
62
|
-
@title : 'Dreps'
|
|
63
|
-
@description: 'Projection for Dreps'
|
|
64
|
-
entity Dreps as projection on db.Dreps;
|
|
65
|
-
|
|
66
|
-
@readonly
|
|
67
|
-
@title : 'Pool Epoch Snapshots'
|
|
68
|
-
@description: 'Projection for per-epoch stake-pool snapshots written by the chain crawler'
|
|
69
|
-
entity PoolEpochSnapshots as projection on db.PoolEpochSnapshots;
|
|
70
|
-
|
|
71
|
-
@readonly
|
|
72
|
-
@title : 'DRep Epoch Snapshots'
|
|
73
|
-
@description: 'Projection for per-epoch DRep snapshots written by the chain crawler'
|
|
74
|
-
entity DrepEpochSnapshots as projection on db.DrepEpochSnapshots;
|
|
75
|
-
|
|
76
|
-
@readonly
|
|
77
|
-
@title : 'Epoch Ledger Snapshots'
|
|
78
|
-
@description: 'Projection for per-epoch network ledger figures written by the chain crawler'
|
|
79
|
-
entity EpochLedgerSnapshots as projection on db.EpochLedgerSnapshots;
|
|
80
|
-
|
|
81
|
-
@readonly
|
|
82
|
-
@title : 'Assets'
|
|
83
|
-
@description: 'Projection for Native-Asset Information'
|
|
84
|
-
entity Assets as projection on db.Assets;
|
|
85
|
-
|
|
86
|
-
@readonly
|
|
87
|
-
@title : 'Asset History'
|
|
88
|
-
@description: 'Projection for Native-Asset Mint/Burn History'
|
|
89
|
-
entity AssetHistory as projection on db.AssetHistory;
|
|
90
|
-
|
|
91
|
-
@readonly
|
|
92
|
-
@title : 'Transactions'
|
|
93
|
-
@description: 'Projection for Transactions'
|
|
94
|
-
entity Transactions as projection on db.Transactions;
|
|
95
|
-
|
|
96
|
-
@readonly
|
|
97
|
-
@title : 'Transaction Inputs'
|
|
98
|
-
@description: 'Projection for Transaction Inputs'
|
|
99
|
-
entity TransactionInputs as projection on db.TransactionInputs;
|
|
100
|
-
|
|
101
|
-
@readonly
|
|
102
|
-
@title : 'Transaction Outputs'
|
|
103
|
-
@description: 'Projection for Transaction Outputs'
|
|
104
|
-
entity TransactionOutputs as projection on db.TransactionOutputs;
|
|
105
|
-
|
|
106
|
-
@readonly
|
|
107
|
-
@title : 'Transaction Input Assets'
|
|
108
|
-
@description: 'Projection for Transaction Input Assets'
|
|
109
|
-
entity TransactionInputAssets as projection on db.TransactionInputAssets;
|
|
110
|
-
|
|
111
|
-
@readonly
|
|
112
|
-
@title : 'Transaction Output Assets'
|
|
113
|
-
@description: 'Projection for Transaction Output Assets'
|
|
114
|
-
entity TransactionOutputAssets as projection on db.TransactionOutputAssets;
|
|
115
|
-
|
|
116
|
-
@readonly
|
|
117
|
-
@title : 'Transaction Certificates'
|
|
118
|
-
@description: 'Projection for Transaction Certificates (crawler-fed, crawler.certificates)'
|
|
119
|
-
entity TransactionCertificates as projection on db.TransactionCertificates;
|
|
120
|
-
|
|
121
|
-
@readonly
|
|
122
|
-
@title : 'Transaction Withdrawals'
|
|
123
|
-
@description: 'Projection for Transaction Withdrawals (crawler-fed, crawler.certificates)'
|
|
124
|
-
entity TransactionWithdrawals as projection on db.TransactionWithdrawals;
|
|
125
|
-
|
|
126
|
-
@readonly
|
|
127
|
-
@title : 'Transaction Redeemers'
|
|
128
|
-
@description: 'Projection for Transaction Redeemers (crawler-fed, Ogmios chain-sync)'
|
|
129
|
-
entity TransactionRedeemers as projection on db.TransactionRedeemers;
|
|
130
|
-
|
|
131
|
-
@readonly
|
|
132
|
-
@title : '
|
|
133
|
-
@description: '
|
|
134
|
-
entity
|
|
135
|
-
|
|
136
|
-
@readonly
|
|
137
|
-
@title : 'Ledger
|
|
138
|
-
@description: '
|
|
139
|
-
entity
|
|
140
|
-
|
|
141
|
-
@readonly
|
|
142
|
-
@title : 'Ledger
|
|
143
|
-
@description: '
|
|
144
|
-
entity
|
|
145
|
-
|
|
146
|
-
@readonly
|
|
147
|
-
@title : 'Ledger
|
|
148
|
-
@description: '
|
|
149
|
-
entity
|
|
150
|
-
|
|
151
|
-
@readonly
|
|
152
|
-
@title : 'Ledger
|
|
153
|
-
@description: '
|
|
154
|
-
entity
|
|
155
|
-
|
|
156
|
-
@readonly
|
|
157
|
-
@title : 'Accounts'
|
|
158
|
-
@description: '
|
|
159
|
-
entity
|
|
160
|
-
|
|
161
|
-
@readonly
|
|
162
|
-
@title : '
|
|
163
|
-
@description: 'Projection for
|
|
164
|
-
entity
|
|
165
|
-
|
|
166
|
-
@readonly
|
|
167
|
-
@title : '
|
|
168
|
-
@description: 'Projection for
|
|
169
|
-
entity
|
|
170
|
-
|
|
171
|
-
@readonly
|
|
172
|
-
@title : 'Address
|
|
173
|
-
@description: 'Projection for Address
|
|
174
|
-
entity
|
|
175
|
-
|
|
176
|
-
@readonly
|
|
177
|
-
@title
|
|
178
|
-
@description: 'Projection for Address
|
|
179
|
-
entity
|
|
180
|
-
|
|
181
|
-
@readonly
|
|
182
|
-
@title
|
|
183
|
-
@description: 'Projection for
|
|
184
|
-
entity
|
|
185
|
-
|
|
186
|
-
@readonly
|
|
187
|
-
@title : '
|
|
188
|
-
@description: 'Projection for
|
|
189
|
-
entity
|
|
190
|
-
|
|
191
|
-
@readonly
|
|
192
|
-
@title : '
|
|
193
|
-
@description: 'Projection for
|
|
194
|
-
entity
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
@
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
@
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
@
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
@
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
1
|
+
using {odatano.cardano as db} from '../db/schema';
|
|
2
|
+
using { Blake2b256, Bech32, AssetUnit, ParsedTransaction, TransactionConfirmations } from '../db/types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Cardano OData Service
|
|
6
|
+
*
|
|
7
|
+
* Handles external read-only queries for Cardano blockchain data, including:
|
|
8
|
+
* - Retrieving network information, blocks, epochs, pools, dreps, transactions, accounts, addresses, UTxOs, assets, and metadata
|
|
9
|
+
* - Providing actions for fetching specific data by identifiers (hashes, addresses, etc.) and for retrieving the latest blockchain state (latest block, epoch, protocol parameters)
|
|
10
|
+
*
|
|
11
|
+
* ## Security: Authentication & Authorization
|
|
12
|
+
*
|
|
13
|
+
* All services use `@requires: 'authenticated-user'` (service-level gate).
|
|
14
|
+
* The XSUAA scopes defined in xs-security.json (Read, Transact, Sign) are available
|
|
15
|
+
* for consumer-level role assignment but are NOT enforced per-action in ODATANO itself.
|
|
16
|
+
*
|
|
17
|
+
* This is intentional — ODATANO is a blockchain bridge, not a multi-tenant application.
|
|
18
|
+
* Per-resource ownership checks (IDOR prevention) are deliberately omitted because:
|
|
19
|
+
*
|
|
20
|
+
* 1. **Blockchain security model**: Unsigned transaction CBOR is not exploitable without
|
|
21
|
+
* the corresponding private key. Viewing a build/signing request does not enable
|
|
22
|
+
* fund theft — only the key holder can sign and submit.
|
|
23
|
+
*
|
|
24
|
+
* 2. **Cross-address operations are legitimate**: Smart contract interactions routinely
|
|
25
|
+
* require building transactions for addresses the caller does not own — e.g. script
|
|
26
|
+
* redemptions, multi-party Plutus workflows, or DApp backends building on behalf of users.
|
|
27
|
+
* Enforcing sender == authenticated user would break these use cases.
|
|
28
|
+
*
|
|
29
|
+
* 3. **Consumer responsibility**: Consumers deploying ODATANO in multi-user environments
|
|
30
|
+
* should add their own authorization layer (e.g. `@restrict` annotations, custom
|
|
31
|
+
* middleware) that maps JWT claims to allowed wallet addresses if needed.
|
|
32
|
+
*/
|
|
33
|
+
@requires: 'authenticated-user'
|
|
34
|
+
@path: '/odata/v4/cardano'
|
|
35
|
+
service CardanoODataService @(impl: './cardano-service') {
|
|
36
|
+
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// Entity Projections
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
|
|
41
|
+
@readonly
|
|
42
|
+
@title : 'Network Information'
|
|
43
|
+
@description: 'Projection for Network Information'
|
|
44
|
+
entity NetworkInformation as projection on db.NetworkInformation;
|
|
45
|
+
|
|
46
|
+
@readonly
|
|
47
|
+
@title : 'Blocks'
|
|
48
|
+
@description: 'Projection for Blocks'
|
|
49
|
+
entity Blocks as projection on db.Blocks;
|
|
50
|
+
|
|
51
|
+
@readonly
|
|
52
|
+
@title : 'Epochs'
|
|
53
|
+
@description: 'Projection for Epochs'
|
|
54
|
+
entity Epochs as projection on db.Epochs;
|
|
55
|
+
|
|
56
|
+
@readonly
|
|
57
|
+
@title : 'Pools'
|
|
58
|
+
@description: 'Projection for Pools'
|
|
59
|
+
entity Pools as projection on db.Pools;
|
|
60
|
+
|
|
61
|
+
@readonly
|
|
62
|
+
@title : 'Dreps'
|
|
63
|
+
@description: 'Projection for Dreps'
|
|
64
|
+
entity Dreps as projection on db.Dreps;
|
|
65
|
+
|
|
66
|
+
@readonly
|
|
67
|
+
@title : 'Pool Epoch Snapshots'
|
|
68
|
+
@description: 'Projection for per-epoch stake-pool snapshots written by the chain crawler'
|
|
69
|
+
entity PoolEpochSnapshots as projection on db.PoolEpochSnapshots;
|
|
70
|
+
|
|
71
|
+
@readonly
|
|
72
|
+
@title : 'DRep Epoch Snapshots'
|
|
73
|
+
@description: 'Projection for per-epoch DRep snapshots written by the chain crawler'
|
|
74
|
+
entity DrepEpochSnapshots as projection on db.DrepEpochSnapshots;
|
|
75
|
+
|
|
76
|
+
@readonly
|
|
77
|
+
@title : 'Epoch Ledger Snapshots'
|
|
78
|
+
@description: 'Projection for per-epoch network ledger figures written by the chain crawler'
|
|
79
|
+
entity EpochLedgerSnapshots as projection on db.EpochLedgerSnapshots;
|
|
80
|
+
|
|
81
|
+
@readonly
|
|
82
|
+
@title : 'Assets'
|
|
83
|
+
@description: 'Projection for Native-Asset Information'
|
|
84
|
+
entity Assets as projection on db.Assets;
|
|
85
|
+
|
|
86
|
+
@readonly
|
|
87
|
+
@title : 'Asset History'
|
|
88
|
+
@description: 'Projection for Native-Asset Mint/Burn History'
|
|
89
|
+
entity AssetHistory as projection on db.AssetHistory;
|
|
90
|
+
|
|
91
|
+
@readonly
|
|
92
|
+
@title : 'Transactions'
|
|
93
|
+
@description: 'Projection for Transactions'
|
|
94
|
+
entity Transactions as projection on db.Transactions;
|
|
95
|
+
|
|
96
|
+
@readonly
|
|
97
|
+
@title : 'Transaction Inputs'
|
|
98
|
+
@description: 'Projection for Transaction Inputs'
|
|
99
|
+
entity TransactionInputs as projection on db.TransactionInputs;
|
|
100
|
+
|
|
101
|
+
@readonly
|
|
102
|
+
@title : 'Transaction Outputs'
|
|
103
|
+
@description: 'Projection for Transaction Outputs'
|
|
104
|
+
entity TransactionOutputs as projection on db.TransactionOutputs;
|
|
105
|
+
|
|
106
|
+
@readonly
|
|
107
|
+
@title : 'Transaction Input Assets'
|
|
108
|
+
@description: 'Projection for Transaction Input Assets'
|
|
109
|
+
entity TransactionInputAssets as projection on db.TransactionInputAssets;
|
|
110
|
+
|
|
111
|
+
@readonly
|
|
112
|
+
@title : 'Transaction Output Assets'
|
|
113
|
+
@description: 'Projection for Transaction Output Assets'
|
|
114
|
+
entity TransactionOutputAssets as projection on db.TransactionOutputAssets;
|
|
115
|
+
|
|
116
|
+
@readonly
|
|
117
|
+
@title : 'Transaction Certificates'
|
|
118
|
+
@description: 'Projection for Transaction Certificates (crawler-fed, crawler.certificates)'
|
|
119
|
+
entity TransactionCertificates as projection on db.TransactionCertificates;
|
|
120
|
+
|
|
121
|
+
@readonly
|
|
122
|
+
@title : 'Transaction Withdrawals'
|
|
123
|
+
@description: 'Projection for Transaction Withdrawals (crawler-fed, crawler.certificates)'
|
|
124
|
+
entity TransactionWithdrawals as projection on db.TransactionWithdrawals;
|
|
125
|
+
|
|
126
|
+
@readonly
|
|
127
|
+
@title : 'Transaction Redeemers'
|
|
128
|
+
@description: 'Projection for Transaction Redeemers (crawler-fed, Ogmios chain-sync)'
|
|
129
|
+
entity TransactionRedeemers as projection on db.TransactionRedeemers;
|
|
130
|
+
|
|
131
|
+
@readonly
|
|
132
|
+
@title : 'Transaction Datums'
|
|
133
|
+
@description: 'Projection for Transaction Datums (crawler-fed, Ogmios chain-sync): witness-set datums byte for byte'
|
|
134
|
+
entity TransactionDatums as projection on db.TransactionDatums;
|
|
135
|
+
|
|
136
|
+
@readonly
|
|
137
|
+
@title : 'Ledger UTxOs'
|
|
138
|
+
@description: 'Crawler-maintained UTxO set (crawler.utxoSet); unspent while spentTxHash is null'
|
|
139
|
+
entity LedgerUTxOs as projection on db.LedgerUTxOs;
|
|
140
|
+
|
|
141
|
+
@readonly
|
|
142
|
+
@title : 'Ledger UTxO Assets'
|
|
143
|
+
@description: 'Native assets of a LedgerUTxOs row'
|
|
144
|
+
entity LedgerUTxOAssets as projection on db.LedgerUTxOAssets;
|
|
145
|
+
|
|
146
|
+
@readonly
|
|
147
|
+
@title : 'Ledger Addresses'
|
|
148
|
+
@description: 'Per-address balances from the crawler-maintained UTxO set (crawler.utxoSet)'
|
|
149
|
+
entity LedgerAddresses as projection on db.LedgerAddresses;
|
|
150
|
+
|
|
151
|
+
@readonly
|
|
152
|
+
@title : 'Ledger Address Assets'
|
|
153
|
+
@description: 'Native-asset balances per address (crawler.utxoSet)'
|
|
154
|
+
entity LedgerAddressAssets as projection on db.LedgerAddressAssets;
|
|
155
|
+
|
|
156
|
+
@readonly
|
|
157
|
+
@title : 'Ledger Accounts'
|
|
158
|
+
@description: 'Per-stake-key balances from the crawler-maintained UTxO set (crawler.utxoSet)'
|
|
159
|
+
entity LedgerAccounts as projection on db.LedgerAccounts;
|
|
160
|
+
|
|
161
|
+
@readonly
|
|
162
|
+
@title : 'Accounts'
|
|
163
|
+
@description: 'Projection for Accounts'
|
|
164
|
+
entity Accounts as projection on db.Accounts;
|
|
165
|
+
|
|
166
|
+
@readonly
|
|
167
|
+
@title : 'Addresses'
|
|
168
|
+
@description: 'Projection for Addresses'
|
|
169
|
+
entity Addresses as projection on db.Addresses;
|
|
170
|
+
|
|
171
|
+
@readonly
|
|
172
|
+
@title : 'Address Assets'
|
|
173
|
+
@description: 'Projection for Address Assets'
|
|
174
|
+
entity AddressAssets as projection on db.AddressAssets;
|
|
175
|
+
|
|
176
|
+
@readonly
|
|
177
|
+
@title : 'Address UTxOs'
|
|
178
|
+
@description: 'Projection for Address UTxOs'
|
|
179
|
+
entity AddressUTxOs as projection on db.AddressUTxOs;
|
|
180
|
+
|
|
181
|
+
@readonly
|
|
182
|
+
@title : 'Address Transactions'
|
|
183
|
+
@description: 'Projection for Address Transactions'
|
|
184
|
+
entity AddressTransactions as projection on db.AddressTransactions;
|
|
185
|
+
|
|
186
|
+
@readonly
|
|
187
|
+
@title : 'UTxO Assets'
|
|
188
|
+
@description: 'Projection for UTxO Assets'
|
|
189
|
+
entity UTxOAssets as projection on db.UTxOAssets;
|
|
190
|
+
|
|
191
|
+
@readonly
|
|
192
|
+
@title : 'Transaction Metadata'
|
|
193
|
+
@description: 'Projection for Transaction Metadata'
|
|
194
|
+
entity TransactionMetadata as projection on db.TransactionMetadata;
|
|
195
|
+
|
|
196
|
+
@readonly
|
|
197
|
+
@title : 'Ledger Protocol Parameters'
|
|
198
|
+
@description: 'Projection for Ledger Protocol Parameters'
|
|
199
|
+
entity LedgerProtocolParameters as projection on db.LedgerProtocolParameters;
|
|
200
|
+
|
|
201
|
+
// ---------------------------------------------------------------------------
|
|
202
|
+
// Actions
|
|
203
|
+
// ---------------------------------------------------------------------------
|
|
204
|
+
@title : 'Get Network Information'
|
|
205
|
+
@description: 'Retrieve current network information including network type and genesis hash'
|
|
206
|
+
action GetNetworkInformation() returns NetworkInformation;
|
|
207
|
+
|
|
208
|
+
@title : 'Get Blocks by Block Hash'
|
|
209
|
+
@description: 'Retrieve block information using the Block Hash'
|
|
210
|
+
action GetBlockByHash(
|
|
211
|
+
@title: 'Block Hash'
|
|
212
|
+
@description: 'The unique identifier of the block'
|
|
213
|
+
hash: Blake2b256) returns Blocks;
|
|
214
|
+
|
|
215
|
+
@title : 'Get Epochs by Epoch Number'
|
|
216
|
+
@description: 'Retrieve epoch information using the Epoch Number'
|
|
217
|
+
action GetEpochByNumber(
|
|
218
|
+
@title: 'Epoch Number'
|
|
219
|
+
@description: 'The sequential number of the epoch'
|
|
220
|
+
epochNumber: Integer) returns Epochs;
|
|
221
|
+
|
|
222
|
+
@title : 'Get Pools by Pool Id'
|
|
223
|
+
@description: 'Retrieve pool information using the Pool Id'
|
|
224
|
+
action GetPoolById(
|
|
225
|
+
@title: 'Pool Id'
|
|
226
|
+
@description: 'The unique identifier of the stake pool'
|
|
227
|
+
poolId: String) returns Pools;
|
|
228
|
+
|
|
229
|
+
@title : 'Get Dreps by Drep Id'
|
|
230
|
+
@description: 'Retrieve drep information using the Drep Id'
|
|
231
|
+
action GetDrepById(
|
|
232
|
+
@title: 'Drep Id'
|
|
233
|
+
@description: 'The unique identifier of the drep'
|
|
234
|
+
drepId: String) returns Dreps;
|
|
235
|
+
|
|
236
|
+
@title : 'Get Asset Info'
|
|
237
|
+
@description: 'Retrieve native-asset information (supply, mint history, CIP-25 + CIP-26 metadata) by unit. Multi-backend (Blockfrost, Koios). Field availability differs slightly per backend — see entity description.'
|
|
238
|
+
action GetAssetInfo(
|
|
239
|
+
@title: 'Asset Unit'
|
|
240
|
+
@description: 'Concatenation of policyId (56 hex) and assetNameHex (0-64 hex; ledger caps asset names at 32 bytes)'
|
|
241
|
+
unit: AssetUnit) returns Assets;
|
|
242
|
+
|
|
243
|
+
@title : 'Get Asset Mint/Burn History'
|
|
244
|
+
@description: 'Retrieve recent mint/burn events for a native asset (most recent first). Koios is preferred (provides block timestamps); Blockfrost is the fallback (timestamps null). Always-fresh fetch — UPSERTs entries by (unit, txHash). For full pagination, query the AssetHistory entity directly with $top/$skip after seeding.'
|
|
245
|
+
action GetAssetHistory(
|
|
246
|
+
@title: 'Asset Unit'
|
|
247
|
+
@description: 'Concatenation of policyId (56 hex) and assetNameHex (0-64 hex; ledger caps asset names at 32 bytes)'
|
|
248
|
+
unit: AssetUnit,
|
|
249
|
+
@title: 'Limit'
|
|
250
|
+
@description: 'Maximum number of recent events to fetch (default 100, clamped to 1-100)'
|
|
251
|
+
limit: Integer) returns many AssetHistory;
|
|
252
|
+
|
|
253
|
+
@title : 'Get Accounts by Stake Address'
|
|
254
|
+
@description: 'Retrieve account information using the Bech32 Stake Address'
|
|
255
|
+
action GetAccountByStakeAddress(
|
|
256
|
+
@title: 'Stake Address'
|
|
257
|
+
@description: 'The Bech32 encoded stake address'
|
|
258
|
+
stakeAddress: Bech32) returns Accounts;
|
|
259
|
+
|
|
260
|
+
@title : 'Get Transactions by Tx Hash'
|
|
261
|
+
@description: 'Retrieve transaction information using the Transaction Hash'
|
|
262
|
+
action GetTransactionByHash(
|
|
263
|
+
@title: 'Transaction Hash'
|
|
264
|
+
@description: 'The unique identifier of the transaction'
|
|
265
|
+
hash: Blake2b256) returns Transactions;
|
|
266
|
+
|
|
267
|
+
@title : 'Get Transaction Confirmations'
|
|
268
|
+
@description: 'Number of blocks on top of a transaction, its own block included; 0 while it is not on chain. Uses the crawled chain when the crawler is synced, else the backends.'
|
|
269
|
+
action GetTransactionConfirmations(
|
|
270
|
+
@title: 'Transaction Hash'
|
|
271
|
+
@description: 'The unique identifier of the transaction'
|
|
272
|
+
txHash: Blake2b256) returns TransactionConfirmations;
|
|
273
|
+
|
|
274
|
+
@title : 'Get Transaction Metadata by Tx Hash'
|
|
275
|
+
@description: 'Retrieve transaction metadata using the Transaction Hash'
|
|
276
|
+
action GetMetadataByTxHash(
|
|
277
|
+
@title: 'Transaction Hash'
|
|
278
|
+
@description: 'The unique identifier of the transaction'
|
|
279
|
+
txHash: Blake2b256) returns many TransactionMetadata;
|
|
280
|
+
|
|
281
|
+
@title : 'Get Addresses by Bech32 Address'
|
|
282
|
+
@description: 'Retrieve address information using the Bech32 Address'
|
|
283
|
+
action GetAddressByBech32(
|
|
284
|
+
@title: 'Bech32 Address'
|
|
285
|
+
@description: 'The Bech32 encoded address'
|
|
286
|
+
address: Bech32) returns Addresses;
|
|
287
|
+
|
|
288
|
+
@title : 'Get UTxOs by Bech32 Address'
|
|
289
|
+
@description: 'Retrieve UTxO information using the Bech32 Address'
|
|
290
|
+
action GetUTxOsByAddress(
|
|
291
|
+
@title: 'Bech32 Address'
|
|
292
|
+
@description: 'The Bech32 encoded address'
|
|
293
|
+
address: Bech32) returns many AddressUTxOs;
|
|
294
|
+
|
|
295
|
+
@title : 'Get UTxOs by Payment Credential'
|
|
296
|
+
@description: 'Retrieve UTxOs across all bech32 addresses sharing the given 28-byte payment credential (key hash or script hash). Useful for protocols that write to multiple bech32 forms of the same script (e.g. Indigo CDPs, Liqwid positions). Served from the crawled UTxO set (crawler.utxoSet active and synced) with outputs read from the node at the tip, else from Koios; throws ProviderUnavailableError when neither is available. Always fresh, no cache check.'
|
|
297
|
+
action GetUTxOsByCredential(
|
|
298
|
+
@title: 'Payment Credential'
|
|
299
|
+
@description: '28-byte payment credential hash as 56-char lowercase hex string'
|
|
300
|
+
credential: String) returns many AddressUTxOs;
|
|
301
|
+
|
|
302
|
+
@title : 'Get Assets by Bech32 Address'
|
|
303
|
+
@description: 'Retrieve asset information using the Bech32 Address'
|
|
304
|
+
action GetAssetsByAddress(
|
|
305
|
+
@title: 'Bech32 Address'
|
|
306
|
+
@description: 'The Bech32 encoded address'
|
|
307
|
+
address: Bech32) returns many AddressAssets;
|
|
308
|
+
|
|
309
|
+
@title : 'Get latest Transactions by Bech32 Address'
|
|
310
|
+
@description: 'Retrieve the latest transactions from the Bech32 Address'
|
|
311
|
+
action GetLatestTransactionsByAddress(
|
|
312
|
+
@title: 'Bech32 Address'
|
|
313
|
+
@description: 'The Bech32 encoded address'
|
|
314
|
+
address: Bech32,
|
|
315
|
+
@title: 'Limit'
|
|
316
|
+
@description: 'The maximum number of transactions to retrieve'
|
|
317
|
+
limit: Integer) returns many AddressTransactions;
|
|
318
|
+
|
|
319
|
+
@title : 'Get Latest Block'
|
|
320
|
+
@description: 'Retrieve the latest block information'
|
|
321
|
+
action GetLatestBlock() returns Blocks;
|
|
322
|
+
|
|
323
|
+
@title : 'Get Latest Epoch'
|
|
324
|
+
@description: 'Retrieve the latest epoch information'
|
|
325
|
+
action GetLatestEpoch() returns Epochs;
|
|
326
|
+
|
|
327
|
+
@title : 'Get Ledger Protocol Parameters'
|
|
328
|
+
@description: 'Retrieve the current ledger protocol parameters'
|
|
329
|
+
action GetLedgerProtocolParameters() returns LedgerProtocolParameters;
|
|
330
|
+
|
|
331
|
+
@title : 'Parse Transaction CBOR'
|
|
332
|
+
@description: 'Parse hex-encoded transaction CBOR (signed or unsigned) into structured fields. Pure function, no network call, no DB write.'
|
|
333
|
+
action ParseTransactionCbor(
|
|
334
|
+
@title: 'Transaction CBOR'
|
|
335
|
+
@description: 'Hex-encoded transaction CBOR; signed or unsigned. Capped at 128 KiB of hex.'
|
|
336
|
+
cbor: LargeString) returns ParsedTransaction;
|
|
337
|
+
|
|
338
|
+
@title : 'Decode Plutus Data'
|
|
339
|
+
@description: 'Decode PlutusData CBOR hex (an inline datum, a witness datum, a redeemer) into the JSON the build actions accept as outputDatumJson (DetailedSchema: constructor/fields, int, bytes, list, map). Integers beyond 2^53 are decimal strings. Pure function, no network call, no DB write.'
|
|
340
|
+
action DecodePlutusData(
|
|
341
|
+
@title: 'PlutusData CBOR'
|
|
342
|
+
@description: 'Hex-encoded PlutusData CBOR. Capped at 128 KiB of hex.'
|
|
343
|
+
cbor: LargeString) returns LargeString;
|
|
344
|
+
}
|