@odatano/core 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +212 -0
  3. package/cds-plugin.js +5 -0
  4. package/config/preview/cardano-node/alonzo-genesis.json +196 -0
  5. package/config/preview/cardano-node/byron-genesis.json +117 -0
  6. package/config/preview/cardano-node/config.json +118 -0
  7. package/config/preview/cardano-node/conway-genesis.json +297 -0
  8. package/config/preview/cardano-node/shelley-genesis.json +68 -0
  9. package/config/preview/cardano-node/topology.json +19 -0
  10. package/db/schema.cds +1318 -0
  11. package/package.json +125 -0
  12. package/src/index.d.ts.map +1 -0
  13. package/src/index.js +96 -0
  14. package/src/index.js.map +1 -0
  15. package/src/plugin.d.ts.map +1 -0
  16. package/src/plugin.js +92 -0
  17. package/src/plugin.js.map +1 -0
  18. package/srv/blockchain/backends/blockfrost-backend.d.ts.map +1 -0
  19. package/srv/blockchain/backends/blockfrost-backend.js +398 -0
  20. package/srv/blockchain/backends/blockfrost-backend.js.map +1 -0
  21. package/srv/blockchain/backends/cardano-backend.d.ts.map +1 -0
  22. package/srv/blockchain/backends/cardano-backend.js +12 -0
  23. package/srv/blockchain/backends/cardano-backend.js.map +1 -0
  24. package/srv/blockchain/backends/koios-backend.d.ts.map +1 -0
  25. package/srv/blockchain/backends/koios-backend.js +537 -0
  26. package/srv/blockchain/backends/koios-backend.js.map +1 -0
  27. package/srv/blockchain/backends/ogmios-backend.d.ts.map +1 -0
  28. package/srv/blockchain/backends/ogmios-backend.js +516 -0
  29. package/srv/blockchain/backends/ogmios-backend.js.map +1 -0
  30. package/srv/blockchain/cardano-client.d.ts.map +1 -0
  31. package/srv/blockchain/cardano-client.js +377 -0
  32. package/srv/blockchain/cardano-client.js.map +1 -0
  33. package/srv/blockchain/cardano-indexer.d.ts.map +1 -0
  34. package/srv/blockchain/cardano-indexer.js +542 -0
  35. package/srv/blockchain/cardano-indexer.js.map +1 -0
  36. package/srv/blockchain/cardano-tx-builder.d.ts.map +1 -0
  37. package/srv/blockchain/cardano-tx-builder.js +232 -0
  38. package/srv/blockchain/cardano-tx-builder.js.map +1 -0
  39. package/srv/blockchain/circuit-breaker.d.ts.map +1 -0
  40. package/srv/blockchain/circuit-breaker.js +110 -0
  41. package/srv/blockchain/circuit-breaker.js.map +1 -0
  42. package/srv/blockchain/signing/external-signer.d.ts.map +1 -0
  43. package/srv/blockchain/signing/external-signer.js +302 -0
  44. package/srv/blockchain/signing/external-signer.js.map +1 -0
  45. package/srv/blockchain/signing/signature-verifier.d.ts.map +1 -0
  46. package/srv/blockchain/signing/signature-verifier.js +249 -0
  47. package/srv/blockchain/signing/signature-verifier.js.map +1 -0
  48. package/srv/blockchain/transaction-building/buildooor-tx.d.ts.map +1 -0
  49. package/srv/blockchain/transaction-building/buildooor-tx.js +636 -0
  50. package/srv/blockchain/transaction-building/buildooor-tx.js.map +1 -0
  51. package/srv/blockchain/transaction-building/cardano-tx.d.ts.map +1 -0
  52. package/srv/blockchain/transaction-building/cardano-tx.js +3 -0
  53. package/srv/blockchain/transaction-building/cardano-tx.js.map +1 -0
  54. package/srv/blockchain/transaction-building/csl-tx.d.ts.map +1 -0
  55. package/srv/blockchain/transaction-building/csl-tx.js +766 -0
  56. package/srv/blockchain/transaction-building/csl-tx.js.map +1 -0
  57. package/srv/blockchain/transaction-building/tx-builder-registry.d.ts.map +1 -0
  58. package/srv/blockchain/transaction-building/tx-builder-registry.js +67 -0
  59. package/srv/blockchain/transaction-building/tx-builder-registry.js.map +1 -0
  60. package/srv/cardano-service.cds +179 -0
  61. package/srv/cardano-service.d.ts.map +1 -0
  62. package/srv/cardano-service.js +227 -0
  63. package/srv/cardano-service.js.map +1 -0
  64. package/srv/cardano-tx-service.cds +298 -0
  65. package/srv/cardano-tx-service.d.ts.map +1 -0
  66. package/srv/cardano-tx-service.js +646 -0
  67. package/srv/cardano-tx-service.js.map +1 -0
  68. package/srv/cardano-ui.cds +2949 -0
  69. package/srv/server.d.ts.map +1 -0
  70. package/srv/server.js +212 -0
  71. package/srv/server.js.map +1 -0
  72. package/srv/utils/backend-request-handler.d.ts.map +1 -0
  73. package/srv/utils/backend-request-handler.js +47 -0
  74. package/srv/utils/backend-request-handler.js.map +1 -0
  75. package/srv/utils/const.d.ts.map +1 -0
  76. package/srv/utils/const.js +86 -0
  77. package/srv/utils/const.js.map +1 -0
  78. package/srv/utils/error-codes.d.ts.map +1 -0
  79. package/srv/utils/error-codes.js +49 -0
  80. package/srv/utils/error-codes.js.map +1 -0
  81. package/srv/utils/errors.d.ts.map +1 -0
  82. package/srv/utils/errors.js +389 -0
  83. package/srv/utils/errors.js.map +1 -0
  84. package/srv/utils/mappers.d.ts.map +1 -0
  85. package/srv/utils/mappers.js +723 -0
  86. package/srv/utils/mappers.js.map +1 -0
  87. package/srv/utils/signing-helper.d.ts.map +1 -0
  88. package/srv/utils/signing-helper.js +128 -0
  89. package/srv/utils/signing-helper.js.map +1 -0
  90. package/srv/utils/tx-build-helper.d.ts.map +1 -0
  91. package/srv/utils/tx-build-helper.js +135 -0
  92. package/srv/utils/tx-build-helper.js.map +1 -0
  93. package/srv/utils/types.d.ts.map +1 -0
  94. package/srv/utils/types.js +36 -0
  95. package/srv/utils/types.js.map +1 -0
  96. package/srv/utils/validators.d.ts.map +1 -0
  97. package/srv/utils/validators.js +382 -0
  98. package/srv/utils/validators.js.map +1 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,212 @@
1
+ # ODATANO
2
+
3
+ **OData Service for the Cardano Blockchain**
4
+
5
+ **ODATANO** is an SAP CAP–based service that exposes the Cardano blockchain via a standardized **OData V4** interface, enabling seamless enterprise-grade read and write access.
6
+ It provides unified REST/OData access to on-chain data while supporting native transaction building and submission directly from business applications.
7
+ By abstracting blockchain complexity behind familiar SAP integration patterns, ODATANO allows enterprises to integrate Cardano into core processes securely, auditable, and at scale.
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
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue)]()
12
+ [![CAP](https://img.shields.io/badge/SAP%20CAP-9.x-blue)]()
13
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
14
+
15
+ ## Project Status
16
+
17
+ **Funded by Cardano Catalyst Fund 14:** [Official Proposal](https://projectcatalyst.io/funds/14/sponsored-by-leftovers/sap-cardano-odata-v4-api-with-cap-and-sap-cardano-sdk)
18
+
19
+ ### Milestone 1 (Completed January 2026) ✅
20
+ Cardano read operations with multi-provider failover (Blockfrost → Koios), 17 Entities defining Cardano Core Components & 11 Blockchain Read Actions with comprehensive input validation, full OData V4 query support, lazy on-demand indexing with TTL-based refresh, 340 tests across 11 test suites, CI/CD with Codecov integration
21
+
22
+ [Milestone 1: OData Service Foundation & Blockchain Read Access](https://milestones.projectcatalyst.io/projects/1400109/milestones/1)
23
+
24
+ ### Milestone 2 (Completed February 2026) ✅
25
+ Cardano transaction building with dual-builder architecture (CSL & Buildooor), 4 transaction types (simple transfers, token minting, multi-asset transfers, metadata), Ogmios live backend for protocol parameters & UTxO queries, 6 Transaction Actions with external signing workflow, full Build → Sign → Submit flow, 327 new tests & 6 new test suites, end-to-end Preview testnet examples & Postman collection
26
+
27
+ [Milestone 2: Transaction Build & Submit](https://milestones.projectcatalyst.io/projects/1400109/milestones/2)
28
+
29
+ ### Milestone 3 (Pending March 2026) ⏳
30
+ Extension of the transaction module & external workflow to export unsigned Cardano transactions via OData, enabling deterministic external signing (e.g. Cardano CLI or browser wallets) with full key separation and no private-key handling in the CAP service.
31
+ Includes Plutus smart contract support (BuildPlutusSpendTransaction, SetCollateral), end-to-end external signer integration, SAP S/4HANA business process examples, enterprise use cases, a sample Fiori wallet viewer app, and comprehensive automated integration and security tests.
32
+
33
+ [Milestone 3: External Signing & SAP Integration](https://milestones.projectcatalyst.io/projects/1400109/milestones/3)
34
+
35
+ ### Final Milestone (Upcoming April/May 2026)
36
+ A demonstration-mode video of the Wallet Viewer Fiori App illustrating audit, compliance, and sustainability use cases, accompanied by transparent community announcements. The milestone is closed with a formal Catalyst close-out report and a short end-to-end video summarizing results, lessons learned, and future plans.
37
+
38
+ [Final Milestone: Finalization, Advanced Use Cases & Project Close-Out](https://milestones.projectcatalyst.io/projects/1400109/milestones/4)
39
+
40
+
41
+ ## Key Features
42
+
43
+ - **OData V4 Protocol**: Full query support ($filter, $select, $expand, $top, $skip, $count, $orderby)
44
+ - **Multi-Network Support**: Mainnet, Preview, and Preprod configurations
45
+ - **Multi-Provider Architecture**: Blockfrost + Koios + Ogmios with automatic failover
46
+ - **Transaction Building**: Cardano Serialization Library (CSL) & Buildooor for minting, ADA or Token transfers, and metadata transactions
47
+ - **Lazy On-Demand Indexing**: TTL-based refresh for changing blockchain data for performance optimization
48
+ - **Enterprise-Grade Validation**: Strict input validation and error handling
49
+ - **Comprehensive Testing**: 932 tests across 25 test suites, 96%+ statement coverage
50
+
51
+ ## Quick Start
52
+
53
+ ### Use as CAP Plugin (Recommended)
54
+
55
+ Add ODATANO to any existing SAP CAP project:
56
+
57
+ ```bash
58
+ npm install @odatano/core @cap-js/sqlite
59
+ ```
60
+
61
+ Configure in your `package.json`:
62
+
63
+ ```json
64
+ {
65
+ "cds": {
66
+ "requires": {
67
+ "db": { "kind": "sqlite" },
68
+ "odatano-core": {
69
+ "network": "preview",
70
+ "backends": ["blockfrost"],
71
+ "blockfrostApiKey": "preview_YOUR_KEY"
72
+ }
73
+ }
74
+ }
75
+ }
76
+ ```
77
+
78
+ ```bash
79
+ cds watch
80
+ # → CardanoODataService + CardanoTransactionService auto-registered
81
+ # → /odata/v4/cardano-odata/ and /odata/v4/cardano-transaction/ ready
82
+ ```
83
+
84
+ ### Docker (Standalone)
85
+
86
+ ```bash
87
+ git clone https://github.com/ODATANO/ODATANO && cd ODATANO
88
+ cp .env.example .env # Add your BLOCKFROST_KEY
89
+ docker-compose up -d
90
+ ```
91
+
92
+ Service runs at `http://localhost:4004`
93
+
94
+ ### Local Development (Standalone)
95
+
96
+ ```bash
97
+ git clone https://github.com/ODATANO/ODATANO && cd ODATANO
98
+ npm ci
99
+ cp .env.example .env # Add your BLOCKFROST_KEY
100
+ cds deploy --to sqlite
101
+ npm run cds:watch
102
+ ```
103
+
104
+ See [Quick Start Guide](docs/QUICK_START.md) for detailed setup instructions.
105
+
106
+ ## Usage Examples
107
+
108
+ **Read Operations (M1):**
109
+ ```bash
110
+ # Query transaction
111
+ curl "http://localhost:4004/odata/v4/cardano-odata/Transactions('tx_hash')"
112
+
113
+ # Address with OData expand for assets
114
+ curl "http://localhost:4004/odata/v4/cardano-odata/Addresses('addr_test1...')?\$expand=assets"
115
+ ```
116
+
117
+ **Transaction Operations (M2):**
118
+ ```bash
119
+ # Build ADA transfer (returns buildId and unsigned CBOR)
120
+ curl -X POST http://localhost:4004/odata/v4/cardano-transaction/BuildSimpleAdaTransaction \
121
+ -H "Content-Type: application/json" \
122
+ -d '{"senderAddress":"addr_test1...","recipientAddress":"addr_test1...","lovelaceAmount":10000000}'
123
+
124
+ # Submit signed transaction (using buildId from build response)
125
+ curl -X POST http://localhost:4004/odata/v4/cardano-transaction/SubmitTransaction \
126
+ -H "Content-Type: application/json" \
127
+ -d '{"buildId":"uuid-from-build-response","signedTxCbor":"84a400..."}'
128
+ ```
129
+
130
+ **External Signing Operations (M3):**
131
+
132
+ ```bash
133
+ # Build transaction with external signing (returns buildId and unsigned CBOR)
134
+ curl -X POST http://localhost:4004/odata/v4/cardano-transaction/CreateSigningRequest \
135
+ -H "Content-Type: application/json" \
136
+ -d '{"buildId":"uuid-from-build-response"}'
137
+
138
+ # Submit externally signed transaction
139
+ curl -X POST http://localhost:4004/odata/v4/cardano-transaction/SubmitVerifiedTransaction \
140
+ -H "Content-Type: application/json" \
141
+ -d '{"buildId":"uuid-from-build-response","signedTxCbor":"84a400..."}'
142
+ ```
143
+
144
+ See [User Guide](docs/guides/USER_GUIDE.md) for complete API reference.
145
+
146
+ ## Testing
147
+
148
+ ```bash
149
+ npm test # Run all 932 tests
150
+ npm run test:coverage # With coverage report
151
+ npm run test:integration # Integration tests only
152
+ npm run test:unit # Unit tests only
153
+ ```
154
+
155
+ See [Test Documentation](test/README.md) for details.
156
+
157
+ ## Documentation
158
+
159
+ | Guide | Description |
160
+ |-------|-------------|
161
+ | [Quick Start](docs/QUICK_START.md) | Get running in 5 minutes |
162
+ | [User Guide](docs/guides/USER_GUIDE.md) | API usage, entities, and examples |
163
+ | [Developer Guide](docs/guides/DEVELOPER_GUIDE.md) | Architecture and development |
164
+ | [Transaction Workflow](docs/guides/TRANSACTION_WORKFLOW.md) | Build → Sign → Submit flow (M2) |
165
+ | [Docker Deployment](docs/guides/DOCKER_DEPLOYMENT.md) | Container deployment |
166
+ | [Data Model](docs/concepts%20&%20architecture/MM_DATAMODEL.md) | Entity relationships |
167
+ | [Error Handling](docs/concepts%20&%20architecture/ERROR_HANDLING.md) | Error codes and handling |
168
+ | [Test Documentation](test/README.md) | Test suite overview (932 tests) |
169
+
170
+ **Postman Collections:**
171
+ - [M1 - Read Operations](scripts/ODATANO%20M1%20-%20Full%20Service%20Catalog.postman_collection.json)
172
+ - [M2 - Transaction Operations](scripts/ODATANO%20M2%20-%20Full%20Service%20Catalog.postman_collection.json)
173
+
174
+ ## API Overview
175
+
176
+ ### Read Service (`/odata/v4/cardano-odata`) - M1
177
+
178
+ **17 Entities:** NetworkInformation, Blocks, Epochs, Transactions, TransactionInputs, TransactionOutputs, TransactionInputAssets, TransactionOutputAssets, TransactionMetadata, Addresses, AddressAssets, AddressUTxOs, UTxOAssets, Pools, Accounts, Dreps
179
+
180
+ **11 Actions:** GetNetworkInformation, GetBlockByHash, GetEpochByNumber, GetTransactionByHash, GetMetadataByTxHash, GetAddressByBech32, GetUTxOsByAddress, GetAssetsByAddress, GetPoolById, GetAccountByStakeAddress, GetDrepById
181
+
182
+ ### Transaction Service (`/odata/v4/cardano-transaction`) - M2
183
+
184
+ **7 Entities:** TransactionBuilds, TransactionBuildInputs, TransactionBuildOutputs, TransactionBuildInputAssets, TransactionBuildOutputAssets, TransactionSubmissions, TransactionSubmissionErrors
185
+
186
+ **6 Actions:** BuildSimpleAdaTransaction, BuildTransactionWithMetadata, BuildMultiAssetTransaction, BuildMintTransaction, SubmitTransaction, SubmitSignedTransaction
187
+
188
+ ### External Signing & Plutus Smart Contracts (`/odata/v4/cardano-transaction`) - M3
189
+
190
+ **4 Entities:** SigningRequests, SignatureVerifications, AddressTransactionBuilds, AddressSigningRequests
191
+
192
+ **8 Actions:** CreateSigningRequest, GetSigningRequest, VerifySignature, SubmitVerifiedTransaction, GetSigningRequestsByAddress, GetTransactionBuildsByAddress, BuildPlutusSpendTransaction, SetCollateral
193
+
194
+ See [User Guide](docs/guides/USER_GUIDE.md) for complete API reference with parameters.
195
+
196
+ ## npm Package
197
+
198
+ Published as [`@odatano/core`](https://www.npmjs.com/package/@odatano/core) on npm. See the [Developer Guide](docs/guides/DEVELOPER_GUIDE.md#plugin-architecture) for detailed plugin architecture documentation.
199
+
200
+ ## Technology Stack
201
+
202
+ SAP CAP 9.x | TypeScript 5.9 | Node.js 20.x/22.x | SQLite | Jest | Blockfrost | Koios | Ogmios | CSL | Buildooor | Docker
203
+
204
+ ## License
205
+
206
+ Apache License 2.0 - see [LICENSE](LICENSE)
207
+
208
+ ## Support
209
+
210
+ - **Issues**: [GitHub Issues](https://github.com/ODATANO/ODATANO/issues)
211
+ - **Documentation**: [docs/](docs/)
212
+ - **Project Lead**: Max Weber (max@maxalexweber.de)
package/cds-plugin.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ // CAP Plugin entry point for @odatano/core
4
+ // This file is loaded automatically by CAP during startup
5
+ require('./src/plugin');
@@ -0,0 +1,196 @@
1
+ {
2
+ "lovelacePerUTxOWord": 34482,
3
+ "executionPrices": {
4
+ "prSteps":
5
+ {
6
+ "numerator" : 721,
7
+ "denominator" : 10000000
8
+ },
9
+ "prMem":
10
+ {
11
+ "numerator" : 577,
12
+ "denominator" : 10000
13
+ }
14
+ },
15
+ "maxTxExUnits": {
16
+ "exUnitsMem": 10000000,
17
+ "exUnitsSteps": 10000000000
18
+ },
19
+ "maxBlockExUnits": {
20
+ "exUnitsMem": 50000000,
21
+ "exUnitsSteps": 40000000000
22
+ },
23
+ "maxValueSize": 5000,
24
+ "collateralPercentage": 150,
25
+ "maxCollateralInputs": 3,
26
+ "costModels": {
27
+ "PlutusV1": {
28
+ "sha2_256-memory-arguments": 4,
29
+ "equalsString-cpu-arguments-constant": 1000,
30
+ "cekDelayCost-exBudgetMemory": 100,
31
+ "lessThanEqualsByteString-cpu-arguments-intercept": 103599,
32
+ "divideInteger-memory-arguments-minimum": 1,
33
+ "appendByteString-cpu-arguments-slope": 621,
34
+ "blake2b-cpu-arguments-slope": 29175,
35
+ "iData-cpu-arguments": 150000,
36
+ "encodeUtf8-cpu-arguments-slope": 1000,
37
+ "unBData-cpu-arguments": 150000,
38
+ "multiplyInteger-cpu-arguments-intercept": 61516,
39
+ "cekConstCost-exBudgetMemory": 100,
40
+ "nullList-cpu-arguments": 150000,
41
+ "equalsString-cpu-arguments-intercept": 150000,
42
+ "trace-cpu-arguments": 150000,
43
+ "mkNilData-memory-arguments": 32,
44
+ "lengthOfByteString-cpu-arguments": 150000,
45
+ "cekBuiltinCost-exBudgetCPU": 29773,
46
+ "bData-cpu-arguments": 150000,
47
+ "subtractInteger-cpu-arguments-slope": 0,
48
+ "unIData-cpu-arguments": 150000,
49
+ "consByteString-memory-arguments-intercept": 0,
50
+ "divideInteger-memory-arguments-slope": 1,
51
+ "divideInteger-cpu-arguments-model-arguments-slope": 118,
52
+ "listData-cpu-arguments": 150000,
53
+ "headList-cpu-arguments": 150000,
54
+ "chooseData-memory-arguments": 32,
55
+ "equalsInteger-cpu-arguments-intercept": 136542,
56
+ "sha3_256-cpu-arguments-slope": 82363,
57
+ "sliceByteString-cpu-arguments-slope": 5000,
58
+ "unMapData-cpu-arguments": 150000,
59
+ "lessThanInteger-cpu-arguments-intercept": 179690,
60
+ "mkCons-cpu-arguments": 150000,
61
+ "appendString-memory-arguments-intercept": 0,
62
+ "modInteger-cpu-arguments-model-arguments-slope": 118,
63
+ "ifThenElse-cpu-arguments": 1,
64
+ "mkNilPairData-cpu-arguments": 150000,
65
+ "lessThanEqualsInteger-cpu-arguments-intercept": 145276,
66
+ "addInteger-memory-arguments-slope": 1,
67
+ "chooseList-memory-arguments": 32,
68
+ "constrData-memory-arguments": 32,
69
+ "decodeUtf8-cpu-arguments-intercept": 150000,
70
+ "equalsData-memory-arguments": 1,
71
+ "subtractInteger-memory-arguments-slope": 1,
72
+ "appendByteString-memory-arguments-intercept": 0,
73
+ "lengthOfByteString-memory-arguments": 4,
74
+ "headList-memory-arguments": 32,
75
+ "listData-memory-arguments": 32,
76
+ "consByteString-cpu-arguments-intercept": 150000,
77
+ "unIData-memory-arguments": 32,
78
+ "remainderInteger-memory-arguments-minimum": 1,
79
+ "bData-memory-arguments": 32,
80
+ "lessThanByteString-cpu-arguments-slope": 248,
81
+ "encodeUtf8-memory-arguments-intercept": 0,
82
+ "cekStartupCost-exBudgetCPU": 100,
83
+ "multiplyInteger-memory-arguments-intercept": 0,
84
+ "unListData-memory-arguments": 32,
85
+ "remainderInteger-cpu-arguments-model-arguments-slope": 118,
86
+ "cekVarCost-exBudgetCPU": 29773,
87
+ "remainderInteger-memory-arguments-slope": 1,
88
+ "cekForceCost-exBudgetCPU": 29773,
89
+ "sha2_256-cpu-arguments-slope": 29175,
90
+ "equalsInteger-memory-arguments": 1,
91
+ "indexByteString-memory-arguments": 1,
92
+ "addInteger-memory-arguments-intercept": 1,
93
+ "chooseUnit-cpu-arguments": 150000,
94
+ "sndPair-cpu-arguments": 150000,
95
+ "cekLamCost-exBudgetCPU": 29773,
96
+ "fstPair-cpu-arguments": 150000,
97
+ "quotientInteger-memory-arguments-minimum": 1,
98
+ "decodeUtf8-cpu-arguments-slope": 1000,
99
+ "lessThanInteger-memory-arguments": 1,
100
+ "lessThanEqualsInteger-cpu-arguments-slope": 1366,
101
+ "fstPair-memory-arguments": 32,
102
+ "modInteger-memory-arguments-intercept": 0,
103
+ "unConstrData-cpu-arguments": 150000,
104
+ "lessThanEqualsInteger-memory-arguments": 1,
105
+ "chooseUnit-memory-arguments": 32,
106
+ "sndPair-memory-arguments": 32,
107
+ "addInteger-cpu-arguments-intercept": 197209,
108
+ "decodeUtf8-memory-arguments-slope": 8,
109
+ "equalsData-cpu-arguments-intercept": 150000,
110
+ "mapData-cpu-arguments": 150000,
111
+ "mkPairData-cpu-arguments": 150000,
112
+ "quotientInteger-cpu-arguments-constant": 148000,
113
+ "consByteString-memory-arguments-slope": 1,
114
+ "cekVarCost-exBudgetMemory": 100,
115
+ "indexByteString-cpu-arguments": 150000,
116
+ "unListData-cpu-arguments": 150000,
117
+ "equalsInteger-cpu-arguments-slope": 1326,
118
+ "cekStartupCost-exBudgetMemory": 100,
119
+ "subtractInteger-cpu-arguments-intercept": 197209,
120
+ "divideInteger-cpu-arguments-model-arguments-intercept": 425507,
121
+ "divideInteger-memory-arguments-intercept": 0,
122
+ "cekForceCost-exBudgetMemory": 100,
123
+ "blake2b-cpu-arguments-intercept": 2477736,
124
+ "remainderInteger-cpu-arguments-constant": 148000,
125
+ "tailList-cpu-arguments": 150000,
126
+ "encodeUtf8-cpu-arguments-intercept": 150000,
127
+ "equalsString-cpu-arguments-slope": 1000,
128
+ "lessThanByteString-memory-arguments": 1,
129
+ "multiplyInteger-cpu-arguments-slope": 11218,
130
+ "appendByteString-cpu-arguments-intercept": 396231,
131
+ "lessThanEqualsByteString-cpu-arguments-slope": 248,
132
+ "modInteger-memory-arguments-slope": 1,
133
+ "addInteger-cpu-arguments-slope": 0,
134
+ "equalsData-cpu-arguments-slope": 10000,
135
+ "decodeUtf8-memory-arguments-intercept": 0,
136
+ "chooseList-cpu-arguments": 150000,
137
+ "constrData-cpu-arguments": 150000,
138
+ "equalsByteString-memory-arguments": 1,
139
+ "cekApplyCost-exBudgetCPU": 29773,
140
+ "quotientInteger-memory-arguments-slope": 1,
141
+ "verifySignature-cpu-arguments-intercept": 3345831,
142
+ "unMapData-memory-arguments": 32,
143
+ "mkCons-memory-arguments": 32,
144
+ "sliceByteString-memory-arguments-slope": 1,
145
+ "sha3_256-memory-arguments": 4,
146
+ "ifThenElse-memory-arguments": 1,
147
+ "mkNilPairData-memory-arguments": 32,
148
+ "equalsByteString-cpu-arguments-slope": 247,
149
+ "appendString-cpu-arguments-intercept": 150000,
150
+ "quotientInteger-cpu-arguments-model-arguments-slope": 118,
151
+ "cekApplyCost-exBudgetMemory": 100,
152
+ "equalsString-memory-arguments": 1,
153
+ "multiplyInteger-memory-arguments-slope": 1,
154
+ "cekBuiltinCost-exBudgetMemory": 100,
155
+ "remainderInteger-memory-arguments-intercept": 0,
156
+ "sha2_256-cpu-arguments-intercept": 2477736,
157
+ "remainderInteger-cpu-arguments-model-arguments-intercept": 425507,
158
+ "lessThanEqualsByteString-memory-arguments": 1,
159
+ "tailList-memory-arguments": 32,
160
+ "mkNilData-cpu-arguments": 150000,
161
+ "chooseData-cpu-arguments": 150000,
162
+ "unBData-memory-arguments": 32,
163
+ "blake2b-memory-arguments": 4,
164
+ "iData-memory-arguments": 32,
165
+ "nullList-memory-arguments": 32,
166
+ "cekDelayCost-exBudgetCPU": 29773,
167
+ "subtractInteger-memory-arguments-intercept": 1,
168
+ "lessThanByteString-cpu-arguments-intercept": 103599,
169
+ "consByteString-cpu-arguments-slope": 1000,
170
+ "appendByteString-memory-arguments-slope": 1,
171
+ "trace-memory-arguments": 32,
172
+ "divideInteger-cpu-arguments-constant": 148000,
173
+ "cekConstCost-exBudgetCPU": 29773,
174
+ "encodeUtf8-memory-arguments-slope": 8,
175
+ "quotientInteger-cpu-arguments-model-arguments-intercept": 425507,
176
+ "mapData-memory-arguments": 32,
177
+ "appendString-cpu-arguments-slope": 1000,
178
+ "modInteger-cpu-arguments-constant": 148000,
179
+ "verifySignature-cpu-arguments-slope": 1,
180
+ "unConstrData-memory-arguments": 32,
181
+ "quotientInteger-memory-arguments-intercept": 0,
182
+ "equalsByteString-cpu-arguments-constant": 150000,
183
+ "sliceByteString-memory-arguments-intercept": 0,
184
+ "mkPairData-memory-arguments": 32,
185
+ "equalsByteString-cpu-arguments-intercept": 112536,
186
+ "appendString-memory-arguments-slope": 1,
187
+ "lessThanInteger-cpu-arguments-slope": 497,
188
+ "modInteger-cpu-arguments-model-arguments-intercept": 425507,
189
+ "modInteger-memory-arguments-minimum": 1,
190
+ "sha3_256-cpu-arguments-intercept": 0,
191
+ "verifySignature-memory-arguments": 1,
192
+ "cekLamCost-exBudgetMemory": 100,
193
+ "sliceByteString-cpu-arguments-intercept": 150000
194
+ }
195
+ }
196
+ }