@odatano/core 1.11.0 → 2.0.0-rc.10

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 (133) hide show
  1. package/@cds-models/CardanoAgentService/index.d.ts +255 -0
  2. package/@cds-models/CardanoAgentService/index.js +36 -0
  3. package/@cds-models/CardanoIndexerService/index.d.ts +177 -0
  4. package/@cds-models/CardanoIndexerService/index.js +27 -0
  5. package/@cds-models/CardanoODataService/index.d.ts +693 -2172
  6. package/@cds-models/CardanoODataService/index.js +88 -390
  7. package/@cds-models/CardanoSignService/index.d.ts +448 -1576
  8. package/@cds-models/CardanoSignService/index.js +62 -293
  9. package/@cds-models/CardanoTransactionService/index.d.ts +437 -1494
  10. package/@cds-models/CardanoTransactionService/index.js +60 -271
  11. package/@cds-models/CardanoWorkerService/index.d.ts +224 -0
  12. package/@cds-models/CardanoWorkerService/index.js +32 -0
  13. package/@cds-models/_/index.d.ts +70 -40
  14. package/@cds-models/_/index.js +17 -32
  15. package/@cds-models/cds/outbox/index.d.ts +28 -0
  16. package/@cds-models/index.d.ts +225 -522
  17. package/@cds-models/index.js +35 -218
  18. package/@cds-models/odatano/cardano/index.d.ts +919 -2884
  19. package/@cds-models/odatano/cardano/index.js +115 -536
  20. package/@cds-models/sap/common/index.d.ts +196 -600
  21. package/@cds-models/sap/common/index.js +28 -269
  22. package/README.md +194 -102
  23. package/db/schema.cds +388 -1
  24. package/db/types.cds +48 -0
  25. package/package.json +48 -33
  26. package/src/index.d.ts +7 -1
  27. package/src/index.js +30 -2
  28. package/src/plugin.js +33 -20
  29. package/srv/blockchain/backends/blockfrost-backend.d.ts +21 -2
  30. package/srv/blockchain/backends/blockfrost-backend.js +69 -25
  31. package/srv/blockchain/backends/cardano-backend.d.ts +69 -0
  32. package/srv/blockchain/backends/cardano-backend.js +13 -0
  33. package/srv/blockchain/backends/koios-backend.d.ts +26 -2
  34. package/srv/blockchain/backends/koios-backend.js +148 -25
  35. package/srv/blockchain/backends/ogmios-backend.d.ts +60 -9
  36. package/srv/blockchain/backends/ogmios-backend.js +326 -10
  37. package/srv/blockchain/cardano-client.d.ts +19 -0
  38. package/srv/blockchain/cardano-client.js +36 -0
  39. package/srv/blockchain/cardano-indexer.d.ts +50 -1
  40. package/srv/blockchain/cardano-indexer.js +193 -0
  41. package/srv/blockchain/crawler/crawler.d.ts +176 -0
  42. package/srv/blockchain/crawler/crawler.js +744 -0
  43. package/srv/blockchain/crawler/hooks.d.ts +43 -0
  44. package/srv/blockchain/crawler/hooks.js +62 -0
  45. package/srv/blockchain/crawler/index.d.ts +35 -0
  46. package/srv/blockchain/crawler/index.js +168 -0
  47. package/srv/blockchain/crawler/sync-state.d.ts +106 -0
  48. package/srv/blockchain/crawler/sync-state.js +287 -0
  49. package/srv/blockchain/signing/hsm-signer.d.ts +45 -0
  50. package/srv/blockchain/signing/hsm-signer.js +8 -1
  51. package/srv/blockchain/transaction-building/buildooor-tx.d.ts +20 -0
  52. package/srv/blockchain/transaction-building/buildooor-tx.js +104 -20
  53. package/srv/blockchain/wallet-worker/build-request.d.ts +26 -0
  54. package/srv/blockchain/wallet-worker/build-request.js +370 -0
  55. package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +117 -0
  56. package/srv/blockchain/wallet-worker/confirmation-tracker.js +290 -0
  57. package/srv/blockchain/wallet-worker/index.d.ts +14 -0
  58. package/srv/blockchain/wallet-worker/index.js +80 -0
  59. package/srv/blockchain/wallet-worker/job-store.d.ts +272 -0
  60. package/srv/blockchain/wallet-worker/job-store.js +597 -0
  61. package/srv/blockchain/wallet-worker/lease-heartbeat.d.ts +43 -0
  62. package/srv/blockchain/wallet-worker/lease-heartbeat.js +99 -0
  63. package/srv/blockchain/wallet-worker/signers.d.ts +57 -0
  64. package/srv/blockchain/wallet-worker/signers.js +131 -0
  65. package/srv/blockchain/wallet-worker/wallet-worker.d.ts +145 -0
  66. package/srv/blockchain/wallet-worker/wallet-worker.js +542 -0
  67. package/srv/cardano-agent-service.cds +150 -0
  68. package/srv/cardano-agent-service.d.ts +2 -0
  69. package/srv/cardano-agent-service.js +16 -0
  70. package/srv/cardano-indexer-service.cds +106 -0
  71. package/srv/cardano-indexer-service.d.ts +2 -0
  72. package/srv/cardano-indexer-service.js +79 -0
  73. package/srv/cardano-service.js +79 -4
  74. package/srv/cardano-sign-service.cds +200 -180
  75. package/srv/cardano-tx-service.cds +32 -26
  76. package/srv/cardano-tx-service.d.ts +1 -11
  77. package/srv/cardano-tx-service.js +107 -200
  78. package/srv/cardano-worker-service.cds +125 -0
  79. package/srv/cardano-worker-service.d.ts +2 -0
  80. package/srv/cardano-worker-service.js +199 -0
  81. package/srv/server.d.ts +34 -2
  82. package/srv/server.js +246 -36
  83. package/srv/utils/agent-grants-config.d.ts +65 -0
  84. package/srv/utils/agent-grants-config.js +148 -0
  85. package/srv/utils/agent-grants.d.ts +314 -0
  86. package/srv/utils/agent-grants.js +821 -0
  87. package/srv/utils/agent-token-auth.d.ts +19 -0
  88. package/srv/utils/agent-token-auth.js +81 -0
  89. package/srv/utils/collections.d.ts +13 -0
  90. package/srv/utils/collections.js +24 -0
  91. package/srv/utils/crypto.d.ts +16 -0
  92. package/srv/utils/crypto.js +75 -0
  93. package/srv/utils/db-sanitize.d.ts +40 -0
  94. package/srv/utils/db-sanitize.js +98 -0
  95. package/srv/utils/error-codes.d.ts +6 -0
  96. package/srv/utils/error-codes.js +6 -0
  97. package/srv/utils/errors.d.ts +12 -0
  98. package/srv/utils/errors.js +45 -0
  99. package/srv/utils/liveness.d.ts +23 -0
  100. package/srv/utils/liveness.js +49 -0
  101. package/srv/utils/mappers.d.ts +27 -0
  102. package/srv/utils/mappers.js +80 -10
  103. package/srv/utils/rate-limiter.d.ts +57 -0
  104. package/srv/utils/rate-limiter.js +126 -0
  105. package/srv/utils/service-events.d.ts +26 -0
  106. package/srv/utils/service-events.js +46 -0
  107. package/srv/utils/tx-request-parsers.d.ts +71 -0
  108. package/srv/utils/tx-request-parsers.js +202 -0
  109. package/srv/utils/tx-utils.d.ts +2 -1
  110. package/srv/utils/tx-utils.js +3 -2
  111. package/srv/utils/types.d.ts +17 -1
  112. package/@cds-models/CardanoODataService/index.d.ts.map +0 -1
  113. package/@cds-models/CardanoODataService/index.js.map +0 -1
  114. package/@cds-models/CardanoODataService/index.ts +0 -776
  115. package/@cds-models/CardanoSignService/index.d.ts.map +0 -1
  116. package/@cds-models/CardanoSignService/index.js.map +0 -1
  117. package/@cds-models/CardanoSignService/index.ts +0 -569
  118. package/@cds-models/CardanoTransactionService/index.d.ts.map +0 -1
  119. package/@cds-models/CardanoTransactionService/index.js.map +0 -1
  120. package/@cds-models/CardanoTransactionService/index.ts +0 -526
  121. package/@cds-models/_/index.d.ts.map +0 -1
  122. package/@cds-models/_/index.js.map +0 -1
  123. package/@cds-models/_/index.ts +0 -96
  124. package/@cds-models/cds/outbox/index.ts +0 -27
  125. package/@cds-models/index.d.ts.map +0 -1
  126. package/@cds-models/index.js.map +0 -1
  127. package/@cds-models/index.ts +0 -245
  128. package/@cds-models/odatano/cardano/index.d.ts.map +0 -1
  129. package/@cds-models/odatano/cardano/index.js.map +0 -1
  130. package/@cds-models/odatano/cardano/index.ts +0 -789
  131. package/@cds-models/sap/common/index.d.ts.map +0 -1
  132. package/@cds-models/sap/common/index.js.map +0 -1
  133. package/@cds-models/sap/common/index.ts +0 -249
@@ -1,270 +1,29 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.Timezones = exports.Timezone = exports.Currencies = exports.Currency = exports.Countries = exports.Country = exports.Languages = exports.Language = exports.FlowHistory_ = exports.FlowHistory = exports.TextsAspect_ = exports.TextsAspect = exports.CodeList_ = exports.CodeList = void 0;
37
- exports._CodeListAspect = _CodeListAspect;
38
- exports._TextsAspectAspect = _TextsAspectAspect;
39
- exports._FlowHistoryAspect = _FlowHistoryAspect;
40
- exports._LanguageAspect = _LanguageAspect;
41
- exports._CountryAspect = _CountryAspect;
42
- exports._CurrencyAspect = _CurrencyAspect;
43
- exports._TimezoneAspect = _TimezoneAspect;
44
1
  // This is an automatically generated file. Please do not change its contents manually!
45
- const __ = __importStar(require("./../../_"));
46
- // the following represents the CDS aspect 'CodeList'
47
- function _CodeListAspect(Base) {
48
- return class CodeList extends Base {
49
- static kind = 'aspect';
50
- };
51
- }
52
- /**
53
- * Aspect for a code list with name and description
54
- *
55
- * See https://cap.cloud.sap/docs/cds/common#aspect-codelist
56
- */
57
- class CodeList extends _CodeListAspect(__.Entity) {
58
- }
59
- exports.CodeList = CodeList;
60
- /**
61
- * Aspect for a code list with name and description
62
- *
63
- * See https://cap.cloud.sap/docs/cds/common#aspect-codelist
64
- */
65
- class CodeList_ extends Array {
66
- $count;
67
- }
68
- exports.CodeList_ = CodeList_;
69
- Object.defineProperty(CodeList_, 'name', { value: 'sap.common.CodeList' });
70
- // the following represents the CDS aspect 'TextsAspect'
71
- function _TextsAspectAspect(Base) {
72
- return class TextsAspect extends Base {
73
- static kind = 'aspect';
74
- };
75
- }
76
- class TextsAspect extends _TextsAspectAspect(__.Entity) {
77
- }
78
- exports.TextsAspect = TextsAspect;
79
- class TextsAspect_ extends Array {
80
- $count;
81
- }
82
- exports.TextsAspect_ = TextsAspect_;
83
- Object.defineProperty(TextsAspect_, 'name', { value: 'sap.common.TextsAspect' });
84
- // the following represents the CDS aspect 'FlowHistory'
85
- function _FlowHistoryAspect(Base) {
86
- return class FlowHistory extends Base {
87
- static kind = 'aspect';
88
- };
89
- }
90
- class FlowHistory extends _FlowHistoryAspect(__.Entity) {
91
- }
92
- exports.FlowHistory = FlowHistory;
93
- class FlowHistory_ extends Array {
94
- $count;
95
- }
96
- exports.FlowHistory_ = FlowHistory_;
97
- Object.defineProperty(FlowHistory_, 'name', { value: 'sap.common.FlowHistory' });
98
- function _LanguageAspect(Base) {
99
- return class Language extends _CodeListAspect(Base) {
100
- static kind = 'entity';
101
- };
102
- }
103
- /**
104
- * Code list for languages
105
- *
106
- * See https://cap.cloud.sap/docs/cds/common#entity-languages
107
- */
108
- class Language extends _LanguageAspect(__.Entity) {
109
- }
110
- exports.Language = Language;
111
- Object.defineProperty(Language, 'name', { value: 'sap.common.Languages' });
112
- Object.defineProperty(Language, 'is_singular', { value: true });
113
- /**
114
- * Code list for languages
115
- *
116
- * See https://cap.cloud.sap/docs/cds/common#entity-languages
117
- */
118
- class Languages extends Array {
119
- $count;
120
- }
121
- exports.Languages = Languages;
122
- Object.defineProperty(Languages, 'name', { value: 'sap.common.Languages' });
123
- function _CountryAspect(Base) {
124
- return class Country extends _CodeListAspect(Base) {
125
- static kind = 'entity';
126
- };
127
- }
128
- /**
129
- * Code list for countries
130
- *
131
- * See https://cap.cloud.sap/docs/cds/common#entity-countries
132
- */
133
- class Country extends _CountryAspect(__.Entity) {
134
- }
135
- exports.Country = Country;
136
- Object.defineProperty(Country, 'name', { value: 'sap.common.Countries' });
137
- Object.defineProperty(Country, 'is_singular', { value: true });
138
- /**
139
- * Code list for countries
140
- *
141
- * See https://cap.cloud.sap/docs/cds/common#entity-countries
142
- */
143
- class Countries extends Array {
144
- $count;
145
- }
146
- exports.Countries = Countries;
147
- Object.defineProperty(Countries, 'name', { value: 'sap.common.Countries' });
148
- function _CurrencyAspect(Base) {
149
- return class Currency extends _CodeListAspect(Base) {
150
- static kind = 'entity';
151
- };
152
- }
153
- /**
154
- * Code list for currencies
155
- *
156
- * See https://cap.cloud.sap/docs/cds/common#entity-currencies
157
- */
158
- class Currency extends _CurrencyAspect(__.Entity) {
159
- }
160
- exports.Currency = Currency;
161
- Object.defineProperty(Currency, 'name', { value: 'sap.common.Currencies' });
162
- Object.defineProperty(Currency, 'is_singular', { value: true });
163
- /**
164
- * Code list for currencies
165
- *
166
- * See https://cap.cloud.sap/docs/cds/common#entity-currencies
167
- */
168
- class Currencies extends Array {
169
- $count;
170
- }
171
- exports.Currencies = Currencies;
172
- Object.defineProperty(Currencies, 'name', { value: 'sap.common.Currencies' });
173
- function _TimezoneAspect(Base) {
174
- return class Timezone extends _CodeListAspect(Base) {
175
- static kind = 'entity';
176
- };
177
- }
178
- /**
179
- * Code list for time zones
180
- *
181
- * See https://cap.cloud.sap/docs/cds/common#entity-timezones
182
- */
183
- class Timezone extends _TimezoneAspect(__.Entity) {
184
- }
185
- exports.Timezone = Timezone;
186
- Object.defineProperty(Timezone, 'name', { value: 'sap.common.Timezones' });
187
- Object.defineProperty(Timezone, 'is_singular', { value: true });
188
- /**
189
- * Code list for time zones
190
- *
191
- * See https://cap.cloud.sap/docs/cds/common#entity-timezones
192
- */
193
- class Timezones extends Array {
194
- $count;
195
- }
196
- exports.Timezones = Timezones;
197
- Object.defineProperty(Timezones, 'name', { value: 'sap.common.Timezones' });
198
- (function (Languages) {
199
- function _textAspect(Base) {
200
- return class text extends _TextsAspectAspect(Base) {
201
- static kind = 'entity';
202
- };
203
- }
204
- Languages._textAspect = _textAspect;
205
- class text extends _textAspect(__.Entity) {
206
- }
207
- Languages.text = text;
208
- Object.defineProperty(text, 'name', { value: 'sap.common.Languages.texts' });
209
- Object.defineProperty(text, 'is_singular', { value: true });
210
- class texts extends Array {
211
- $count;
212
- }
213
- Languages.texts = texts;
214
- Object.defineProperty(texts, 'name', { value: 'sap.common.Languages.texts' });
215
- })(Languages || (exports.Languages = Languages = {}));
216
- (function (Countries) {
217
- function _textAspect(Base) {
218
- return class text extends _TextsAspectAspect(Base) {
219
- static kind = 'entity';
220
- };
221
- }
222
- Countries._textAspect = _textAspect;
223
- class text extends _textAspect(__.Entity) {
224
- }
225
- Countries.text = text;
226
- Object.defineProperty(text, 'name', { value: 'sap.common.Countries.texts' });
227
- Object.defineProperty(text, 'is_singular', { value: true });
228
- class texts extends Array {
229
- $count;
230
- }
231
- Countries.texts = texts;
232
- Object.defineProperty(texts, 'name', { value: 'sap.common.Countries.texts' });
233
- })(Countries || (exports.Countries = Countries = {}));
234
- (function (Currencies) {
235
- function _textAspect(Base) {
236
- return class text extends _TextsAspectAspect(Base) {
237
- static kind = 'entity';
238
- };
239
- }
240
- Currencies._textAspect = _textAspect;
241
- class text extends _textAspect(__.Entity) {
242
- }
243
- Currencies.text = text;
244
- Object.defineProperty(text, 'name', { value: 'sap.common.Currencies.texts' });
245
- Object.defineProperty(text, 'is_singular', { value: true });
246
- class texts extends Array {
247
- $count;
248
- }
249
- Currencies.texts = texts;
250
- Object.defineProperty(texts, 'name', { value: 'sap.common.Currencies.texts' });
251
- })(Currencies || (exports.Currencies = Currencies = {}));
252
- (function (Timezones) {
253
- function _textAspect(Base) {
254
- return class text extends _TextsAspectAspect(Base) {
255
- static kind = 'entity';
256
- };
257
- }
258
- Timezones._textAspect = _textAspect;
259
- class text extends _textAspect(__.Entity) {
260
- }
261
- Timezones.text = text;
262
- Object.defineProperty(text, 'name', { value: 'sap.common.Timezones.texts' });
263
- Object.defineProperty(text, 'is_singular', { value: true });
264
- class texts extends Array {
265
- $count;
266
- }
267
- Timezones.texts = texts;
268
- Object.defineProperty(texts, 'name', { value: 'sap.common.Timezones.texts' });
269
- })(Timezones || (exports.Timezones = Timezones = {}));
270
- //# sourceMappingURL=index.js.map
2
+ const { createEntityProxy } = require('./../../_')
3
+ // Languages
4
+ module.exports.Language = createEntityProxy(['sap.common', 'Languages'], { target: { is_singular: true } })
5
+ module.exports.Languages = createEntityProxy(['sap.common', 'Languages'], { target: { is_singular: false }})
6
+ // Countries
7
+ module.exports.Country = createEntityProxy(['sap.common', 'Countries'], { target: { is_singular: true } })
8
+ module.exports.Countries = createEntityProxy(['sap.common', 'Countries'], { target: { is_singular: false }})
9
+ // Currencies
10
+ module.exports.Currency = createEntityProxy(['sap.common', 'Currencies'], { target: { is_singular: true } })
11
+ module.exports.Currencies = createEntityProxy(['sap.common', 'Currencies'], { target: { is_singular: false }})
12
+ // Timezones
13
+ module.exports.Timezone = createEntityProxy(['sap.common', 'Timezones'], { target: { is_singular: true } })
14
+ module.exports.Timezones = createEntityProxy(['sap.common', 'Timezones'], { target: { is_singular: false }})
15
+ // Languages.texts
16
+ module.exports.Languages.text = createEntityProxy(['sap.common', 'Languages.texts'], { target: { is_singular: true } })
17
+ module.exports.Languages.texts = createEntityProxy(['sap.common', 'Languages.texts'], { target: { is_singular: false }})
18
+ // Countries.texts
19
+ module.exports.Countries.text = createEntityProxy(['sap.common', 'Countries.texts'], { target: { is_singular: true } })
20
+ module.exports.Countries.texts = createEntityProxy(['sap.common', 'Countries.texts'], { target: { is_singular: false }})
21
+ // Currencies.texts
22
+ module.exports.Currencies.text = createEntityProxy(['sap.common', 'Currencies.texts'], { target: { is_singular: true } })
23
+ module.exports.Currencies.texts = createEntityProxy(['sap.common', 'Currencies.texts'], { target: { is_singular: false }})
24
+ // Timezones.texts
25
+ module.exports.Timezones.text = createEntityProxy(['sap.common', 'Timezones.texts'], { target: { is_singular: true } })
26
+ module.exports.Timezones.texts = createEntityProxy(['sap.common', 'Timezones.texts'], { target: { is_singular: false }})
27
+ // events
28
+ // actions
29
+ // enums
package/README.md CHANGED
@@ -1,102 +1,194 @@
1
- ![alt text](docs/assets/odatano_logo/logo_odatano_white.png)
2
-
3
- # Enterprise OData Services for the Cardano Blockchain
4
-
5
- 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).
6
-
7
- **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.
8
-
9
- [![Tests](https://github.com/ODATANO/ODATANO/actions/workflows/test.yaml/badge.svg)](https://github.com/ODATANO/ODATANO/actions/workflows/test.yaml)
10
- [![Coverage](https://codecov.io/gh/ODATANO/ODATANO/branch/main/graph/badge.svg)](https://codecov.io/gh/ODATANO/ODATANO)
11
- [![npm version](https://img.shields.io/npm/v/@odatano/core?logo=npm)](https://www.npmjs.com/package/@odatano/core)
12
- [![npm downloads](https://img.shields.io/npm/dt/@odatano/core?logo=npm&label=downloads&color=blue)](https://www.npmjs.com/package/@odatano/core)
13
- [![License](https://img.shields.io/badge/license-Apache%202.0-yellow)](LICENSE)
14
-
15
-
16
- ## Quick Start
17
-
18
- ### As CAP Plugin (recommended)
19
-
20
- Add ODATANO to any existing SAP CAP project:
21
-
22
- ```bash
23
- npm install @odatano/core @cap-js/sqlite
24
- ```
25
-
26
- ```json
27
- {
28
- "cds": {
29
- "requires": {
30
- "db": { "kind": "sqlite" },
31
- "odatano-core": {
32
- "network": "preview",
33
- "backends": ["blockfrost"],
34
- "blockfrostApiKey": "preview_your_api_key_here"
35
- }
36
- }
37
- }
38
- }
39
- ```
40
-
41
- ```bash
42
- cds deploy --to sqlite
43
- cds serve
44
- ```
45
-
46
- > **Self-hosted Blockfrost-compatible node?** (Dolos MiniBF, Demeter Self-Hosted)
47
- > Set `blockfrostCustomBackend` to the node's base URL (e.g. `http://localhost:3010/api/v0`).
48
- > When set, `blockfrostApiKey` becomes optional. See the [Backend Configuration Guide](docs/guides/BACKEND_CONFIGURATION.md#self-hosted-blockfrost-compatible-backends).
49
-
50
- ### Standalone
51
-
52
- Run ODATANO as a self-contained service (no host CAP project needed):
53
-
54
- ```bash
55
- git clone https://github.com/ODATANO/ODATANO && cd ODATANO
56
- npm ci
57
- cp .env.example .env # set BLOCKFROST_API_KEY, NETWORK, BACKENDS
58
- cds deploy --to sqlite
59
- cds serve
60
- ```
61
-
62
- Or with Docker — this brings up a local **cardano-node + Ogmios + ODATANO** stack
63
- (Preview), with the service pre-wired to the local Ogmios backend:
64
-
65
- ```bash
66
- docker compose up -d # full stack
67
- docker compose up -d cardano-node ogmios # just the chain backend (pre-sync)
68
- docker compose logs -f ogmios # watch sync (/health: 202 syncing, 200 near tip)
69
- ```
70
-
71
- > First sync from genesis takes hours; the node DB persists in a Docker volume so
72
- > restarts resume. Until Ogmios catches up, historical queries fall back to
73
- > Blockfrost (set `BLOCKFROST_API_KEY`).
74
-
75
- 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.
76
-
77
- ## Dev Mode: Mocked Authentication
78
-
79
- > **Heads-up.** `cds serve` uses CAP's mocked auth: `@requires: 'authenticated-user'` accepts any Basic-Auth header against a mock user (`alice`, `bob`, …) — passwords are not checked. Anonymous requests get 401, but anyone reaching the port can authenticate.
80
- >
81
- > 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).
82
-
83
- ## Documentation
84
-
85
- | Guide | Description |
86
- |-------|-------------|
87
- | [Quick Start](docs/QUICK_START.md) | Get running in 5 minutes |
88
- | [User Guide](docs/guides/USER_GUIDE.md) | API usage, entities, and examples |
89
- | [Developer Guide](docs/guides/DEVELOPER_GUIDE.md) | Architecture and development |
90
- | [Transaction Workflow](docs/guides/TRANSACTION_WORKFLOW.md) | Build → Sign → Submit flow |
91
- | [Security Guide](docs/guides/SECURITY_GUIDE.md) | Authentication, signing security, HSM |
92
- | [Docker Deployment](docs/guides/DOCKER_DEPLOYMENT.md) | Container deployment |
93
-
94
- ## License
95
-
96
- Apache License 2.0 - see [LICENSE](LICENSE)
97
-
98
- ## Support
99
-
100
- - **Issues**: [GitHub Issues](https://github.com/ODATANO/ODATANO/issues)
101
- - **Project Lead**: Max Weber
102
- - **Contact**: info@odatano.dev
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
+ [![Tests](https://github.com/ODATANO/ODATANO/actions/workflows/test.yaml/badge.svg)](https://github.com/ODATANO/ODATANO/actions/workflows/test.yaml)
15
+ [![Coverage](https://codecov.io/gh/ODATANO/ODATANO/branch/main/graph/badge.svg)](https://codecov.io/gh/ODATANO/ODATANO)
16
+ [![npm version](https://img.shields.io/npm/v/@odatano/core?logo=npm)](https://www.npmjs.com/package/@odatano/core)
17
+ [![npm downloads](https://img.shields.io/npm/dt/@odatano/core?logo=npm&label=downloads&color=blue)](https://www.npmjs.com/package/@odatano/core)
18
+ [![License](https://img.shields.io/badge/license-Apache%202.0-yellow)](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
+ "odatano-core": {
37
+ "network": "preview",
38
+ "backends": ["blockfrost"]
39
+ }
40
+ }
41
+ }
42
+ }
43
+ ```
44
+
45
+ Put your API key in a `.env` file in the project root (loaded automatically by `cds serve` / `cds watch`) — don't commit it to `package.json`:
46
+
47
+ ```bash
48
+ # .env
49
+ BLOCKFROST_API_KEY=preview_your_api_key_here
50
+ ```
51
+
52
+ ```bash
53
+ cds deploy --to sqlite
54
+ cds serve
55
+ ```
56
+
57
+ > Config in `cds.requires.odatano-core` takes precedence over environment
58
+ > variables; a `blockfrostApiKey` set there would override the `.env` value.
59
+
60
+ > **Self-hosted Blockfrost-compatible node?** (Dolos MiniBF, Demeter Self-Hosted)
61
+ > Set `blockfrostCustomBackend` to the node's base URL (e.g. `http://localhost:3010/api/v0`).
62
+ > When set, `blockfrostApiKey` becomes optional. See the [Backend Configuration Guide](docs/guides/BACKEND_CONFIGURATION.md#self-hosted-blockfrost-compatible-backends).
63
+
64
+ ### Standalone
65
+
66
+ Run ODATANO as a self-contained service (no host CAP project needed):
67
+
68
+ ```bash
69
+ git clone https://github.com/ODATANO/ODATANO && cd ODATANO
70
+ npm ci
71
+ cp .env.example .env # set BLOCKFROST_API_KEY, NETWORK, BACKENDS
72
+ cds deploy --to sqlite
73
+ cds serve
74
+ ```
75
+
76
+ Or with Docker — this brings up a local **cardano-node + Ogmios + ODATANO** stack
77
+ (Preview), with the service pre-wired to the local Ogmios backend:
78
+
79
+ ```bash
80
+ docker compose up -d # full stack
81
+ docker compose up -d cardano-node ogmios # just the chain backend (pre-sync)
82
+ docker compose logs -f ogmios # watch sync (/health: 202 syncing, 200 near tip)
83
+ ```
84
+
85
+ > First sync from genesis takes hours; the node DB persists in a Docker volume so
86
+ > restarts resume. Until Ogmios catches up, historical queries fall back to
87
+ > Blockfrost (set `BLOCKFROST_API_KEY`).
88
+
89
+ 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.
90
+
91
+ ## Dev Mode: Mocked Authentication
92
+
93
+ > **Heads-up.** `cds serve` uses CAP's mocked auth: `@requires: 'authenticated-user'` accepts any Basic-Auth header against a mock user (`alice`, `bob`, …) — passwords are not checked. Anonymous requests get 401, but anyone reaching the port can authenticate.
94
+ >
95
+ > 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).
96
+ >
97
+ > 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 `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.
98
+ >
99
+ > 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.
100
+
101
+ ## Services
102
+
103
+ | Service | Path | Purpose |
104
+ |---|---|---|
105
+ | CardanoODataService | `/odata/v4/cardano-odata/` | Read blockchain data (20 entities, 19 actions) |
106
+ | CardanoTransactionService | `/odata/v4/cardano-transaction/` | Build & submit transactions (13 actions) |
107
+ | CardanoSignService | `/odata/v4/cardano-sign/` | External signing + HSM (9 actions) |
108
+ | CardanoIndexerService | `/odata/v4/cardano-indexer/` | Chain crawler / pre-sync control (v2.0, off by default) |
109
+ | CardanoWorkerService | `/odata/v4/cardano-worker/` | Asynchronous wallet jobs (v2.0, off by default) |
110
+ | CardanoAgentService | `/odata/v4/cardano-agent/` | Agent grants: scoped bearer tokens for agents (v2.0, off by default) |
111
+
112
+ Both v2.0 services also publish **CAP events**, so a consumer can subscribe instead of polling —
113
+ in-process, no broker required:
114
+
115
+ ```js
116
+ (await cds.connect.to('CardanoWorkerService')).on('jobConfirmed', ({ data }) => …)
117
+ (await cds.connect.to('CardanoIndexerService')).on('blockIndexed', ({ data }) => …)
118
+ ```
119
+
120
+ ## Agent grants (v2.0, off by default)
121
+
122
+ Hand an agent a **scoped, budgeted token** instead of a user.
123
+
124
+ ```bash
125
+ AGENT_GRANTS_ENABLED=true # or cds.requires.odatano-core.agentGrants.enabled
126
+ AGENT_GRANTS_DELEGATE=mocked # CAP auth kind that keeps authenticating non-token requests (default: configured kind)
127
+ AGENT_GRANT_ADMIN_RATE_LIMIT=10 # grant administration calls per principal per hour (or agentGrants.adminRateLimit)
128
+ ```
129
+
130
+ 1. An **Admin** issues a grant (`POST /odata/v4/cardano-agent/CreateAgentGrant`): an allow list of
131
+ actions, optionally a worker `walletId` (required for `SubmitWalletJob`/`CancelJob`), allowed job
132
+ kinds, a daily budget and an expiry. The response carries the token `odat_…` **once**; the
133
+ server stores only its SHA-256.
134
+ 2. The agent sends `x-agent-token: odat_…` on any of the six service paths. It runs as the principal
135
+ `agent:<grantId>` with the single role `agent-grant`, never as the operator: every
136
+ `@requires: 'Admin'` surface (pause/resume, HSM signing, grant administration) refuses it by
137
+ construction. Reads and compute-only actions are always allowed; allow-listed actions each cost
138
+ one budget unit per UTC day (a build is the service an agent buys); everything else is 403.
139
+ Wallet jobs are pinned to the grant's wallet and visible only to the grant that queued them.
140
+ 3. `GET /odata/v4/cardano-agent/GetGrantStatus()` tells the agent what it may do and how much budget
141
+ is left; `RevokeAgentGrant` turns the token into an unknown token immediately.
142
+ 4. Lifecycle (Admin, same semantics as NIGHTGATE's agent grants so a gateway drives both with one
143
+ code path): `UpdateAgentGrant` changes label, allow list, job kinds, daily budget or expiry
144
+ (absent = untouched, explicit `null` = cleared; the wallet binding is immutable, 409
145
+ `GRANT_REVOKED` on a revoked grant); `RotateAgentGrantToken` returns a fresh token once, the old
146
+ one is unknown from the next request; `GetGrantUsage(grantId, since, until)` lists admitted calls
147
+ per service and action over up to 366 days (an Admin for any grant, a token for its own). All
148
+ administration calls share the per-principal hourly rate limit above.
149
+
150
+ Grantable: `Build*`, `SetCollateral`, `CreateSigningRequest`, `VerifySignature`, `Submit*`,
151
+ `CheckSubmissionStatus`, `SubmitWalletJob`, `CancelJob`. Never: `SignWithHsm*`, `Pause*`/`Resume*`,
152
+ `pauseCrawler`/`resumeCrawler`, grant administration.
153
+
154
+ Programmatic seams for other packages (`@odatano/x402` sells grants against a 402 payment):
155
+ `issueAgentGrant()`, `updateAgentGrant()`, `rotateAgentGrantToken()`, `revokeAgentGrantById()`,
156
+ `getGrantUsage()`, `registerTransportLane()` from `@odatano/core`.
157
+
158
+ ## Liveness probe
159
+
160
+ `GET /odata/v4/cardano-indexer/getLiveness()` answers `200 { status: "alive", timestamp, uptime,
161
+ version, network }` **without credentials** (`@requires: 'any'`) as long as the process runs — no
162
+ backend or DB probe, no secrets. The Docker `HEALTHCHECK`, compose and upstream probes use it
163
+ instead of the service document, so a wrong operator password no longer reads as "ODATANO down".
164
+ Readiness (crawler, worker, backends) stays authenticated: `getStatus()`, `GetWorkerStatus()`,
165
+ `GetNetworkInformation`.
166
+
167
+ ## Requirements
168
+
169
+ - **Node.js >= 22.5** and **@sap/cds >= 10** (peer dependency). CAP 9 hosts cannot load `@odatano/core@2`.
170
+ - Upgrading a consumer from 1.x: run **`cds deploy`**. 2.0 adds six tables (`CardanoSyncState`,
171
+ `CardanoReorgLog`, `CardanoWorkerWallets`, `CardanoWalletJobs`, `CardanoAgentGrants`,
172
+ `CardanoAgentGrantUsage`) plus a `dedupKey` column; without the redeploy the new services answer
173
+ `no such table` while the old ones keep working.
174
+
175
+ ## Documentation
176
+
177
+ | Guide | Description |
178
+ |-------|-------------|
179
+ | [Quick Start](docs/QUICK_START.md) | Get running in 5 minutes |
180
+ | [User Guide](docs/guides/USER_GUIDE.md) | API usage, entities, and examples |
181
+ | [Developer Guide](docs/guides/DEVELOPER_GUIDE.md) | Architecture and development |
182
+ | [Transaction Workflow](docs/guides/TRANSACTION_WORKFLOW.md) | Build → Sign → Submit flow |
183
+ | [Security Guide](docs/guides/SECURITY_GUIDE.md) | Authentication, signing security, HSM |
184
+ | [Docker Deployment](docs/guides/DOCKER_DEPLOYMENT.md) | Container deployment |
185
+
186
+ ## License
187
+
188
+ Apache License 2.0 - see [LICENSE](LICENSE)
189
+
190
+ ## Support
191
+
192
+ - **Issues**: [GitHub Issues](https://github.com/ODATANO/ODATANO/issues)
193
+ - **Project Lead**: Max Weber
194
+ - **Contact**: info@odatano.dev