@odatano/core 2.0.0-rc.5 → 2.0.0-rc.50
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/CardanoAgentService/index.d.ts +99 -51
- package/@cds-models/CardanoAgentService/index.js +15 -0
- package/@cds-models/CardanoBackendService/index.d.ts +347 -0
- package/@cds-models/CardanoBackendService/index.js +40 -0
- package/@cds-models/CardanoIndexerService/index.d.ts +496 -11
- package/@cds-models/CardanoIndexerService/index.js +64 -0
- package/@cds-models/CardanoODataService/index.d.ts +414 -57
- package/@cds-models/CardanoODataService/index.js +42 -0
- package/@cds-models/CardanoSignService/index.d.ts +32 -19
- package/@cds-models/CardanoSignService/index.js +3 -0
- package/@cds-models/CardanoTransactionService/index.d.ts +58 -44
- package/@cds-models/CardanoTransactionService/index.js +4 -0
- package/@cds-models/CardanoWorkerService/index.d.ts +7 -22
- package/@cds-models/index.d.ts +101 -1
- package/@cds-models/index.js +16 -1
- package/@cds-models/odatano/cardano/index.d.ts +437 -32
- package/@cds-models/odatano/cardano/index.js +48 -0
- package/README.md +207 -167
- package/db/schema.cds +2402 -1705
- package/db/types.cds +446 -295
- package/package.json +41 -16
- package/scripts/migrate-schema.mjs +334 -0
- package/scripts/migrate-slot-leader.mjs +96 -0
- package/src/index.d.ts +20 -21
- package/src/index.js +45 -31
- package/src/plugin.js +17 -35
- package/srv/blockchain/asset-decimals.d.ts +7 -0
- package/srv/blockchain/asset-decimals.js +91 -0
- package/srv/blockchain/backends/blockfrost-backend.d.ts +25 -135
- package/srv/blockchain/backends/blockfrost-backend.js +66 -172
- package/srv/blockchain/backends/cardano-backend.d.ts +94 -186
- package/srv/blockchain/backends/cardano-backend.js +29 -5
- package/srv/blockchain/backends/koios-backend.d.ts +103 -168
- package/srv/blockchain/backends/koios-backend.js +428 -360
- package/srv/blockchain/backends/odatano-backend.d.ts +54 -0
- package/srv/blockchain/backends/odatano-backend.js +169 -0
- package/srv/blockchain/backends/ogmios-backend.d.ts +123 -190
- package/srv/blockchain/backends/ogmios-backend.js +637 -315
- package/srv/blockchain/backends/ogmios-frame-guard.d.ts +14 -0
- package/srv/blockchain/backends/ogmios-frame-guard.js +89 -0
- package/srv/blockchain/cardano-client.d.ts +61 -241
- package/srv/blockchain/cardano-client.js +253 -293
- package/srv/blockchain/cardano-indexer.d.ts +282 -281
- package/srv/blockchain/cardano-indexer.js +1551 -484
- package/srv/blockchain/cardano-tx-builder.d.ts +25 -89
- package/srv/blockchain/cardano-tx-builder.js +164 -140
- package/srv/blockchain/circuit-breaker.d.ts +1 -13
- package/srv/blockchain/circuit-breaker.js +5 -15
- package/srv/blockchain/crawler/account-snapshots.d.ts +29 -0
- package/srv/blockchain/crawler/account-snapshots.js +153 -0
- package/srv/blockchain/crawler/asset-decimals-backfill.d.ts +15 -0
- package/srv/blockchain/crawler/asset-decimals-backfill.js +56 -0
- package/srv/blockchain/crawler/asset-registry-backfill.d.ts +43 -0
- package/srv/blockchain/crawler/asset-registry-backfill.js +153 -0
- package/srv/blockchain/crawler/certificate-backfill.d.ts +52 -0
- package/srv/blockchain/crawler/certificate-backfill.js +162 -0
- package/srv/blockchain/crawler/crawler.d.ts +104 -81
- package/srv/blockchain/crawler/crawler.js +532 -160
- package/srv/blockchain/crawler/credential-backfill.d.ts +28 -0
- package/srv/blockchain/crawler/credential-backfill.js +124 -0
- package/srv/blockchain/crawler/hooks.d.ts +2 -17
- package/srv/blockchain/crawler/index.d.ts +1 -8
- package/srv/blockchain/crawler/index.js +31 -17
- package/srv/blockchain/crawler/input-asset-copies.d.ts +34 -0
- package/srv/blockchain/crawler/input-asset-copies.js +171 -0
- package/srv/blockchain/crawler/metadata-position-backfill.d.ts +16 -0
- package/srv/blockchain/crawler/metadata-position-backfill.js +55 -0
- package/srv/blockchain/crawler/output-datum-backfill.d.ts +39 -0
- package/srv/blockchain/crawler/output-datum-backfill.js +110 -0
- package/srv/blockchain/crawler/sync-state.d.ts +27 -47
- package/srv/blockchain/crawler/sync-state.js +113 -63
- package/srv/blockchain/crawler/transaction-backfill.d.ts +44 -0
- package/srv/blockchain/crawler/transaction-backfill.js +278 -0
- package/srv/blockchain/crawler/utxo-set-import.d.ts +66 -0
- package/srv/blockchain/crawler/utxo-set-import.js +399 -0
- package/srv/blockchain/ledger-state.d.ts +62 -0
- package/srv/blockchain/ledger-state.js +419 -0
- package/srv/blockchain/pending-spends.d.ts +16 -0
- package/srv/blockchain/pending-spends.js +81 -0
- package/srv/blockchain/pool-metadata.d.ts +15 -0
- package/srv/blockchain/pool-metadata.js +132 -0
- package/srv/blockchain/request-coalescer.d.ts +2 -16
- package/srv/blockchain/request-coalescer.js +2 -16
- package/srv/blockchain/signing/cose-verifier.d.ts +3 -17
- package/srv/blockchain/signing/cose-verifier.js +146 -70
- package/srv/blockchain/signing/external-signer.d.ts +15 -115
- package/srv/blockchain/signing/external-signer.js +17 -126
- package/srv/blockchain/signing/hsm-signer.d.ts +10 -54
- package/srv/blockchain/signing/hsm-signer.js +28 -79
- package/srv/blockchain/signing/signature-verifier.d.ts +9 -47
- package/srv/blockchain/signing/signature-verifier.js +70 -83
- package/srv/blockchain/signing/submission-finalizer.d.ts +23 -45
- package/srv/blockchain/signing/submission-finalizer.js +219 -86
- package/srv/blockchain/stored-chain.d.ts +20 -0
- package/srv/blockchain/stored-chain.js +237 -0
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts +31 -229
- package/srv/blockchain/transaction-building/buildooor-tx.js +652 -416
- package/srv/blockchain/transaction-building/cardano-tx.d.ts +9 -37
- package/srv/blockchain/transaction-presence.d.ts +5 -0
- package/srv/blockchain/transaction-presence.js +29 -0
- package/srv/blockchain/transaction-rows.d.ts +12 -0
- package/srv/blockchain/transaction-rows.js +44 -0
- package/srv/blockchain/wallet-worker/build-request.d.ts +5 -20
- package/srv/blockchain/wallet-worker/build-request.js +47 -30
- package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +5 -46
- package/srv/blockchain/wallet-worker/confirmation-tracker.js +25 -45
- package/srv/blockchain/wallet-worker/index.d.ts +1 -1
- package/srv/blockchain/wallet-worker/index.js +3 -11
- package/srv/blockchain/wallet-worker/job-store.d.ts +30 -148
- package/srv/blockchain/wallet-worker/job-store.js +101 -201
- package/srv/blockchain/wallet-worker/lease-heartbeat.d.ts +2 -26
- package/srv/blockchain/wallet-worker/lease-heartbeat.js +6 -28
- package/srv/blockchain/wallet-worker/signers.d.ts +5 -24
- package/srv/blockchain/wallet-worker/signers.js +4 -12
- package/srv/blockchain/wallet-worker/wallet-worker.d.ts +8 -80
- package/srv/blockchain/wallet-worker/wallet-worker.js +107 -155
- package/srv/cardano-agent-service.cds +122 -84
- package/srv/cardano-agent-service.js +4 -9
- package/srv/cardano-backend-service.cds +78 -0
- package/srv/cardano-backend-service.d.ts +2 -0
- package/srv/cardano-backend-service.js +242 -0
- package/srv/cardano-indexer-service.cds +387 -73
- package/srv/cardano-indexer-service.d.ts +5 -1
- package/srv/cardano-indexer-service.js +532 -16
- package/srv/cardano-service.cds +424 -269
- package/srv/cardano-service.js +289 -201
- package/srv/cardano-sign-service.cds +201 -180
- package/srv/cardano-sign-service.js +71 -201
- package/srv/cardano-tx-service.cds +451 -370
- package/srv/cardano-tx-service.js +271 -289
- package/srv/cardano-ui.cds +16 -16
- package/srv/cardano-worker-service.cds +118 -125
- package/srv/cardano-worker-service.js +52 -61
- package/srv/cbor/cip68.d.ts +13 -0
- package/srv/cbor/cip68.js +56 -0
- package/srv/cbor/index.d.ts +3 -1
- package/srv/cbor/index.js +9 -1
- package/srv/cbor/parse.d.ts +30 -18
- package/srv/cbor/parse.js +44 -9
- package/srv/cbor/plutus-data-json.d.ts +20 -0
- package/srv/cbor/plutus-data-json.js +32 -0
- package/srv/config.d.ts +113 -0
- package/srv/config.js +409 -0
- package/srv/server.d.ts +15 -110
- package/srv/server.js +84 -404
- package/srv/utils/agent-access.d.ts +9 -0
- package/srv/utils/agent-access.js +67 -0
- package/srv/utils/agent-grants-config.d.ts +0 -46
- package/srv/utils/agent-grants-config.js +17 -85
- package/srv/utils/agent-grants.d.ts +106 -122
- package/srv/utils/agent-grants.js +538 -236
- package/srv/utils/agent-token-auth.d.ts +4 -99
- package/srv/utils/agent-token-auth.js +18 -182
- package/srv/utils/backend-request-handler.d.ts +3 -17
- package/srv/utils/backend-request-handler.js +3 -18
- package/srv/utils/collections.d.ts +3 -10
- package/srv/utils/collections.js +3 -10
- package/srv/utils/const.d.ts +23 -74
- package/srv/utils/const.js +32 -79
- package/srv/utils/crypto.d.ts +3 -12
- package/srv/utils/crypto.js +6 -21
- package/srv/utils/db-indexes.d.ts +27 -0
- package/srv/utils/db-indexes.js +120 -0
- package/srv/utils/db-sanitize.d.ts +20 -0
- package/srv/utils/db-sanitize.js +80 -0
- package/srv/utils/deep-json.d.ts +6 -0
- package/srv/utils/deep-json.js +240 -0
- package/srv/utils/epoch-slots.d.ts +13 -0
- package/srv/utils/epoch-slots.js +38 -0
- package/srv/utils/error-codes.d.ts +22 -75
- package/srv/utils/error-codes.js +23 -72
- package/srv/utils/errors.d.ts +46 -187
- package/srv/utils/errors.js +114 -230
- package/srv/utils/liveness.d.ts +12 -0
- package/srv/utils/liveness.js +35 -0
- package/srv/utils/mappers.d.ts +102 -223
- package/srv/utils/mappers.js +387 -316
- package/srv/utils/network-context.js +2 -13
- package/srv/utils/paging.d.ts +31 -0
- package/srv/utils/paging.js +43 -0
- package/srv/utils/pg-inline-json.d.ts +8 -0
- package/srv/utils/pg-inline-json.js +58 -0
- package/srv/utils/pg-order-nulls.d.ts +14 -0
- package/srv/utils/pg-order-nulls.js +54 -0
- package/srv/utils/plutus-placeholders.d.ts +16 -22
- package/srv/utils/plutus-placeholders.js +62 -33
- package/srv/utils/rate-limiter.d.ts +2 -21
- package/srv/utils/rate-limiter.js +5 -17
- package/srv/utils/readiness.d.ts +12 -0
- package/srv/utils/readiness.js +29 -0
- package/srv/utils/reference-script.d.ts +19 -0
- package/srv/utils/reference-script.js +84 -0
- package/srv/utils/result-numbers.d.ts +15 -0
- package/srv/utils/result-numbers.js +61 -0
- package/srv/utils/service-events.d.ts +0 -24
- package/srv/utils/service-events.js +3 -25
- package/srv/utils/signing-helper.d.ts +3 -20
- package/srv/utils/signing-helper.js +35 -64
- package/srv/utils/tx-build-helper.d.ts +10 -105
- package/srv/utils/tx-build-helper.js +81 -144
- package/srv/utils/tx-request-parsers.d.ts +82 -33
- package/srv/utils/tx-request-parsers.js +401 -49
- package/srv/utils/tx-utils.d.ts +3 -27
- package/srv/utils/tx-utils.js +32 -50
- package/srv/utils/types.d.ts +261 -191
- package/srv/utils/types.js +2 -6
- package/srv/utils/validators.d.ts +22 -92
- package/srv/utils/validators.js +50 -149
|
@@ -12,6 +12,18 @@ module.exports.Epochs = createEntityProxy(['odatano.cardano', 'Epochs'], { targe
|
|
|
12
12
|
// Pools
|
|
13
13
|
module.exports.Pool = createEntityProxy(['odatano.cardano', 'Pools'], { target: { is_singular: true } })
|
|
14
14
|
module.exports.Pools = createEntityProxy(['odatano.cardano', 'Pools'], { target: { is_singular: false }})
|
|
15
|
+
// PoolEpochSnapshots
|
|
16
|
+
module.exports.PoolEpochSnapshot = createEntityProxy(['odatano.cardano', 'PoolEpochSnapshots'], { target: { is_singular: true } })
|
|
17
|
+
module.exports.PoolEpochSnapshots = createEntityProxy(['odatano.cardano', 'PoolEpochSnapshots'], { target: { is_singular: false }})
|
|
18
|
+
// DrepEpochSnapshots
|
|
19
|
+
module.exports.DrepEpochSnapshot = createEntityProxy(['odatano.cardano', 'DrepEpochSnapshots'], { target: { is_singular: true } })
|
|
20
|
+
module.exports.DrepEpochSnapshots = createEntityProxy(['odatano.cardano', 'DrepEpochSnapshots'], { target: { is_singular: false }})
|
|
21
|
+
// EpochLedgerSnapshots
|
|
22
|
+
module.exports.EpochLedgerSnapshot = createEntityProxy(['odatano.cardano', 'EpochLedgerSnapshots'], { target: { is_singular: true } })
|
|
23
|
+
module.exports.EpochLedgerSnapshots = createEntityProxy(['odatano.cardano', 'EpochLedgerSnapshots'], { target: { is_singular: false }})
|
|
24
|
+
// AccountEpochSnapshots
|
|
25
|
+
module.exports.AccountEpochSnapshot = createEntityProxy(['odatano.cardano', 'AccountEpochSnapshots'], { target: { is_singular: true } })
|
|
26
|
+
module.exports.AccountEpochSnapshots = createEntityProxy(['odatano.cardano', 'AccountEpochSnapshots'], { target: { is_singular: false }})
|
|
15
27
|
// Assets
|
|
16
28
|
module.exports.Asset = createEntityProxy(['odatano.cardano', 'Assets'], { target: { is_singular: true } })
|
|
17
29
|
module.exports.Assets = createEntityProxy(['odatano.cardano', 'Assets'], { target: { is_singular: false }})
|
|
@@ -42,9 +54,39 @@ module.exports.Transactions = createEntityProxy(['odatano.cardano', 'Transaction
|
|
|
42
54
|
// TransactionInputs
|
|
43
55
|
module.exports.TransactionInput = createEntityProxy(['odatano.cardano', 'TransactionInputs'], { target: { is_singular: true } })
|
|
44
56
|
module.exports.TransactionInputs = createEntityProxy(['odatano.cardano', 'TransactionInputs'], { target: { is_singular: false }})
|
|
57
|
+
// TransactionInputAssetCopies
|
|
58
|
+
module.exports.TransactionInputAssetCopy = createEntityProxy(['odatano.cardano', 'TransactionInputAssetCopies'], { target: { is_singular: true } })
|
|
59
|
+
module.exports.TransactionInputAssetCopies = createEntityProxy(['odatano.cardano', 'TransactionInputAssetCopies'], { target: { is_singular: false }})
|
|
45
60
|
// TransactionInputAssets
|
|
46
61
|
module.exports.TransactionInputAsset = createEntityProxy(['odatano.cardano', 'TransactionInputAssets'], { target: { is_singular: true } })
|
|
47
62
|
module.exports.TransactionInputAssets = createEntityProxy(['odatano.cardano', 'TransactionInputAssets'], { target: { is_singular: false }})
|
|
63
|
+
// LedgerUTxOs
|
|
64
|
+
module.exports.LedgerUTxO = createEntityProxy(['odatano.cardano', 'LedgerUTxOs'], { target: { is_singular: true } })
|
|
65
|
+
module.exports.LedgerUTxOs = createEntityProxy(['odatano.cardano', 'LedgerUTxOs'], { target: { is_singular: false }})
|
|
66
|
+
// LedgerUTxOAssets
|
|
67
|
+
module.exports.LedgerUTxOAsset = createEntityProxy(['odatano.cardano', 'LedgerUTxOAssets'], { target: { is_singular: true } })
|
|
68
|
+
module.exports.LedgerUTxOAssets = createEntityProxy(['odatano.cardano', 'LedgerUTxOAssets'], { target: { is_singular: false }})
|
|
69
|
+
// LedgerAddresses
|
|
70
|
+
module.exports.LedgerAddress = createEntityProxy(['odatano.cardano', 'LedgerAddresses'], { target: { is_singular: true } })
|
|
71
|
+
module.exports.LedgerAddresses = createEntityProxy(['odatano.cardano', 'LedgerAddresses'], { target: { is_singular: false }})
|
|
72
|
+
// LedgerAddressAssets
|
|
73
|
+
module.exports.LedgerAddressAsset = createEntityProxy(['odatano.cardano', 'LedgerAddressAssets'], { target: { is_singular: true } })
|
|
74
|
+
module.exports.LedgerAddressAssets = createEntityProxy(['odatano.cardano', 'LedgerAddressAssets'], { target: { is_singular: false }})
|
|
75
|
+
// LedgerAccounts
|
|
76
|
+
module.exports.LedgerAccount = createEntityProxy(['odatano.cardano', 'LedgerAccounts'], { target: { is_singular: true } })
|
|
77
|
+
module.exports.LedgerAccounts = createEntityProxy(['odatano.cardano', 'LedgerAccounts'], { target: { is_singular: false }})
|
|
78
|
+
// TransactionCertificates
|
|
79
|
+
module.exports.TransactionCertificate = createEntityProxy(['odatano.cardano', 'TransactionCertificates'], { target: { is_singular: true } })
|
|
80
|
+
module.exports.TransactionCertificates = createEntityProxy(['odatano.cardano', 'TransactionCertificates'], { target: { is_singular: false }})
|
|
81
|
+
// TransactionWithdrawals
|
|
82
|
+
module.exports.TransactionWithdrawal = createEntityProxy(['odatano.cardano', 'TransactionWithdrawals'], { target: { is_singular: true } })
|
|
83
|
+
module.exports.TransactionWithdrawals = createEntityProxy(['odatano.cardano', 'TransactionWithdrawals'], { target: { is_singular: false }})
|
|
84
|
+
// TransactionRedeemers
|
|
85
|
+
module.exports.TransactionRedeemer = createEntityProxy(['odatano.cardano', 'TransactionRedeemers'], { target: { is_singular: true } })
|
|
86
|
+
module.exports.TransactionRedeemers = createEntityProxy(['odatano.cardano', 'TransactionRedeemers'], { target: { is_singular: false }})
|
|
87
|
+
// TransactionDatums
|
|
88
|
+
module.exports.TransactionDatum = createEntityProxy(['odatano.cardano', 'TransactionDatums'], { target: { is_singular: true } })
|
|
89
|
+
module.exports.TransactionDatums = createEntityProxy(['odatano.cardano', 'TransactionDatums'], { target: { is_singular: false }})
|
|
48
90
|
// TransactionOutputs
|
|
49
91
|
module.exports.TransactionOutput = createEntityProxy(['odatano.cardano', 'TransactionOutputs'], { target: { is_singular: true } })
|
|
50
92
|
module.exports.TransactionOutputs = createEntityProxy(['odatano.cardano', 'TransactionOutputs'], { target: { is_singular: false }})
|
|
@@ -69,6 +111,9 @@ module.exports.TransactionBuildInputAssets = createEntityProxy(['odatano.cardano
|
|
|
69
111
|
// TransactionBuildOutputs
|
|
70
112
|
module.exports.TransactionBuildOutput = createEntityProxy(['odatano.cardano', 'TransactionBuildOutputs'], { target: { is_singular: true } })
|
|
71
113
|
module.exports.TransactionBuildOutputs = createEntityProxy(['odatano.cardano', 'TransactionBuildOutputs'], { target: { is_singular: false }})
|
|
114
|
+
// TransactionBuildRedeemers
|
|
115
|
+
module.exports.TransactionBuildRedeemer = createEntityProxy(['odatano.cardano', 'TransactionBuildRedeemers'], { target: { is_singular: true } })
|
|
116
|
+
module.exports.TransactionBuildRedeemers = createEntityProxy(['odatano.cardano', 'TransactionBuildRedeemers'], { target: { is_singular: false }})
|
|
72
117
|
// TransactionBuildOutputAssets
|
|
73
118
|
module.exports.TransactionBuildOutputAsset = createEntityProxy(['odatano.cardano', 'TransactionBuildOutputAssets'], { target: { is_singular: true } })
|
|
74
119
|
module.exports.TransactionBuildOutputAssets = createEntityProxy(['odatano.cardano', 'TransactionBuildOutputAssets'], { target: { is_singular: false }})
|
|
@@ -108,6 +153,9 @@ module.exports.CardanoWalletJobs = createEntityProxy(['odatano.cardano', 'Cardan
|
|
|
108
153
|
// CardanoAgentGrants
|
|
109
154
|
module.exports.CardanoAgentGrant = createEntityProxy(['odatano.cardano', 'CardanoAgentGrants'], { target: { is_singular: true } })
|
|
110
155
|
module.exports.CardanoAgentGrants = createEntityProxy(['odatano.cardano', 'CardanoAgentGrants'], { target: { is_singular: false }})
|
|
156
|
+
// CardanoAgentGrantUsage
|
|
157
|
+
module.exports.CardanoAgentGrantUsage = createEntityProxy(['odatano.cardano', 'CardanoAgentGrantUsage'], { target: { is_singular: true } })
|
|
158
|
+
module.exports.CardanoAgentGrantUsage_ = createEntityProxy(['odatano.cardano', 'CardanoAgentGrantUsage'], { target: { is_singular: false }})
|
|
111
159
|
// events
|
|
112
160
|
// actions
|
|
113
161
|
// enums
|
package/README.md
CHANGED
|
@@ -1,167 +1,207 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
[
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
>
|
|
90
|
-
>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
-
|
|
167
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/npm/@odatano/brand@1/logos/odatano-core-logo-on-dark.svg">
|
|
4
|
+
<img src="https://cdn.jsdelivr.net/npm/@odatano/brand@1/logos/odatano-core-logo.svg" alt="ODATANO CORE" height="84">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
# Enterprise OData Services for the Cardano Blockchain
|
|
9
|
+
|
|
10
|
+
Funded by [Cardano Catalyst Fund 14](https://projectcatalyst.io/funds/14/sponsored-by-leftovers/sap-cardano-odata-v4-api-with-cap-and-sap-cardano-sdk) all four milestones completed and approved (April 2026).
|
|
11
|
+
|
|
12
|
+
**ODATANO** is an SAP CAP–based service that exposes the Cardano blockchain via a standardized **OData V4** interface, enabling enterprise-grade read and write access with native transaction building.
|
|
13
|
+
|
|
14
|
+
[](https://github.com/ODATANO/ODATANO/actions/workflows/test.yaml)
|
|
15
|
+
[](https://codecov.io/gh/ODATANO/ODATANO)
|
|
16
|
+
[](https://www.npmjs.com/package/@odatano/core)
|
|
17
|
+
[](https://www.npmjs.com/package/@odatano/core)
|
|
18
|
+
[](LICENSE)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
### As CAP Plugin (recommended)
|
|
24
|
+
|
|
25
|
+
Add ODATANO to any existing SAP CAP project:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @odatano/core @cap-js/sqlite
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"cds": {
|
|
34
|
+
"requires": {
|
|
35
|
+
"db": { "kind": "sqlite" },
|
|
36
|
+
"auth": { "users": { "alice": { "roles": ["Read", "Transact", "Sign"] } } },
|
|
37
|
+
"odatano-core": {
|
|
38
|
+
"network": "preview",
|
|
39
|
+
"backends": ["koios"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The services ask for the roles `Read`, `Transact` and `Sign` (`Admin` for operator actions). The `auth`
|
|
47
|
+
entry gives them to CAP's development user `alice`; in production your own authentication assigns them.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
cds deploy --to sqlite
|
|
51
|
+
cds serve
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Koios works without an account on its public tier. A [Koios token](https://koios.rest) is optional and raises the rate limit. Put it in a `.env` file in the project root (loaded automatically by `cds serve` / `cds watch`), not in `package.json`:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# .env (optional)
|
|
58
|
+
KOIOS_API_KEY=your_koios_token
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
> Config in `cds.requires.odatano-core` takes precedence over environment
|
|
62
|
+
> variables; a `koiosApiKey` set there would override the `.env` value.
|
|
63
|
+
|
|
64
|
+
Other backends are optional and can be combined, for example `["ogmios", "koios"]` with a local node, or
|
|
65
|
+
`blockfrost` with a Blockfrost key or a self-hosted Blockfrost-compatible node. See the
|
|
66
|
+
[Backend Configuration Guide](docs/guides/BACKEND_CONFIGURATION.md).
|
|
67
|
+
|
|
68
|
+
### Standalone
|
|
69
|
+
|
|
70
|
+
Run ODATANO as a self-contained service (no host CAP project needed):
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git clone https://github.com/ODATANO/ODATANO && cd ODATANO
|
|
74
|
+
npm ci
|
|
75
|
+
cp .env.example .env # set NETWORK, BACKENDS (default koios), optional KOIOS_API_KEY
|
|
76
|
+
cds deploy --to sqlite
|
|
77
|
+
cds serve
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Or with Docker — this brings up a local **cardano-node + Ogmios + ODATANO** stack
|
|
81
|
+
(Preview), with the service pre-wired to the local Ogmios backend:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
docker compose up -d # full stack
|
|
85
|
+
docker compose up -d cardano-node ogmios # just the chain backend (pre-sync)
|
|
86
|
+
docker compose logs -f ogmios # watch sync (/health: 202 syncing, 200 near tip)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
> First sync from genesis takes hours; the node DB persists in a Docker volume so
|
|
90
|
+
> restarts resume. Until Ogmios catches up, queries fall back to Koios
|
|
91
|
+
> (optional `KOIOS_API_KEY`).
|
|
92
|
+
|
|
93
|
+
Service available at `http://localhost:4004`. See the [Quick Start Guide](docs/QUICK_START.md#local-ogmios--cardano-node-docker) for the local Ogmios stack and full details.
|
|
94
|
+
|
|
95
|
+
## Dev Mode: Mocked Authentication
|
|
96
|
+
|
|
97
|
+
> **Heads-up.** `cds serve` uses CAP's mocked auth: any Basic-Auth header logs in as the named mock user and passwords are not checked. This repository gives `alice` and `bob` the roles `Read`, `Transact` and `Sign`, `carol` only `Read`, and `admin` all four (`.cdsrc.json`); any other name is logged in without a role and gets 403. Anonymous requests get 401, but anyone reaching the port can authenticate.
|
|
98
|
+
>
|
|
99
|
+
> Production needs the `[production]` profile (`NODE_ENV=production`), which switches to `auth: xsuaa`. Don't expose a dev-mode instance. See the [Security Guide](docs/guides/SECURITY_GUIDE.md#authentication-xsuaa).
|
|
100
|
+
>
|
|
101
|
+
> The Docker image runs `NODE_ENV=production` with HTTP basic auth via `@odatano/cap-auth` (`ODATANO_HTTP_PASSWORD` required, user `ODATANO_HTTP_USER` default `odatano`, roles `ODATANO_HTTP_ROLES` default `Read,Transact,Sign,Admin`; 20 failed attempts per 15 min per client address and user, then 429). `ODATANO_AUTH=dummy` disables authentication for local testing only. `getLiveness()` and `VerifyDataSignature` stay anonymous.
|
|
102
|
+
>
|
|
103
|
+
> Database of the image: `ODATANO_DB_URL=postgres://user:pw@host:5432/db` selects PostgreSQL (schema deployed on every boot); otherwise SQLite at `ODATANO_DB_PATH` (default `/data/db.sqlite`). `docker compose run --rm --no-deps odatano migrate --from /data/db.sqlite` copies an existing SQLite file into a freshly deployed PostgreSQL.
|
|
104
|
+
|
|
105
|
+
## Services
|
|
106
|
+
|
|
107
|
+
| Service | Path | Purpose |
|
|
108
|
+
|---|---|---|
|
|
109
|
+
| CardanoODataService | `/odata/v4/cardano/` | Read blockchain data (33 entities, 22 actions) |
|
|
110
|
+
| CardanoTransactionService | `/odata/v4/cardano-transaction/` | Build & submit transactions (14 actions) |
|
|
111
|
+
| CardanoSignService | `/odata/v4/cardano-sign/` | External signing + HSM (9 actions) |
|
|
112
|
+
| CardanoIndexerService | `/odata/v4/cardano-indexer/` | Chain crawler / pre-sync control (off by default) |
|
|
113
|
+
| CardanoWorkerService | `/odata/v4/cardano-worker/` | Asynchronous wallet jobs (off by default) |
|
|
114
|
+
| CardanoBackendService | `/odata/v4/cardano-backend/` | Chain data in provider shape for another ODATANO that uses this one as its `odatano` backend |
|
|
115
|
+
| CardanoAgentService | `/odata/v4/cardano-agent/` | Agent grants: scoped bearer tokens for agents (off by default) |
|
|
116
|
+
|
|
117
|
+
The indexer and the worker service also publish **CAP events**, so a consumer can subscribe instead of polling —
|
|
118
|
+
in-process, no broker required:
|
|
119
|
+
|
|
120
|
+
```js
|
|
121
|
+
(await cds.connect.to('CardanoWorkerService')).on('jobConfirmed', ({ data }) => …)
|
|
122
|
+
(await cds.connect.to('CardanoIndexerService')).on('blockIndexed', ({ data }) => …)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Agent grants (off by default)
|
|
126
|
+
|
|
127
|
+
Hand an agent a **scoped, budgeted token** instead of a user.
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
AGENT_GRANTS_ENABLED=true # or cds.requires.odatano-core.agentGrants.enabled
|
|
131
|
+
AGENT_GRANTS_DELEGATE=mocked # CAP auth kind that keeps authenticating non-token requests (default: configured kind)
|
|
132
|
+
AGENT_GRANT_ADMIN_RATE_LIMIT=10 # grant administration calls per principal per hour (or agentGrants.adminRateLimit)
|
|
133
|
+
AGENT_TOKEN_CACHE_MS=10000 # a resolved token is reused this long before the row is read again; 0 = off (or agentGrants.tokenCacheMs)
|
|
134
|
+
AGENT_GRANT_USAGE_RETENTION_DAYS=400 # usage counters older than this are deleted once a day; 0 = keep all (or agentGrants.usageRetentionDays)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
1. An **Admin** issues a grant (`POST /odata/v4/cardano-agent/CreateAgentGrant`): an allow list of
|
|
138
|
+
actions, a daily budget and an expiry. The response carries the token `odat_…` **once**; the
|
|
139
|
+
server stores only its SHA-256.
|
|
140
|
+
2. The agent sends `x-agent-token: odat_…` on the service paths. It runs as the principal
|
|
141
|
+
`agent:<grantId>` with the single role `agent-grant`, never as the operator: every
|
|
142
|
+
`@requires: 'Admin'` surface (pause/resume, HSM signing, grant administration) refuses it by
|
|
143
|
+
construction. Reads and compute-only actions are always allowed; allow-listed actions each cost
|
|
144
|
+
one budget unit per UTC day (a build is the service an agent buys); everything else is 403.
|
|
145
|
+
An agent signs its transactions itself: the wallet worker, which signs with server-held keys,
|
|
146
|
+
answers every token request with 403.
|
|
147
|
+
3. `GET /odata/v4/cardano-agent/GetGrantStatus()` tells the agent what it may do and how much budget
|
|
148
|
+
is left; `RevokeAgentGrant` turns the token into an unknown token immediately.
|
|
149
|
+
4. Lifecycle (Admin; the same semantics as the gateway's peer services, so one client drives
|
|
150
|
+
them all): `UpdateAgentGrant` changes label, allow list, daily budget or expiry
|
|
151
|
+
(absent = untouched, explicit `null` = cleared; 409 `GRANT_REVOKED` on a revoked grant); `RotateAgentGrantToken` returns a fresh token once, the old
|
|
152
|
+
one is unknown from the next request; `GetGrantUsage(grantId, since, until)` lists admitted calls
|
|
153
|
+
per service and action over up to 366 days (an Admin for any grant, a token for its own). All
|
|
154
|
+
administration calls share the per-principal hourly rate limit above.
|
|
155
|
+
|
|
156
|
+
Grantable: `Build*`, `SetCollateral`, `CreateSigningRequest`, `VerifySignature`, `SubmitTransaction`,
|
|
157
|
+
`SubmitSignedTransaction`, `SubmitVerifiedTransaction`, `CheckSubmissionStatus`. Never: `SignWithHsm*`,
|
|
158
|
+
`SubmitWalletJob`, `CancelJob`, `Pause*`/`Resume*`, `pauseCrawler`/`resumeCrawler`, grant administration.
|
|
159
|
+
|
|
160
|
+
Programmatic seams for other packages (`@odatano/x402` sells grants against a 402 payment):
|
|
161
|
+
`issueAgentGrant()`, `updateAgentGrant()`, `rotateAgentGrantToken()`, `revokeAgentGrantById()`,
|
|
162
|
+
`getGrantUsage()`, `registerTransportLane()` from `@odatano/core`.
|
|
163
|
+
|
|
164
|
+
## Liveness and readiness probes
|
|
165
|
+
|
|
166
|
+
`GET /odata/v4/cardano-indexer/getLiveness()` answers `200 { status: "alive", timestamp, uptime,
|
|
167
|
+
version, network }` **without credentials** (`@requires: 'any'`) as long as the process runs — no
|
|
168
|
+
backend or DB probe, no secrets. The Docker `HEALTHCHECK`, compose and upstream probes use it
|
|
169
|
+
instead of the service document, so a wrong operator password no longer reads as "ODATANO down".
|
|
170
|
+
|
|
171
|
+
`GET /odata/v4/cardano-indexer/getReadiness()` answers, also without credentials, whether this
|
|
172
|
+
instance can serve requests: `200 { status: "ready", timestamp, context, database, hsm }`, or `503`
|
|
173
|
+
with the same body and `status: "not_ready"` while the app context, the database or a configured
|
|
174
|
+
HSM is missing (`hsm` is `null` without an HSM). Point a load balancer or an upstream gateway at it.
|
|
175
|
+
|
|
176
|
+
The state of crawler, worker and backends stays authenticated: `getStatus()`, `GetWorkerStatus()`,
|
|
177
|
+
`GetNetworkInformation`.
|
|
178
|
+
|
|
179
|
+
## Requirements
|
|
180
|
+
|
|
181
|
+
- **Node.js >= 22.5** and **@sap/cds 10** (peer dependency `^10`). CAP 9 hosts cannot load `@odatano/core@2`.
|
|
182
|
+
- Upgrading a consumer from 1.x: run **`cds deploy`**. 2.0 adds six tables (`CardanoSyncState`,
|
|
183
|
+
`CardanoReorgLog`, `CardanoWorkerWallets`, `CardanoWalletJobs`, `CardanoAgentGrants`,
|
|
184
|
+
`CardanoAgentGrantUsage`) plus a `dedupKey` column; without the redeploy the new services answer
|
|
185
|
+
`no such table` while the old ones keep working.
|
|
186
|
+
|
|
187
|
+
## Documentation
|
|
188
|
+
|
|
189
|
+
| Guide | Description |
|
|
190
|
+
|-------|-------------|
|
|
191
|
+
| [Quick Start](docs/QUICK_START.md) | Get running in 5 minutes |
|
|
192
|
+
| [User Guide](docs/guides/USER_GUIDE.md) | API usage, entities, and examples |
|
|
193
|
+
| [Developer Guide](docs/guides/DEVELOPER_GUIDE.md) | Architecture and development |
|
|
194
|
+
| [Transaction Workflow](docs/guides/TRANSACTION_WORKFLOW.md) | Build → Sign → Submit flow |
|
|
195
|
+
| [Security Guide](docs/guides/SECURITY_GUIDE.md) | Authentication, signing security, HSM |
|
|
196
|
+
| [Docker Deployment](docs/guides/DOCKER_DEPLOYMENT.md) | Container deployment |
|
|
197
|
+
| [Upgrading to 2.0](docs/guides/UPGRADE_2.0.md) | What a 1.x deployment and its clients change |
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
Apache License 2.0 - see [LICENSE](LICENSE)
|
|
202
|
+
|
|
203
|
+
## Support
|
|
204
|
+
|
|
205
|
+
- **Issues**: [GitHub Issues](https://github.com/ODATANO/ODATANO/issues)
|
|
206
|
+
- **Project Lead**: Max Weber
|
|
207
|
+
- **Contact**: info@odatano.dev
|