diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..3c6ddee --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,43 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - run: yarn ci + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: https://registry.npmjs.org/ + - run: yarn ci + - run: | + if [[ "${{ github.event.head_commit.message }}" =~ ^(docs:|chore:) ]]; then + echo "Skipping npm publish due to commit message." + else + yarn js:publish-nodejs && yarn js:publish-browser + fi + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 8885e2f..a506288 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -70,7 +70,7 @@ jobs: if [[ "${{ github.event.head_commit.message }}" =~ ^(docs:|chore:) ]]; then echo "Skipping npm publish due to commit message." else - cargo publish --token ${PUBLISH_KEY} + cd rust && cargo publish --token ${PUBLISH_KEY} fi env: diff --git a/.gitignore b/.gitignore index 4c22d87..64c8782 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ */target +*/**/target /node_modules \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 0ee0666..5c64302 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,5 @@ { - "rust-analyzer.linkedProjects": ["./Cargo.toml"] + "rust-analyzer.linkedProjects": [ + "./rust/Cargo.toml" + ] } diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/package.json b/package.json index e42a7f6..7da8465 100644 --- a/package.json +++ b/package.json @@ -3,19 +3,19 @@ "version": "0.2.4", "description": "(De)serialization functions for the Cardano blockchain along with related utility functions", "scripts": { - "rust:build-nodejs": "(rimraf ./rust/pkg && cd rust; wasm-pack build --target=nodejs; cd ..; npm run js:ts-json-gen; cd rust; wasm-pack pack) && npm run js:flowgen", - "rust:build-browser": "(rimraf ./rust/pkg && cd rust; wasm-pack build --target=browser; cd ..; npm run js:ts-json-gen; cd rust; wasm-pack pack) && npm run js:flowgen", - "rust:build-web": "(rimraf ./rust/pkg && cd rust; wasm-pack build --target=web; cd ..; npm run js:ts-json-gen; cd rust; wasm-pack pack) && npm run js:flowgen", - "rust:build-asm": "(rimraf ./rust/pkg && cd rust; wasm-pack build --target=browser; cd ..; npm run js:ts-json-gen; cd rust; wasm-pack pack) && npm run asm:build && npm run js:flowgen", + "rust:build-nodejs": "(rimraf ./rust/pkg && cd rust; wasm-pack build --target=nodejs; cd ..; yarn js:ts-json-gen; cd rust; wasm-pack pack) && yarn js:flowgen", + "rust:build-browser": "(rimraf ./rust/pkg && cd rust; wasm-pack build --target=browser; cd ..; yarn js:ts-json-gen; cd rust; wasm-pack pack) && yarn js:flowgen", + "rust:build-web": "(rimraf ./rust/pkg && cd rust; wasm-pack build --target=web; cd ..; yarn js:ts-json-gen; cd rust; wasm-pack pack) && yarn js:flowgen", + "rust:build-asm": "(rimraf ./rust/pkg && cd rust; wasm-pack build --target=browser; cd ..; yarn js:ts-json-gen; cd rust; wasm-pack pack) && yarn asm:build && yarn js:flowgen", "rust:publish": "cd rust && cargo publish && cd ../", "asm:build": "./binaryen/bin/wasm2js ./rust/pkg/sidan_csl_rs_bg.wasm --output ./rust/pkg/sidan_csl_rs.asm.js && node ./scripts/wasm-to-asm && node ./scripts/fix-buffer-ref.js", "rust:check-warnings": "(cd rust; RUSTFLAGS=\"-D warnings\" cargo +stable build)", "rust:test": "(cd rust; cargo test)", "js:flowgen": "flowgen ./rust/pkg/sidan_csl_rs.d.ts -o ./rust/pkg/sidan_csl_rs.js.flow --add-flow-header", - "js:prepublish": "npm run rust:test && rimraf ./publish && cp -r ./rust/pkg ./publish && cp README.md publish/ && cp LICENSE publish/", - "js:publish-nodejs:prod": "npm run rust:build-nodejs && npm run js:prepublish && node ./scripts/publish-helper -nodejs && cd publish && npm publish --access public", - "js:publish-browser:prod": "npm run rust:build-browser && npm run js:prepublish && node ./scripts/publish-helper -browser && cd publish && npm publish --access public", - "js:publish-asm:prod": "npm run rust:build-asm && npm run js:prepublish && node ./scripts/publish-helper -asmjs && cd publish && npm publish --access public", + "js:prepublish": "yarn rust:test && rimraf ./publish && cp -r ./rust/pkg ./publish && cp README.md publish/ && cp LICENSE publish/", + "js:publish-nodejs": "yarn rust:build-nodejs && yarn js:prepublish && node ./scripts/publish-helper -nodejs && cd publish && npm publish --access public", + "js:publish-browser": "yarn rust:build-browser && yarn js:prepublish && node ./scripts/publish-helper -browser && cd publish && npm publish --access public", + "js:publish-asm": "yarn rust:build-asm && yarn js:prepublish && node ./scripts/publish-helper -asmjs && cd publish && npm publish --access public", "js:ts-json-gen": "cd rust/json-gen && cargo +stable run && cd ../.. && node ./scripts/run-json2ts.js && node ./scripts/json-ts-types.js", "postinstall": "git submodule update --init --recursive && cd binaryen; cmake . && make" }, @@ -25,7 +25,7 @@ } }, "author": "SIDAN Lab", - "license": "MIT", + "license": "Apache-2.0", "repository": { "type": "git", "url": "git+https://github.com/sidan-lab/sidan-csl-rs.git" diff --git a/rust/json-gen/Cargo.lock b/rust/json-gen/Cargo.lock new file mode 100644 index 0000000..558df8d --- /dev/null +++ b/rust/json-gen/Cargo.lock @@ -0,0 +1,612 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "bech32" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" + +[[package]] +name = "cardano-serialization-lib" +version = "11.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3fab2c10aa73dae6ea90ed459ef07ed7acb09270ea90d9a37fa00420b9c25c" +dependencies = [ + "bech32", + "cbor_event", + "cfg-if", + "clear_on_drop", + "cryptoxide", + "digest", + "ed25519-bip32", + "getrandom", + "hex", + "itertools", + "js-sys", + "linked-hash-map", + "noop_proc_macro", + "num-bigint", + "num-integer", + "rand", + "rand_os", + "schemars", + "serde", + "serde-wasm-bindgen", + "serde_json", + "sha2", + "wasm-bindgen", +] + +[[package]] +name = "cardano-serialization-lib-json-schema-gen" +version = "0.0.1" +dependencies = [ + "cardano-serialization-lib", + "schemars", + "serde_json", +] + +[[package]] +name = "cbor_event" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b6cda8a789815488ee290d106bc97dba47785dae73d63576fc42c126912a451" + +[[package]] +name = "cc" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clear_on_drop" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9cc5db465b294c3fa986d5bbb0f3017cd850bff6dd6c52f9ccff8b4d21b7b08" +dependencies = [ + "cc", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags", +] + +[[package]] +name = "cpufeatures" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +dependencies = [ + "libc", +] + +[[package]] +name = "cryptoxide" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "129eabb7b0b78644a3a7e7cf220714aba47463bb281f69fa7a71ca5d12564cca" + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "dyn-clone" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" + +[[package]] +name = "ed25519-bip32" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb588f93c0d91b2f668849fd6d030cddb0b2e31f105963be189da5acdf492a21" +dependencies = [ + "cryptoxide", +] + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "generic-array" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" + +[[package]] +name = "js-sys" +version = "0.3.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.112" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" + +[[package]] +name = "linked-hash-map" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" + +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "noop_proc_macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "proc-macro2" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +dependencies = [ + "libc", + "rand_chacha", + "rand_core 0.6.3", + "rand_hc", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_hc" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +dependencies = [ + "rand_core 0.6.3", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.4.2", + "rdrand", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "ryu" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" + +[[package]] +name = "schemars" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6b5a3c80cea1ab61f4260238409510e814e38b4b563c06044edf91e7dc070e3" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ae4dce13e8614c46ac3c38ef1c0d668b101df6ac39817aebdaa26642ddae9b" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 1.0.85", +] + +[[package]] +name = "serde" +version = "1.0.133" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.133" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.85", +] + +[[package]] +name = "serde_derive_internals" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.85", +] + +[[package]] +name = "serde_json" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c059c05b48c5c0067d4b4b2b4f0732dd65feb52daf7e0ea09cd87e7dadc1af79" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer", + "cfg-if", + "cpufeatures", + "digest", + "opaque-debug", +] + +[[package]] +name = "syn" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "syn" +version = "2.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "unicode-ident" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" + +[[package]] +name = "unicode-xid" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.23", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.23", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/rust/json-gen/Cargo.toml b/rust/json-gen/Cargo.toml new file mode 100644 index 0000000..915045f --- /dev/null +++ b/rust/json-gen/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "cardano-serialization-lib-json-schema-gen" +version = "0.0.1" +edition = "2018" +authors = ["EMURGO"] +license = "MIT" + + +[dependencies] +serde_json = "1.0.57" +schemars = "0.8.8" +#serde = { version = "1.0", features = ["derive"] } +cardano-serialization-lib = "11.5.0" diff --git a/rust/json-gen/output/json-types.d.ts b/rust/json-gen/output/json-types.d.ts new file mode 100644 index 0000000..b59cf58 --- /dev/null +++ b/rust/json-gen/output/json-types.d.ts @@ -0,0 +1,467 @@ +export type AddressJSON = string; +export type AssetNameJSON = string; +export type AssetNamesJSON = string[]; +export interface AssetsJSON { + [k: string]: string; +} +export interface AuxiliaryDataJSON { + metadata?: { + [k: string]: string; + } | null; + native_scripts?: NativeScriptsJSON | null; + plutus_scripts?: PlutusScriptsJSON | null; + prefer_alonzo_format: boolean; +} +export type AuxiliaryDataHashJSON = string; +export interface AuxiliaryDataSetJSON { + [k: string]: AuxiliaryDataJSON; +} +export type BigIntJSON = string; +export type BigNumJSON = string; +export interface BlockJSON { + auxiliary_data_set: { + [k: string]: AuxiliaryDataJSON; + }; + header: HeaderJSON; + invalid_transactions: number[]; + transaction_bodies: TransactionBodiesJSON; + transaction_witness_sets: TransactionWitnessSetsJSON; +} +export type BlockHashJSON = string; +export interface BootstrapWitnessJSON { + attributes: number[]; + chain_code: number[]; + signature: string; + vkey: VkeyJSON; +} +export type BootstrapWitnessesJSON = BootstrapWitnessJSON[]; +export type CertificateJSON = CertificateEnumJSON; +export type CertificateEnumJSON = + | { + StakeRegistrationJSON: StakeRegistration; + } + | { + StakeDeregistrationJSON: StakeDeregistration; + } + | { + StakeDelegationJSON: StakeDelegation; + } + | { + PoolRegistrationJSON: PoolRegistration; + } + | { + PoolRetirementJSON: PoolRetirement; + } + | { + GenesisKeyDelegationJSON: GenesisKeyDelegation; + } + | { + MoveInstantaneousRewardsCertJSON: MoveInstantaneousRewardsCert; + }; +export type CertificatesJSON = CertificateJSON[]; +export type CostModelJSON = string[]; +export interface CostmdlsJSON { + [k: string]: CostModelJSON; +} +export type DNSRecordAorAAAAJSON = string; +export type DNSRecordSRVJSON = string; +export type DataHashJSON = string; +export type DataOptionJSON = + | { + DataHashJSON: string; + } + | { + Data: string; + }; +export type Ed25519KeyHashJSON = string; +export type Ed25519KeyHashesJSON = string[]; +export type Ed25519SignatureJSON = string; +export interface ExUnitPricesJSON { + mem_price: UnitIntervalJSON; + step_price: UnitIntervalJSON; +} +export interface ExUnitsJSON { + mem: string; + steps: string; +} +export interface GeneralTransactionMetadataJSON { + [k: string]: string; +} +export type GenesisDelegateHashJSON = string; +export type GenesisHashJSON = string; +export type GenesisHashesJSON = string[]; +export interface GenesisKeyDelegationJSON { + genesis_delegate_hash: string; + genesishash: string; + vrf_keyhash: string; +} +export interface HeaderJSON { + body_signature: string; + header_body: HeaderBodyJSON; +} +export interface HeaderBodyJSON { + block_body_hash: string; + block_body_size: number; + block_number: number; + issuer_vkey: VkeyJSON; + leader_cert: HeaderLeaderCertEnumJSON; + operational_cert: OperationalCertJSON; + prev_hash?: string | null; + protocol_version: ProtocolVersionJSON; + slot: string; + vrf_vkey: string; +} +export type HeaderLeaderCertEnumJSON = + | { + NonceAndLeader: [VRFCertJSON, VRFCert]; + } + | { + VrfResult: VRFCertJSON; + }; +export type IntJSON = string; +export type Ipv4JSON = [number, number, number, number]; +export type Ipv6JSON = [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number +]; +export type KESVKeyJSON = string; +export type LanguageJSON = LanguageKindJSON; +export type LanguageKindJSON = "PlutusV1" | "PlutusV2"; +export type LanguagesJSON = LanguageJSON[]; +export type MIREnumJSON = + | { + ToOtherPot: string; + } + | { + ToStakeCredentials: { + [k: string]: ProtocolParamUpdateJSON; + }; + }; +export type MIRPotJSON = "Reserves" | "Treasury"; +export interface MIRToStakeCredentialsJSON { + [k: string]: ProtocolParamUpdateJSON; +} +export type MintJSON = [string, MintAssetsJSON][]; +export interface MintAssetsJSON { + [k: string]: string; +} +export interface MoveInstantaneousRewardJSON { + pot: MIRPotJSON; + variant: MIREnumJSON; +} +export interface MoveInstantaneousRewardsCertJSON { + move_instantaneous_reward: MoveInstantaneousRewardJSON; +} +export interface MultiAssetJSON { + [k: string]: AssetsJSON; +} +export interface MultiHostNameJSON { + dns_name: DNSRecordSRVJSON; +} +export type NativeScriptJSON = NativeScript1JSON; +export type NativeScript1JSON = + | { + ScriptPubkeyJSON: ScriptPubkey; + } + | { + ScriptAllJSON: ScriptAll; + } + | { + ScriptAnyJSON: ScriptAny; + } + | { + ScriptNOfKJSON: ScriptNOfK; + } + | { + TimelockStartJSON: TimelockStart; + } + | { + TimelockExpiryJSON: TimelockExpiry; + }; +export type NativeScriptsJSON = NativeScriptJSON[]; +export type NetworkIdJSON = NetworkIdKindJSON; +export type NetworkIdKindJSON = "Testnet" | "Mainnet"; +export interface NonceJSON { + hash?: + | [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number + ] + | null; +} +export interface OperationalCertJSON { + hot_vkey: string; + kes_period: number; + sequence_number: number; + sigma: string; +} +export type PlutusScriptJSON = string; +export type PlutusScriptsJSON = string[]; +export interface PoolMetadataJSON { + pool_metadata_hash: string; + url: URLJSON; +} +export type PoolMetadataHashJSON = string; +export interface PoolParamsJSON { + cost: string; + margin: UnitIntervalJSON; + operator: string; + pledge: string; + pool_metadata?: PoolMetadataJSON | null; + pool_owners: Ed25519KeyHashesJSON; + relays: RelaysJSON; + reward_account: string; + vrf_keyhash: string; +} +export interface PoolRegistrationJSON { + pool_params: PoolParamsJSON; +} +export interface PoolRetirementJSON { + epoch: number; + pool_keyhash: string; +} +export interface ProposedProtocolParameterUpdatesJSON { + [k: string]: ProtocolParamUpdateJSON; +} +export interface ProtocolParamUpdateJSON { + ada_per_utxo_byte?: string | null; + collateral_percentage?: number | null; + cost_models?: CostmdlsJSON | null; + d?: UnitIntervalJSON | null; + execution_costs?: ExUnitPricesJSON | null; + expansion_rate?: UnitIntervalJSON | null; + extra_entropy?: NonceJSON | null; + key_deposit?: string | null; + max_block_body_size?: number | null; + max_block_ex_units?: ExUnitsJSON | null; + max_block_header_size?: number | null; + max_collateral_inputs?: number | null; + max_epoch?: number | null; + max_tx_ex_units?: ExUnitsJSON | null; + max_tx_size?: number | null; + max_value_size?: number | null; + min_pool_cost?: string | null; + minfee_a?: string | null; + minfee_b?: string | null; + n_opt?: number | null; + pool_deposit?: string | null; + pool_pledge_influence?: UnitIntervalJSON | null; + protocol_version?: ProtocolVersionJSON | null; + treasury_growth_rate?: UnitIntervalJSON | null; +} +export interface ProtocolVersionJSON { + major: number; + minor: number; +} +export type PublicKeyJSON = string; +export interface RedeemerJSON { + data: string; + ex_units: ExUnitsJSON; + index: string; + tag: RedeemerTagJSON; +} +export type RedeemerTagJSON = RedeemerTagKindJSON; +export type RedeemerTagKindJSON = "Spend" | "MintJSON" | "Cert" | "Reward"; +export type RedeemersJSON = RedeemerJSON[]; +export type RelayJSON = RelayEnumJSON; +export type RelayEnumJSON = + | { + SingleHostAddrJSON: SingleHostAddr; + } + | { + SingleHostNameJSON: SingleHostName; + } + | { + MultiHostNameJSON: MultiHostName; + }; +export type RelaysJSON = RelayJSON[]; +export type RewardAddressJSON = string; +export type RewardAddressesJSON = string[]; +export interface ScriptAllJSON { + native_scripts: NativeScriptsJSON; +} +export interface ScriptAnyJSON { + native_scripts: NativeScriptsJSON; +} +export type ScriptDataHashJSON = string; +export type ScriptHashJSON = string; +export type ScriptHashesJSON = string[]; +export interface ScriptNOfKJSON { + n: number; + native_scripts: NativeScriptsJSON; +} +export interface ScriptPubkeyJSON { + addr_keyhash: string; +} +export type ScriptRefJSON = ScriptRefEnumJSON; +export type ScriptRefEnumJSON = + | { + NativeScriptJSON: NativeScript; + } + | { + PlutusScriptJSON: string; + }; +export interface SingleHostAddrJSON { + ipv4?: Ipv4JSON | null; + ipv6?: Ipv6JSON | null; + port?: number | null; +} +export interface SingleHostNameJSON { + dns_name: DNSRecordAorAAAAJSON; + port?: number | null; +} +export type StakeCredTypeJSON = + | { + Key: string; + } + | { + Script: string; + }; +export type StakeCredentialJSON = StakeCredTypeJSON; +export type StakeCredentialsJSON = StakeCredTypeJSON[]; +export interface StakeDelegationJSON { + pool_keyhash: string; + stake_credential: StakeCredTypeJSON; +} +export interface StakeDeregistrationJSON { + stake_credential: StakeCredTypeJSON; +} +export interface StakeRegistrationJSON { + stake_credential: StakeCredTypeJSON; +} +export interface TimelockExpiryJSON { + slot: string; +} +export interface TimelockStartJSON { + slot: string; +} +export interface TransactionJSON { + auxiliary_data?: AuxiliaryDataJSON | null; + body: TransactionBodyJSON; + is_valid: boolean; + witness_set: TransactionWitnessSetJSON; +} +export type TransactionBodiesJSON = TransactionBodyJSON[]; +export interface TransactionBodyJSON { + auxiliary_data_hash?: string | null; + certs?: CertificatesJSON | null; + collateral?: TransactionInputsJSON | null; + collateral_return?: TransactionOutputJSON | null; + fee: string; + inputs: TransactionInputsJSON; + mint?: MintJSON | null; + network_id?: NetworkIdJSON | null; + outputs: TransactionOutputsJSON; + reference_inputs?: TransactionInputsJSON | null; + required_signers?: Ed25519KeyHashesJSON | null; + script_data_hash?: string | null; + total_collateral?: string | null; + ttl?: string | null; + update?: UpdateJSON | null; + validity_start_interval?: string | null; + withdrawals?: { + [k: string]: ProtocolParamUpdateJSON; + } | null; +} +export type TransactionHashJSON = string; +export interface TransactionInputJSON { + index: number; + transaction_id: string; +} +export type TransactionInputsJSON = TransactionInputJSON[]; +export type TransactionMetadatumJSON = string; +export interface TransactionOutputJSON { + address: string; + amount: ValueJSON; + plutus_data?: DataOptionJSON | null; + script_ref?: ScriptRefJSON | null; +} +export type TransactionOutputsJSON = TransactionOutputJSON[]; +export interface TransactionUnspentOutputJSON { + input: TransactionInputJSON; + output: TransactionOutputJSON; +} +export type TransactionUnspentOutputsJSON = TransactionUnspentOutputJSON[]; +export interface TransactionWitnessSetJSON { + bootstraps?: BootstrapWitnessesJSON | null; + native_scripts?: NativeScriptsJSON | null; + plutus_data?: PlutusList | null; + plutus_scripts?: PlutusScriptsJSON | null; + redeemers?: RedeemersJSON | null; + vkeys?: VkeywitnessesJSON | null; +} +export type TransactionWitnessSetsJSON = TransactionWitnessSetJSON[]; +export type URLJSON = string; +export interface UnitIntervalJSON { + denominator: string; + numerator: string; +} +export interface UpdateJSON { + epoch: number; + proposed_protocol_parameter_updates: { + [k: string]: ProtocolParamUpdateJSON; + }; +} +export interface VRFCertJSON { + output: number[]; + proof: number[]; +} +export type VRFKeyHashJSON = string; +export type VRFVKeyJSON = string; +export interface ValueJSON { + coin: string; + multiasset?: MultiAssetJSON | null; +} +export type VkeyJSON = string; +export interface VkeywitnessJSON { + signature: string; + vkey: VkeyJSON; +} +export type VkeywitnessesJSON = VkeywitnessJSON[]; +export interface WithdrawalsJSON { + [k: string]: ProtocolParamUpdateJSON; +} diff --git a/rust/json-gen/schemas/Address.json b/rust/json-gen/schemas/Address.json new file mode 100644 index 0000000..00926d8 --- /dev/null +++ b/rust/json-gen/schemas/Address.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Address", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/AssetName.json b/rust/json-gen/schemas/AssetName.json new file mode 100644 index 0000000..9f89f00 --- /dev/null +++ b/rust/json-gen/schemas/AssetName.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AssetName", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/AssetNames.json b/rust/json-gen/schemas/AssetNames.json new file mode 100644 index 0000000..2df3fe4 --- /dev/null +++ b/rust/json-gen/schemas/AssetNames.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AssetNames", + "type": "array", + "items": { + "type": "string" + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Assets.json b/rust/json-gen/schemas/Assets.json new file mode 100644 index 0000000..5d59043 --- /dev/null +++ b/rust/json-gen/schemas/Assets.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Assets", + "type": "object", + "additionalProperties": { + "type": "string" + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/AuxiliaryData.json b/rust/json-gen/schemas/AuxiliaryData.json new file mode 100644 index 0000000..bba35ac --- /dev/null +++ b/rust/json-gen/schemas/AuxiliaryData.json @@ -0,0 +1,207 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AuxiliaryData", + "type": "object", + "required": [ + "prefer_alonzo_format" + ], + "properties": { + "metadata": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "native_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/NativeScripts" + }, + { + "type": "null" + } + ] + }, + "plutus_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/PlutusScripts" + }, + { + "type": "null" + } + ] + }, + "prefer_alonzo_format": { + "type": "boolean" + } + }, + "definitions": { + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "PlutusScripts": { + "type": "array", + "items": { + "type": "string" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/AuxiliaryDataHash.json b/rust/json-gen/schemas/AuxiliaryDataHash.json new file mode 100644 index 0000000..940377c --- /dev/null +++ b/rust/json-gen/schemas/AuxiliaryDataHash.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AuxiliaryDataHash", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/AuxiliaryDataSet.json b/rust/json-gen/schemas/AuxiliaryDataSet.json new file mode 100644 index 0000000..f5d533e --- /dev/null +++ b/rust/json-gen/schemas/AuxiliaryDataSet.json @@ -0,0 +1,213 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AuxiliaryDataSet", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/AuxiliaryData" + }, + "definitions": { + "AuxiliaryData": { + "type": "object", + "required": [ + "prefer_alonzo_format" + ], + "properties": { + "metadata": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "native_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/NativeScripts" + }, + { + "type": "null" + } + ] + }, + "plutus_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/PlutusScripts" + }, + { + "type": "null" + } + ] + }, + "prefer_alonzo_format": { + "type": "boolean" + } + } + }, + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "PlutusScripts": { + "type": "array", + "items": { + "type": "string" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/BigInt.json b/rust/json-gen/schemas/BigInt.json new file mode 100644 index 0000000..8651f4d --- /dev/null +++ b/rust/json-gen/schemas/BigInt.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "BigInt", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/BigNum.json b/rust/json-gen/schemas/BigNum.json new file mode 100644 index 0000000..8d320fd --- /dev/null +++ b/rust/json-gen/schemas/BigNum.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "BigNum", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Block.json b/rust/json-gen/schemas/Block.json new file mode 100644 index 0000000..5713c5f --- /dev/null +++ b/rust/json-gen/schemas/Block.json @@ -0,0 +1,1733 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Block", + "type": "object", + "required": [ + "auxiliary_data_set", + "header", + "invalid_transactions", + "transaction_bodies", + "transaction_witness_sets" + ], + "properties": { + "auxiliary_data_set": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/AuxiliaryData" + } + }, + "header": { + "$ref": "#/definitions/Header" + }, + "invalid_transactions": { + "type": "array", + "items": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "transaction_bodies": { + "$ref": "#/definitions/TransactionBodies" + }, + "transaction_witness_sets": { + "$ref": "#/definitions/TransactionWitnessSets" + } + }, + "definitions": { + "Assets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "AuxiliaryData": { + "type": "object", + "required": [ + "prefer_alonzo_format" + ], + "properties": { + "metadata": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "native_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/NativeScripts" + }, + { + "type": "null" + } + ] + }, + "plutus_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/PlutusScripts" + }, + { + "type": "null" + } + ] + }, + "prefer_alonzo_format": { + "type": "boolean" + } + } + }, + "BootstrapWitness": { + "type": "object", + "required": [ + "attributes", + "chain_code", + "signature", + "vkey" + ], + "properties": { + "attributes": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "chain_code": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "signature": { + "type": "string" + }, + "vkey": { + "$ref": "#/definitions/Vkey" + } + } + }, + "BootstrapWitnesses": { + "type": "array", + "items": { + "$ref": "#/definitions/BootstrapWitness" + } + }, + "Certificate": { + "$ref": "#/definitions/CertificateEnum" + }, + "CertificateEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "StakeRegistration" + ], + "properties": { + "StakeRegistration": { + "$ref": "#/definitions/StakeRegistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "StakeDeregistration" + ], + "properties": { + "StakeDeregistration": { + "$ref": "#/definitions/StakeDeregistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "StakeDelegation" + ], + "properties": { + "StakeDelegation": { + "$ref": "#/definitions/StakeDelegation" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PoolRegistration" + ], + "properties": { + "PoolRegistration": { + "$ref": "#/definitions/PoolRegistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PoolRetirement" + ], + "properties": { + "PoolRetirement": { + "$ref": "#/definitions/PoolRetirement" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "GenesisKeyDelegation" + ], + "properties": { + "GenesisKeyDelegation": { + "$ref": "#/definitions/GenesisKeyDelegation" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MoveInstantaneousRewardsCert" + ], + "properties": { + "MoveInstantaneousRewardsCert": { + "$ref": "#/definitions/MoveInstantaneousRewardsCert" + } + }, + "additionalProperties": false + } + ] + }, + "Certificates": { + "type": "array", + "items": { + "$ref": "#/definitions/Certificate" + } + }, + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + }, + "Costmdls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + } + }, + "DNSRecordAorAAAA": { + "type": "string" + }, + "DNSRecordSRV": { + "type": "string" + }, + "DataOption": { + "oneOf": [ + { + "type": "object", + "required": [ + "DataHash" + ], + "properties": { + "DataHash": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Data" + ], + "properties": { + "Data": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "Ed25519KeyHashes": { + "type": "array", + "items": { + "type": "string" + } + }, + "ExUnitPrices": { + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "GenesisKeyDelegation": { + "type": "object", + "required": [ + "genesis_delegate_hash", + "genesishash", + "vrf_keyhash" + ], + "properties": { + "genesis_delegate_hash": { + "type": "string" + }, + "genesishash": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + } + }, + "Header": { + "type": "object", + "required": [ + "body_signature", + "header_body" + ], + "properties": { + "body_signature": { + "type": "string" + }, + "header_body": { + "$ref": "#/definitions/HeaderBody" + } + } + }, + "HeaderBody": { + "type": "object", + "required": [ + "block_body_hash", + "block_body_size", + "block_number", + "issuer_vkey", + "leader_cert", + "operational_cert", + "protocol_version", + "slot", + "vrf_vkey" + ], + "properties": { + "block_body_hash": { + "type": "string" + }, + "block_body_size": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "block_number": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "issuer_vkey": { + "$ref": "#/definitions/Vkey" + }, + "leader_cert": { + "$ref": "#/definitions/HeaderLeaderCertEnum" + }, + "operational_cert": { + "$ref": "#/definitions/OperationalCert" + }, + "prev_hash": { + "type": [ + "string", + "null" + ] + }, + "protocol_version": { + "$ref": "#/definitions/ProtocolVersion" + }, + "slot": { + "type": "string" + }, + "vrf_vkey": { + "type": "string" + } + } + }, + "HeaderLeaderCertEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "NonceAndLeader" + ], + "properties": { + "NonceAndLeader": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/VRFCert" + }, + { + "$ref": "#/definitions/VRFCert" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "VrfResult" + ], + "properties": { + "VrfResult": { + "$ref": "#/definitions/VRFCert" + } + }, + "additionalProperties": false + } + ] + }, + "Ipv4": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 4, + "minItems": 4 + }, + "Ipv6": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 16, + "minItems": 16 + }, + "MIREnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ToOtherPot" + ], + "properties": { + "ToOtherPot": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ToStakeCredentials" + ], + "properties": { + "ToStakeCredentials": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + }, + "additionalProperties": false + } + ] + }, + "MIRPot": { + "type": "string", + "enum": [ + "Reserves", + "Treasury" + ] + }, + "Mint": { + "type": "array", + "items": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/MintAssets" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "MintAssets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "MoveInstantaneousReward": { + "type": "object", + "required": [ + "pot", + "variant" + ], + "properties": { + "pot": { + "$ref": "#/definitions/MIRPot" + }, + "variant": { + "$ref": "#/definitions/MIREnum" + } + } + }, + "MoveInstantaneousRewardsCert": { + "type": "object", + "required": [ + "move_instantaneous_reward" + ], + "properties": { + "move_instantaneous_reward": { + "$ref": "#/definitions/MoveInstantaneousReward" + } + } + }, + "MultiAsset": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Assets" + } + }, + "MultiHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordSRV" + } + } + }, + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "NetworkId": { + "$ref": "#/definitions/NetworkIdKind" + }, + "NetworkIdKind": { + "type": "string", + "enum": [ + "Testnet", + "Mainnet" + ] + }, + "Nonce": { + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } + }, + "OperationalCert": { + "type": "object", + "required": [ + "hot_vkey", + "kes_period", + "sequence_number", + "sigma" + ], + "properties": { + "hot_vkey": { + "type": "string" + }, + "kes_period": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "sequence_number": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "sigma": { + "type": "string" + } + } + }, + "PlutusList": { + "type": "object", + "required": [ + "elems" + ], + "properties": { + "definite_encoding": { + "type": [ + "boolean", + "null" + ] + }, + "elems": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PlutusScripts": { + "type": "array", + "items": { + "type": "string" + } + }, + "PoolMetadata": { + "type": "object", + "required": [ + "pool_metadata_hash", + "url" + ], + "properties": { + "pool_metadata_hash": { + "type": "string" + }, + "url": { + "$ref": "#/definitions/URL" + } + } + }, + "PoolParams": { + "type": "object", + "required": [ + "cost", + "margin", + "operator", + "pledge", + "pool_owners", + "relays", + "reward_account", + "vrf_keyhash" + ], + "properties": { + "cost": { + "type": "string" + }, + "margin": { + "$ref": "#/definitions/UnitInterval" + }, + "operator": { + "type": "string" + }, + "pledge": { + "type": "string" + }, + "pool_metadata": { + "anyOf": [ + { + "$ref": "#/definitions/PoolMetadata" + }, + { + "type": "null" + } + ] + }, + "pool_owners": { + "$ref": "#/definitions/Ed25519KeyHashes" + }, + "relays": { + "$ref": "#/definitions/Relays" + }, + "reward_account": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + } + }, + "PoolRegistration": { + "type": "object", + "required": [ + "pool_params" + ], + "properties": { + "pool_params": { + "$ref": "#/definitions/PoolParams" + } + } + }, + "PoolRetirement": { + "type": "object", + "required": [ + "epoch", + "pool_keyhash" + ], + "properties": { + "epoch": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "pool_keyhash": { + "type": "string" + } + } + }, + "ProtocolParamUpdate": { + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "type": [ + "string", + "null" + ] + }, + "collateral_percentage": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "cost_models": { + "anyOf": [ + { + "$ref": "#/definitions/Costmdls" + }, + { + "type": "null" + } + ] + }, + "d": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "execution_costs": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnitPrices" + }, + { + "type": "null" + } + ] + }, + "expansion_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "extra_entropy": { + "anyOf": [ + { + "$ref": "#/definitions/Nonce" + }, + { + "type": "null" + } + ] + }, + "key_deposit": { + "type": [ + "string", + "null" + ] + }, + "max_block_body_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_block_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_block_header_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_collateral_inputs": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_epoch": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_tx_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_tx_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_value_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "min_pool_cost": { + "type": [ + "string", + "null" + ] + }, + "minfee_a": { + "type": [ + "string", + "null" + ] + }, + "minfee_b": { + "type": [ + "string", + "null" + ] + }, + "n_opt": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "pool_deposit": { + "type": [ + "string", + "null" + ] + }, + "pool_pledge_influence": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "protocol_version": { + "anyOf": [ + { + "$ref": "#/definitions/ProtocolVersion" + }, + { + "type": "null" + } + ] + }, + "treasury_growth_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "Redeemer": { + "type": "object", + "required": [ + "data", + "ex_units", + "index", + "tag" + ], + "properties": { + "data": { + "type": "string" + }, + "ex_units": { + "$ref": "#/definitions/ExUnits" + }, + "index": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/RedeemerTag" + } + } + }, + "RedeemerTag": { + "$ref": "#/definitions/RedeemerTagKind" + }, + "RedeemerTagKind": { + "type": "string", + "enum": [ + "Spend", + "Mint", + "Cert", + "Reward" + ] + }, + "Redeemers": { + "type": "array", + "items": { + "$ref": "#/definitions/Redeemer" + } + }, + "Relay": { + "$ref": "#/definitions/RelayEnum" + }, + "RelayEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "SingleHostAddr" + ], + "properties": { + "SingleHostAddr": { + "$ref": "#/definitions/SingleHostAddr" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "SingleHostName" + ], + "properties": { + "SingleHostName": { + "$ref": "#/definitions/SingleHostName" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MultiHostName" + ], + "properties": { + "MultiHostName": { + "$ref": "#/definitions/MultiHostName" + } + }, + "additionalProperties": false + } + ] + }, + "Relays": { + "type": "array", + "items": { + "$ref": "#/definitions/Relay" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "ScriptRef": { + "$ref": "#/definitions/ScriptRefEnum" + }, + "ScriptRefEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "NativeScript" + ], + "properties": { + "NativeScript": { + "$ref": "#/definitions/NativeScript" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PlutusScript" + ], + "properties": { + "PlutusScript": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "SingleHostAddr": { + "type": "object", + "properties": { + "ipv4": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv4" + }, + { + "type": "null" + } + ] + }, + "ipv6": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv6" + }, + { + "type": "null" + } + ] + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "SingleHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordAorAAAA" + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "StakeCredType": { + "oneOf": [ + { + "type": "object", + "required": [ + "Key" + ], + "properties": { + "Key": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Script" + ], + "properties": { + "Script": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "StakeCredential": { + "$ref": "#/definitions/StakeCredType" + }, + "StakeDelegation": { + "type": "object", + "required": [ + "pool_keyhash", + "stake_credential" + ], + "properties": { + "pool_keyhash": { + "type": "string" + }, + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "StakeDeregistration": { + "type": "object", + "required": [ + "stake_credential" + ], + "properties": { + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "StakeRegistration": { + "type": "object", + "required": [ + "stake_credential" + ], + "properties": { + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TransactionBodies": { + "type": "array", + "items": { + "$ref": "#/definitions/TransactionBody" + } + }, + "TransactionBody": { + "type": "object", + "required": [ + "fee", + "inputs", + "outputs" + ], + "properties": { + "auxiliary_data_hash": { + "type": [ + "string", + "null" + ] + }, + "certs": { + "anyOf": [ + { + "$ref": "#/definitions/Certificates" + }, + { + "type": "null" + } + ] + }, + "collateral": { + "anyOf": [ + { + "$ref": "#/definitions/TransactionInputs" + }, + { + "type": "null" + } + ] + }, + "collateral_return": { + "anyOf": [ + { + "$ref": "#/definitions/TransactionOutput" + }, + { + "type": "null" + } + ] + }, + "fee": { + "type": "string" + }, + "inputs": { + "$ref": "#/definitions/TransactionInputs" + }, + "mint": { + "anyOf": [ + { + "$ref": "#/definitions/Mint" + }, + { + "type": "null" + } + ] + }, + "network_id": { + "anyOf": [ + { + "$ref": "#/definitions/NetworkId" + }, + { + "type": "null" + } + ] + }, + "outputs": { + "$ref": "#/definitions/TransactionOutputs" + }, + "reference_inputs": { + "anyOf": [ + { + "$ref": "#/definitions/TransactionInputs" + }, + { + "type": "null" + } + ] + }, + "required_signers": { + "anyOf": [ + { + "$ref": "#/definitions/Ed25519KeyHashes" + }, + { + "type": "null" + } + ] + }, + "script_data_hash": { + "type": [ + "string", + "null" + ] + }, + "total_collateral": { + "type": [ + "string", + "null" + ] + }, + "ttl": { + "type": [ + "string", + "null" + ] + }, + "update": { + "anyOf": [ + { + "$ref": "#/definitions/Update" + }, + { + "type": "null" + } + ] + }, + "validity_start_interval": { + "type": [ + "string", + "null" + ] + }, + "withdrawals": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + } + }, + "TransactionInput": { + "type": "object", + "required": [ + "index", + "transaction_id" + ], + "properties": { + "index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "transaction_id": { + "type": "string" + } + } + }, + "TransactionInputs": { + "type": "array", + "items": { + "$ref": "#/definitions/TransactionInput" + } + }, + "TransactionOutput": { + "type": "object", + "required": [ + "address", + "amount" + ], + "properties": { + "address": { + "type": "string" + }, + "amount": { + "$ref": "#/definitions/Value" + }, + "plutus_data": { + "anyOf": [ + { + "$ref": "#/definitions/DataOption" + }, + { + "type": "null" + } + ] + }, + "script_ref": { + "anyOf": [ + { + "$ref": "#/definitions/ScriptRef" + }, + { + "type": "null" + } + ] + } + } + }, + "TransactionOutputs": { + "type": "array", + "items": { + "$ref": "#/definitions/TransactionOutput" + } + }, + "TransactionWitnessSet": { + "type": "object", + "properties": { + "bootstraps": { + "anyOf": [ + { + "$ref": "#/definitions/BootstrapWitnesses" + }, + { + "type": "null" + } + ] + }, + "native_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/NativeScripts" + }, + { + "type": "null" + } + ] + }, + "plutus_data": { + "anyOf": [ + { + "$ref": "#/definitions/PlutusList" + }, + { + "type": "null" + } + ] + }, + "plutus_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/PlutusScripts" + }, + { + "type": "null" + } + ] + }, + "redeemers": { + "anyOf": [ + { + "$ref": "#/definitions/Redeemers" + }, + { + "type": "null" + } + ] + }, + "vkeys": { + "anyOf": [ + { + "$ref": "#/definitions/Vkeywitnesses" + }, + { + "type": "null" + } + ] + } + } + }, + "TransactionWitnessSets": { + "type": "array", + "items": { + "$ref": "#/definitions/TransactionWitnessSet" + } + }, + "URL": { + "type": "string" + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + }, + "Update": { + "type": "object", + "required": [ + "epoch", + "proposed_protocol_parameter_updates" + ], + "properties": { + "epoch": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "proposed_protocol_parameter_updates": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + } + }, + "VRFCert": { + "type": "object", + "required": [ + "output", + "proof" + ], + "properties": { + "output": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "proof": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + } + } + }, + "Value": { + "type": "object", + "required": [ + "coin" + ], + "properties": { + "coin": { + "type": "string" + }, + "multiasset": { + "anyOf": [ + { + "$ref": "#/definitions/MultiAsset" + }, + { + "type": "null" + } + ] + } + } + }, + "Vkey": { + "type": "string" + }, + "Vkeywitness": { + "type": "object", + "required": [ + "signature", + "vkey" + ], + "properties": { + "signature": { + "type": "string" + }, + "vkey": { + "$ref": "#/definitions/Vkey" + } + } + }, + "Vkeywitnesses": { + "type": "array", + "items": { + "$ref": "#/definitions/Vkeywitness" + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/BlockHash.json b/rust/json-gen/schemas/BlockHash.json new file mode 100644 index 0000000..97bb997 --- /dev/null +++ b/rust/json-gen/schemas/BlockHash.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "BlockHash", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/BootstrapWitness.json b/rust/json-gen/schemas/BootstrapWitness.json new file mode 100644 index 0000000..de8c033 --- /dev/null +++ b/rust/json-gen/schemas/BootstrapWitness.json @@ -0,0 +1,40 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "BootstrapWitness", + "type": "object", + "required": [ + "attributes", + "chain_code", + "signature", + "vkey" + ], + "properties": { + "attributes": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "chain_code": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "signature": { + "type": "string" + }, + "vkey": { + "$ref": "#/definitions/Vkey" + } + }, + "definitions": { + "Vkey": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/BootstrapWitnesses.json b/rust/json-gen/schemas/BootstrapWitnesses.json new file mode 100644 index 0000000..64c538a --- /dev/null +++ b/rust/json-gen/schemas/BootstrapWitnesses.json @@ -0,0 +1,46 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "BootstrapWitnesses", + "type": "array", + "items": { + "$ref": "#/definitions/BootstrapWitness" + }, + "definitions": { + "BootstrapWitness": { + "type": "object", + "required": [ + "attributes", + "chain_code", + "signature", + "vkey" + ], + "properties": { + "attributes": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "chain_code": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "signature": { + "type": "string" + }, + "vkey": { + "$ref": "#/definitions/Vkey" + } + } + }, + "Vkey": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Certificate.json b/rust/json-gen/schemas/Certificate.json new file mode 100644 index 0000000..ea222f2 --- /dev/null +++ b/rust/json-gen/schemas/Certificate.json @@ -0,0 +1,788 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Certificate", + "allOf": [ + { + "$ref": "#/definitions/CertificateEnum" + } + ], + "definitions": { + "CertificateEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "StakeRegistration" + ], + "properties": { + "StakeRegistration": { + "$ref": "#/definitions/StakeRegistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "StakeDeregistration" + ], + "properties": { + "StakeDeregistration": { + "$ref": "#/definitions/StakeDeregistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "StakeDelegation" + ], + "properties": { + "StakeDelegation": { + "$ref": "#/definitions/StakeDelegation" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PoolRegistration" + ], + "properties": { + "PoolRegistration": { + "$ref": "#/definitions/PoolRegistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PoolRetirement" + ], + "properties": { + "PoolRetirement": { + "$ref": "#/definitions/PoolRetirement" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "GenesisKeyDelegation" + ], + "properties": { + "GenesisKeyDelegation": { + "$ref": "#/definitions/GenesisKeyDelegation" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MoveInstantaneousRewardsCert" + ], + "properties": { + "MoveInstantaneousRewardsCert": { + "$ref": "#/definitions/MoveInstantaneousRewardsCert" + } + }, + "additionalProperties": false + } + ] + }, + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + }, + "Costmdls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + } + }, + "DNSRecordAorAAAA": { + "type": "string" + }, + "DNSRecordSRV": { + "type": "string" + }, + "Ed25519KeyHashes": { + "type": "array", + "items": { + "type": "string" + } + }, + "ExUnitPrices": { + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "GenesisKeyDelegation": { + "type": "object", + "required": [ + "genesis_delegate_hash", + "genesishash", + "vrf_keyhash" + ], + "properties": { + "genesis_delegate_hash": { + "type": "string" + }, + "genesishash": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + } + }, + "Ipv4": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 4, + "minItems": 4 + }, + "Ipv6": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 16, + "minItems": 16 + }, + "MIREnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ToOtherPot" + ], + "properties": { + "ToOtherPot": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ToStakeCredentials" + ], + "properties": { + "ToStakeCredentials": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + }, + "additionalProperties": false + } + ] + }, + "MIRPot": { + "type": "string", + "enum": [ + "Reserves", + "Treasury" + ] + }, + "MoveInstantaneousReward": { + "type": "object", + "required": [ + "pot", + "variant" + ], + "properties": { + "pot": { + "$ref": "#/definitions/MIRPot" + }, + "variant": { + "$ref": "#/definitions/MIREnum" + } + } + }, + "MoveInstantaneousRewardsCert": { + "type": "object", + "required": [ + "move_instantaneous_reward" + ], + "properties": { + "move_instantaneous_reward": { + "$ref": "#/definitions/MoveInstantaneousReward" + } + } + }, + "MultiHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordSRV" + } + } + }, + "Nonce": { + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } + }, + "PoolMetadata": { + "type": "object", + "required": [ + "pool_metadata_hash", + "url" + ], + "properties": { + "pool_metadata_hash": { + "type": "string" + }, + "url": { + "$ref": "#/definitions/URL" + } + } + }, + "PoolParams": { + "type": "object", + "required": [ + "cost", + "margin", + "operator", + "pledge", + "pool_owners", + "relays", + "reward_account", + "vrf_keyhash" + ], + "properties": { + "cost": { + "type": "string" + }, + "margin": { + "$ref": "#/definitions/UnitInterval" + }, + "operator": { + "type": "string" + }, + "pledge": { + "type": "string" + }, + "pool_metadata": { + "anyOf": [ + { + "$ref": "#/definitions/PoolMetadata" + }, + { + "type": "null" + } + ] + }, + "pool_owners": { + "$ref": "#/definitions/Ed25519KeyHashes" + }, + "relays": { + "$ref": "#/definitions/Relays" + }, + "reward_account": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + } + }, + "PoolRegistration": { + "type": "object", + "required": [ + "pool_params" + ], + "properties": { + "pool_params": { + "$ref": "#/definitions/PoolParams" + } + } + }, + "PoolRetirement": { + "type": "object", + "required": [ + "epoch", + "pool_keyhash" + ], + "properties": { + "epoch": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "pool_keyhash": { + "type": "string" + } + } + }, + "ProtocolParamUpdate": { + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "type": [ + "string", + "null" + ] + }, + "collateral_percentage": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "cost_models": { + "anyOf": [ + { + "$ref": "#/definitions/Costmdls" + }, + { + "type": "null" + } + ] + }, + "d": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "execution_costs": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnitPrices" + }, + { + "type": "null" + } + ] + }, + "expansion_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "extra_entropy": { + "anyOf": [ + { + "$ref": "#/definitions/Nonce" + }, + { + "type": "null" + } + ] + }, + "key_deposit": { + "type": [ + "string", + "null" + ] + }, + "max_block_body_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_block_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_block_header_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_collateral_inputs": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_epoch": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_tx_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_tx_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_value_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "min_pool_cost": { + "type": [ + "string", + "null" + ] + }, + "minfee_a": { + "type": [ + "string", + "null" + ] + }, + "minfee_b": { + "type": [ + "string", + "null" + ] + }, + "n_opt": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "pool_deposit": { + "type": [ + "string", + "null" + ] + }, + "pool_pledge_influence": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "protocol_version": { + "anyOf": [ + { + "$ref": "#/definitions/ProtocolVersion" + }, + { + "type": "null" + } + ] + }, + "treasury_growth_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "Relay": { + "$ref": "#/definitions/RelayEnum" + }, + "RelayEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "SingleHostAddr" + ], + "properties": { + "SingleHostAddr": { + "$ref": "#/definitions/SingleHostAddr" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "SingleHostName" + ], + "properties": { + "SingleHostName": { + "$ref": "#/definitions/SingleHostName" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MultiHostName" + ], + "properties": { + "MultiHostName": { + "$ref": "#/definitions/MultiHostName" + } + }, + "additionalProperties": false + } + ] + }, + "Relays": { + "type": "array", + "items": { + "$ref": "#/definitions/Relay" + } + }, + "SingleHostAddr": { + "type": "object", + "properties": { + "ipv4": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv4" + }, + { + "type": "null" + } + ] + }, + "ipv6": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv6" + }, + { + "type": "null" + } + ] + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "SingleHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordAorAAAA" + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "StakeCredType": { + "oneOf": [ + { + "type": "object", + "required": [ + "Key" + ], + "properties": { + "Key": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Script" + ], + "properties": { + "Script": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "StakeCredential": { + "$ref": "#/definitions/StakeCredType" + }, + "StakeDelegation": { + "type": "object", + "required": [ + "pool_keyhash", + "stake_credential" + ], + "properties": { + "pool_keyhash": { + "type": "string" + }, + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "StakeDeregistration": { + "type": "object", + "required": [ + "stake_credential" + ], + "properties": { + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "StakeRegistration": { + "type": "object", + "required": [ + "stake_credential" + ], + "properties": { + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "URL": { + "type": "string" + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Certificates.json b/rust/json-gen/schemas/Certificates.json new file mode 100644 index 0000000..b458021 --- /dev/null +++ b/rust/json-gen/schemas/Certificates.json @@ -0,0 +1,790 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Certificates", + "type": "array", + "items": { + "$ref": "#/definitions/Certificate" + }, + "definitions": { + "Certificate": { + "$ref": "#/definitions/CertificateEnum" + }, + "CertificateEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "StakeRegistration" + ], + "properties": { + "StakeRegistration": { + "$ref": "#/definitions/StakeRegistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "StakeDeregistration" + ], + "properties": { + "StakeDeregistration": { + "$ref": "#/definitions/StakeDeregistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "StakeDelegation" + ], + "properties": { + "StakeDelegation": { + "$ref": "#/definitions/StakeDelegation" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PoolRegistration" + ], + "properties": { + "PoolRegistration": { + "$ref": "#/definitions/PoolRegistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PoolRetirement" + ], + "properties": { + "PoolRetirement": { + "$ref": "#/definitions/PoolRetirement" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "GenesisKeyDelegation" + ], + "properties": { + "GenesisKeyDelegation": { + "$ref": "#/definitions/GenesisKeyDelegation" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MoveInstantaneousRewardsCert" + ], + "properties": { + "MoveInstantaneousRewardsCert": { + "$ref": "#/definitions/MoveInstantaneousRewardsCert" + } + }, + "additionalProperties": false + } + ] + }, + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + }, + "Costmdls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + } + }, + "DNSRecordAorAAAA": { + "type": "string" + }, + "DNSRecordSRV": { + "type": "string" + }, + "Ed25519KeyHashes": { + "type": "array", + "items": { + "type": "string" + } + }, + "ExUnitPrices": { + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "GenesisKeyDelegation": { + "type": "object", + "required": [ + "genesis_delegate_hash", + "genesishash", + "vrf_keyhash" + ], + "properties": { + "genesis_delegate_hash": { + "type": "string" + }, + "genesishash": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + } + }, + "Ipv4": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 4, + "minItems": 4 + }, + "Ipv6": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 16, + "minItems": 16 + }, + "MIREnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ToOtherPot" + ], + "properties": { + "ToOtherPot": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ToStakeCredentials" + ], + "properties": { + "ToStakeCredentials": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + }, + "additionalProperties": false + } + ] + }, + "MIRPot": { + "type": "string", + "enum": [ + "Reserves", + "Treasury" + ] + }, + "MoveInstantaneousReward": { + "type": "object", + "required": [ + "pot", + "variant" + ], + "properties": { + "pot": { + "$ref": "#/definitions/MIRPot" + }, + "variant": { + "$ref": "#/definitions/MIREnum" + } + } + }, + "MoveInstantaneousRewardsCert": { + "type": "object", + "required": [ + "move_instantaneous_reward" + ], + "properties": { + "move_instantaneous_reward": { + "$ref": "#/definitions/MoveInstantaneousReward" + } + } + }, + "MultiHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordSRV" + } + } + }, + "Nonce": { + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } + }, + "PoolMetadata": { + "type": "object", + "required": [ + "pool_metadata_hash", + "url" + ], + "properties": { + "pool_metadata_hash": { + "type": "string" + }, + "url": { + "$ref": "#/definitions/URL" + } + } + }, + "PoolParams": { + "type": "object", + "required": [ + "cost", + "margin", + "operator", + "pledge", + "pool_owners", + "relays", + "reward_account", + "vrf_keyhash" + ], + "properties": { + "cost": { + "type": "string" + }, + "margin": { + "$ref": "#/definitions/UnitInterval" + }, + "operator": { + "type": "string" + }, + "pledge": { + "type": "string" + }, + "pool_metadata": { + "anyOf": [ + { + "$ref": "#/definitions/PoolMetadata" + }, + { + "type": "null" + } + ] + }, + "pool_owners": { + "$ref": "#/definitions/Ed25519KeyHashes" + }, + "relays": { + "$ref": "#/definitions/Relays" + }, + "reward_account": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + } + }, + "PoolRegistration": { + "type": "object", + "required": [ + "pool_params" + ], + "properties": { + "pool_params": { + "$ref": "#/definitions/PoolParams" + } + } + }, + "PoolRetirement": { + "type": "object", + "required": [ + "epoch", + "pool_keyhash" + ], + "properties": { + "epoch": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "pool_keyhash": { + "type": "string" + } + } + }, + "ProtocolParamUpdate": { + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "type": [ + "string", + "null" + ] + }, + "collateral_percentage": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "cost_models": { + "anyOf": [ + { + "$ref": "#/definitions/Costmdls" + }, + { + "type": "null" + } + ] + }, + "d": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "execution_costs": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnitPrices" + }, + { + "type": "null" + } + ] + }, + "expansion_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "extra_entropy": { + "anyOf": [ + { + "$ref": "#/definitions/Nonce" + }, + { + "type": "null" + } + ] + }, + "key_deposit": { + "type": [ + "string", + "null" + ] + }, + "max_block_body_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_block_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_block_header_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_collateral_inputs": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_epoch": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_tx_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_tx_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_value_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "min_pool_cost": { + "type": [ + "string", + "null" + ] + }, + "minfee_a": { + "type": [ + "string", + "null" + ] + }, + "minfee_b": { + "type": [ + "string", + "null" + ] + }, + "n_opt": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "pool_deposit": { + "type": [ + "string", + "null" + ] + }, + "pool_pledge_influence": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "protocol_version": { + "anyOf": [ + { + "$ref": "#/definitions/ProtocolVersion" + }, + { + "type": "null" + } + ] + }, + "treasury_growth_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "Relay": { + "$ref": "#/definitions/RelayEnum" + }, + "RelayEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "SingleHostAddr" + ], + "properties": { + "SingleHostAddr": { + "$ref": "#/definitions/SingleHostAddr" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "SingleHostName" + ], + "properties": { + "SingleHostName": { + "$ref": "#/definitions/SingleHostName" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MultiHostName" + ], + "properties": { + "MultiHostName": { + "$ref": "#/definitions/MultiHostName" + } + }, + "additionalProperties": false + } + ] + }, + "Relays": { + "type": "array", + "items": { + "$ref": "#/definitions/Relay" + } + }, + "SingleHostAddr": { + "type": "object", + "properties": { + "ipv4": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv4" + }, + { + "type": "null" + } + ] + }, + "ipv6": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv6" + }, + { + "type": "null" + } + ] + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "SingleHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordAorAAAA" + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "StakeCredType": { + "oneOf": [ + { + "type": "object", + "required": [ + "Key" + ], + "properties": { + "Key": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Script" + ], + "properties": { + "Script": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "StakeCredential": { + "$ref": "#/definitions/StakeCredType" + }, + "StakeDelegation": { + "type": "object", + "required": [ + "pool_keyhash", + "stake_credential" + ], + "properties": { + "pool_keyhash": { + "type": "string" + }, + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "StakeDeregistration": { + "type": "object", + "required": [ + "stake_credential" + ], + "properties": { + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "StakeRegistration": { + "type": "object", + "required": [ + "stake_credential" + ], + "properties": { + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "URL": { + "type": "string" + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/CostModel.json b/rust/json-gen/schemas/CostModel.json new file mode 100644 index 0000000..5792d08 --- /dev/null +++ b/rust/json-gen/schemas/CostModel.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CostModel", + "type": "array", + "items": { + "type": "string" + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Costmdls.json b/rust/json-gen/schemas/Costmdls.json new file mode 100644 index 0000000..1251a63 --- /dev/null +++ b/rust/json-gen/schemas/Costmdls.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Costmdls", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + }, + "definitions": { + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/DNSRecordAorAAAA.json b/rust/json-gen/schemas/DNSRecordAorAAAA.json new file mode 100644 index 0000000..accbbae --- /dev/null +++ b/rust/json-gen/schemas/DNSRecordAorAAAA.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DNSRecordAorAAAA", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/DNSRecordSRV.json b/rust/json-gen/schemas/DNSRecordSRV.json new file mode 100644 index 0000000..989cbc6 --- /dev/null +++ b/rust/json-gen/schemas/DNSRecordSRV.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DNSRecordSRV", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/DataHash.json b/rust/json-gen/schemas/DataHash.json new file mode 100644 index 0000000..ee4c761 --- /dev/null +++ b/rust/json-gen/schemas/DataHash.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DataHash", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/DataOption.json b/rust/json-gen/schemas/DataOption.json new file mode 100644 index 0000000..c60c2ba --- /dev/null +++ b/rust/json-gen/schemas/DataOption.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DataOption", + "oneOf": [ + { + "type": "object", + "required": [ + "DataHash" + ], + "properties": { + "DataHash": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Data" + ], + "properties": { + "Data": { + "type": "string" + } + }, + "additionalProperties": false + } + ] +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Ed25519KeyHash.json b/rust/json-gen/schemas/Ed25519KeyHash.json new file mode 100644 index 0000000..921871a --- /dev/null +++ b/rust/json-gen/schemas/Ed25519KeyHash.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Ed25519KeyHash", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Ed25519KeyHashes.json b/rust/json-gen/schemas/Ed25519KeyHashes.json new file mode 100644 index 0000000..8f2ebf0 --- /dev/null +++ b/rust/json-gen/schemas/Ed25519KeyHashes.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Ed25519KeyHashes", + "type": "array", + "items": { + "type": "string" + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Ed25519Signature.json b/rust/json-gen/schemas/Ed25519Signature.json new file mode 100644 index 0000000..f832084 --- /dev/null +++ b/rust/json-gen/schemas/Ed25519Signature.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Ed25519Signature", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/ExUnitPrices.json b/rust/json-gen/schemas/ExUnitPrices.json new file mode 100644 index 0000000..120295e --- /dev/null +++ b/rust/json-gen/schemas/ExUnitPrices.json @@ -0,0 +1,34 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExUnitPrices", + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + }, + "definitions": { + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/ExUnits.json b/rust/json-gen/schemas/ExUnits.json new file mode 100644 index 0000000..4a36b50 --- /dev/null +++ b/rust/json-gen/schemas/ExUnits.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExUnits", + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/GeneralTransactionMetadata.json b/rust/json-gen/schemas/GeneralTransactionMetadata.json new file mode 100644 index 0000000..7f66104 --- /dev/null +++ b/rust/json-gen/schemas/GeneralTransactionMetadata.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GeneralTransactionMetadata", + "type": "object", + "additionalProperties": { + "type": "string" + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/GenesisDelegateHash.json b/rust/json-gen/schemas/GenesisDelegateHash.json new file mode 100644 index 0000000..4b4a606 --- /dev/null +++ b/rust/json-gen/schemas/GenesisDelegateHash.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GenesisDelegateHash", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/GenesisHash.json b/rust/json-gen/schemas/GenesisHash.json new file mode 100644 index 0000000..08e698d --- /dev/null +++ b/rust/json-gen/schemas/GenesisHash.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GenesisHash", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/GenesisHashes.json b/rust/json-gen/schemas/GenesisHashes.json new file mode 100644 index 0000000..97cf01e --- /dev/null +++ b/rust/json-gen/schemas/GenesisHashes.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GenesisHashes", + "type": "array", + "items": { + "type": "string" + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/GenesisKeyDelegation.json b/rust/json-gen/schemas/GenesisKeyDelegation.json new file mode 100644 index 0000000..cdda03a --- /dev/null +++ b/rust/json-gen/schemas/GenesisKeyDelegation.json @@ -0,0 +1,21 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GenesisKeyDelegation", + "type": "object", + "required": [ + "genesis_delegate_hash", + "genesishash", + "vrf_keyhash" + ], + "properties": { + "genesis_delegate_hash": { + "type": "string" + }, + "genesishash": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Header.json b/rust/json-gen/schemas/Header.json new file mode 100644 index 0000000..05963af --- /dev/null +++ b/rust/json-gen/schemas/Header.json @@ -0,0 +1,184 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Header", + "type": "object", + "required": [ + "body_signature", + "header_body" + ], + "properties": { + "body_signature": { + "type": "string" + }, + "header_body": { + "$ref": "#/definitions/HeaderBody" + } + }, + "definitions": { + "HeaderBody": { + "type": "object", + "required": [ + "block_body_hash", + "block_body_size", + "block_number", + "issuer_vkey", + "leader_cert", + "operational_cert", + "protocol_version", + "slot", + "vrf_vkey" + ], + "properties": { + "block_body_hash": { + "type": "string" + }, + "block_body_size": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "block_number": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "issuer_vkey": { + "$ref": "#/definitions/Vkey" + }, + "leader_cert": { + "$ref": "#/definitions/HeaderLeaderCertEnum" + }, + "operational_cert": { + "$ref": "#/definitions/OperationalCert" + }, + "prev_hash": { + "type": [ + "string", + "null" + ] + }, + "protocol_version": { + "$ref": "#/definitions/ProtocolVersion" + }, + "slot": { + "type": "string" + }, + "vrf_vkey": { + "type": "string" + } + } + }, + "HeaderLeaderCertEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "NonceAndLeader" + ], + "properties": { + "NonceAndLeader": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/VRFCert" + }, + { + "$ref": "#/definitions/VRFCert" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "VrfResult" + ], + "properties": { + "VrfResult": { + "$ref": "#/definitions/VRFCert" + } + }, + "additionalProperties": false + } + ] + }, + "OperationalCert": { + "type": "object", + "required": [ + "hot_vkey", + "kes_period", + "sequence_number", + "sigma" + ], + "properties": { + "hot_vkey": { + "type": "string" + }, + "kes_period": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "sequence_number": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "sigma": { + "type": "string" + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "VRFCert": { + "type": "object", + "required": [ + "output", + "proof" + ], + "properties": { + "output": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "proof": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + } + } + }, + "Vkey": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/HeaderBody.json b/rust/json-gen/schemas/HeaderBody.json new file mode 100644 index 0000000..ab61f64 --- /dev/null +++ b/rust/json-gen/schemas/HeaderBody.json @@ -0,0 +1,169 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HeaderBody", + "type": "object", + "required": [ + "block_body_hash", + "block_body_size", + "block_number", + "issuer_vkey", + "leader_cert", + "operational_cert", + "protocol_version", + "slot", + "vrf_vkey" + ], + "properties": { + "block_body_hash": { + "type": "string" + }, + "block_body_size": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "block_number": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "issuer_vkey": { + "$ref": "#/definitions/Vkey" + }, + "leader_cert": { + "$ref": "#/definitions/HeaderLeaderCertEnum" + }, + "operational_cert": { + "$ref": "#/definitions/OperationalCert" + }, + "prev_hash": { + "type": [ + "string", + "null" + ] + }, + "protocol_version": { + "$ref": "#/definitions/ProtocolVersion" + }, + "slot": { + "type": "string" + }, + "vrf_vkey": { + "type": "string" + } + }, + "definitions": { + "HeaderLeaderCertEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "NonceAndLeader" + ], + "properties": { + "NonceAndLeader": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/VRFCert" + }, + { + "$ref": "#/definitions/VRFCert" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "VrfResult" + ], + "properties": { + "VrfResult": { + "$ref": "#/definitions/VRFCert" + } + }, + "additionalProperties": false + } + ] + }, + "OperationalCert": { + "type": "object", + "required": [ + "hot_vkey", + "kes_period", + "sequence_number", + "sigma" + ], + "properties": { + "hot_vkey": { + "type": "string" + }, + "kes_period": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "sequence_number": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "sigma": { + "type": "string" + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "VRFCert": { + "type": "object", + "required": [ + "output", + "proof" + ], + "properties": { + "output": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "proof": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + } + } + }, + "Vkey": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/HeaderLeaderCertEnum.json b/rust/json-gen/schemas/HeaderLeaderCertEnum.json new file mode 100644 index 0000000..f2a2f63 --- /dev/null +++ b/rust/json-gen/schemas/HeaderLeaderCertEnum.json @@ -0,0 +1,67 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HeaderLeaderCertEnum", + "oneOf": [ + { + "type": "object", + "required": [ + "NonceAndLeader" + ], + "properties": { + "NonceAndLeader": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/VRFCert" + }, + { + "$ref": "#/definitions/VRFCert" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "VrfResult" + ], + "properties": { + "VrfResult": { + "$ref": "#/definitions/VRFCert" + } + }, + "additionalProperties": false + } + ], + "definitions": { + "VRFCert": { + "type": "object", + "required": [ + "output", + "proof" + ], + "properties": { + "output": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "proof": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Int.json b/rust/json-gen/schemas/Int.json new file mode 100644 index 0000000..6edcc8b --- /dev/null +++ b/rust/json-gen/schemas/Int.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Int", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Ipv4.json b/rust/json-gen/schemas/Ipv4.json new file mode 100644 index 0000000..e6163fa --- /dev/null +++ b/rust/json-gen/schemas/Ipv4.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Ipv4", + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 4, + "minItems": 4 +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Ipv6.json b/rust/json-gen/schemas/Ipv6.json new file mode 100644 index 0000000..0670a61 --- /dev/null +++ b/rust/json-gen/schemas/Ipv6.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Ipv6", + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 16, + "minItems": 16 +} \ No newline at end of file diff --git a/rust/json-gen/schemas/KESVKey.json b/rust/json-gen/schemas/KESVKey.json new file mode 100644 index 0000000..f6a4f9f --- /dev/null +++ b/rust/json-gen/schemas/KESVKey.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "KESVKey", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Language.json b/rust/json-gen/schemas/Language.json new file mode 100644 index 0000000..b12dbeb --- /dev/null +++ b/rust/json-gen/schemas/Language.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Language", + "allOf": [ + { + "$ref": "#/definitions/LanguageKind" + } + ], + "definitions": { + "LanguageKind": { + "type": "string", + "enum": [ + "PlutusV1", + "PlutusV2" + ] + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/LanguageKind.json b/rust/json-gen/schemas/LanguageKind.json new file mode 100644 index 0000000..ae40dae --- /dev/null +++ b/rust/json-gen/schemas/LanguageKind.json @@ -0,0 +1,9 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "LanguageKind", + "type": "string", + "enum": [ + "PlutusV1", + "PlutusV2" + ] +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Languages.json b/rust/json-gen/schemas/Languages.json new file mode 100644 index 0000000..1fa3c50 --- /dev/null +++ b/rust/json-gen/schemas/Languages.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Languages", + "type": "array", + "items": { + "$ref": "#/definitions/Language" + }, + "definitions": { + "Language": { + "$ref": "#/definitions/LanguageKind" + }, + "LanguageKind": { + "type": "string", + "enum": [ + "PlutusV1", + "PlutusV2" + ] + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/MIREnum.json b/rust/json-gen/schemas/MIREnum.json new file mode 100644 index 0000000..c772dcd --- /dev/null +++ b/rust/json-gen/schemas/MIREnum.json @@ -0,0 +1,334 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MIREnum", + "oneOf": [ + { + "type": "object", + "required": [ + "ToOtherPot" + ], + "properties": { + "ToOtherPot": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ToStakeCredentials" + ], + "properties": { + "ToStakeCredentials": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + }, + "additionalProperties": false + } + ], + "definitions": { + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + }, + "Costmdls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + } + }, + "ExUnitPrices": { + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "Nonce": { + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } + }, + "ProtocolParamUpdate": { + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "type": [ + "string", + "null" + ] + }, + "collateral_percentage": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "cost_models": { + "anyOf": [ + { + "$ref": "#/definitions/Costmdls" + }, + { + "type": "null" + } + ] + }, + "d": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "execution_costs": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnitPrices" + }, + { + "type": "null" + } + ] + }, + "expansion_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "extra_entropy": { + "anyOf": [ + { + "$ref": "#/definitions/Nonce" + }, + { + "type": "null" + } + ] + }, + "key_deposit": { + "type": [ + "string", + "null" + ] + }, + "max_block_body_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_block_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_block_header_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_collateral_inputs": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_epoch": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_tx_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_tx_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_value_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "min_pool_cost": { + "type": [ + "string", + "null" + ] + }, + "minfee_a": { + "type": [ + "string", + "null" + ] + }, + "minfee_b": { + "type": [ + "string", + "null" + ] + }, + "n_opt": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "pool_deposit": { + "type": [ + "string", + "null" + ] + }, + "pool_pledge_influence": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "protocol_version": { + "anyOf": [ + { + "$ref": "#/definitions/ProtocolVersion" + }, + { + "type": "null" + } + ] + }, + "treasury_growth_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/MIRPot.json b/rust/json-gen/schemas/MIRPot.json new file mode 100644 index 0000000..78594c6 --- /dev/null +++ b/rust/json-gen/schemas/MIRPot.json @@ -0,0 +1,9 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MIRPot", + "type": "string", + "enum": [ + "Reserves", + "Treasury" + ] +} \ No newline at end of file diff --git a/rust/json-gen/schemas/MIRToStakeCredentials.json b/rust/json-gen/schemas/MIRToStakeCredentials.json new file mode 100644 index 0000000..2a60e3d --- /dev/null +++ b/rust/json-gen/schemas/MIRToStakeCredentials.json @@ -0,0 +1,309 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MIRToStakeCredentials", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + }, + "definitions": { + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + }, + "Costmdls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + } + }, + "ExUnitPrices": { + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "Nonce": { + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } + }, + "ProtocolParamUpdate": { + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "type": [ + "string", + "null" + ] + }, + "collateral_percentage": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "cost_models": { + "anyOf": [ + { + "$ref": "#/definitions/Costmdls" + }, + { + "type": "null" + } + ] + }, + "d": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "execution_costs": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnitPrices" + }, + { + "type": "null" + } + ] + }, + "expansion_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "extra_entropy": { + "anyOf": [ + { + "$ref": "#/definitions/Nonce" + }, + { + "type": "null" + } + ] + }, + "key_deposit": { + "type": [ + "string", + "null" + ] + }, + "max_block_body_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_block_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_block_header_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_collateral_inputs": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_epoch": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_tx_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_tx_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_value_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "min_pool_cost": { + "type": [ + "string", + "null" + ] + }, + "minfee_a": { + "type": [ + "string", + "null" + ] + }, + "minfee_b": { + "type": [ + "string", + "null" + ] + }, + "n_opt": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "pool_deposit": { + "type": [ + "string", + "null" + ] + }, + "pool_pledge_influence": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "protocol_version": { + "anyOf": [ + { + "$ref": "#/definitions/ProtocolVersion" + }, + { + "type": "null" + } + ] + }, + "treasury_growth_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Mint.json b/rust/json-gen/schemas/Mint.json new file mode 100644 index 0000000..632680f --- /dev/null +++ b/rust/json-gen/schemas/Mint.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Mint", + "type": "array", + "items": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/MintAssets" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "definitions": { + "MintAssets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/MintAssets.json b/rust/json-gen/schemas/MintAssets.json new file mode 100644 index 0000000..0d1a4fd --- /dev/null +++ b/rust/json-gen/schemas/MintAssets.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MintAssets", + "type": "object", + "additionalProperties": { + "type": "string" + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/MoveInstantaneousReward.json b/rust/json-gen/schemas/MoveInstantaneousReward.json new file mode 100644 index 0000000..3eb285f --- /dev/null +++ b/rust/json-gen/schemas/MoveInstantaneousReward.json @@ -0,0 +1,356 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MoveInstantaneousReward", + "type": "object", + "required": [ + "pot", + "variant" + ], + "properties": { + "pot": { + "$ref": "#/definitions/MIRPot" + }, + "variant": { + "$ref": "#/definitions/MIREnum" + } + }, + "definitions": { + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + }, + "Costmdls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + } + }, + "ExUnitPrices": { + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "MIREnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ToOtherPot" + ], + "properties": { + "ToOtherPot": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ToStakeCredentials" + ], + "properties": { + "ToStakeCredentials": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + }, + "additionalProperties": false + } + ] + }, + "MIRPot": { + "type": "string", + "enum": [ + "Reserves", + "Treasury" + ] + }, + "Nonce": { + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } + }, + "ProtocolParamUpdate": { + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "type": [ + "string", + "null" + ] + }, + "collateral_percentage": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "cost_models": { + "anyOf": [ + { + "$ref": "#/definitions/Costmdls" + }, + { + "type": "null" + } + ] + }, + "d": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "execution_costs": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnitPrices" + }, + { + "type": "null" + } + ] + }, + "expansion_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "extra_entropy": { + "anyOf": [ + { + "$ref": "#/definitions/Nonce" + }, + { + "type": "null" + } + ] + }, + "key_deposit": { + "type": [ + "string", + "null" + ] + }, + "max_block_body_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_block_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_block_header_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_collateral_inputs": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_epoch": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_tx_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_tx_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_value_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "min_pool_cost": { + "type": [ + "string", + "null" + ] + }, + "minfee_a": { + "type": [ + "string", + "null" + ] + }, + "minfee_b": { + "type": [ + "string", + "null" + ] + }, + "n_opt": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "pool_deposit": { + "type": [ + "string", + "null" + ] + }, + "pool_pledge_influence": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "protocol_version": { + "anyOf": [ + { + "$ref": "#/definitions/ProtocolVersion" + }, + { + "type": "null" + } + ] + }, + "treasury_growth_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/MoveInstantaneousRewardsCert.json b/rust/json-gen/schemas/MoveInstantaneousRewardsCert.json new file mode 100644 index 0000000..14ccae0 --- /dev/null +++ b/rust/json-gen/schemas/MoveInstantaneousRewardsCert.json @@ -0,0 +1,367 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MoveInstantaneousRewardsCert", + "type": "object", + "required": [ + "move_instantaneous_reward" + ], + "properties": { + "move_instantaneous_reward": { + "$ref": "#/definitions/MoveInstantaneousReward" + } + }, + "definitions": { + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + }, + "Costmdls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + } + }, + "ExUnitPrices": { + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "MIREnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ToOtherPot" + ], + "properties": { + "ToOtherPot": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ToStakeCredentials" + ], + "properties": { + "ToStakeCredentials": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + }, + "additionalProperties": false + } + ] + }, + "MIRPot": { + "type": "string", + "enum": [ + "Reserves", + "Treasury" + ] + }, + "MoveInstantaneousReward": { + "type": "object", + "required": [ + "pot", + "variant" + ], + "properties": { + "pot": { + "$ref": "#/definitions/MIRPot" + }, + "variant": { + "$ref": "#/definitions/MIREnum" + } + } + }, + "Nonce": { + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } + }, + "ProtocolParamUpdate": { + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "type": [ + "string", + "null" + ] + }, + "collateral_percentage": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "cost_models": { + "anyOf": [ + { + "$ref": "#/definitions/Costmdls" + }, + { + "type": "null" + } + ] + }, + "d": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "execution_costs": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnitPrices" + }, + { + "type": "null" + } + ] + }, + "expansion_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "extra_entropy": { + "anyOf": [ + { + "$ref": "#/definitions/Nonce" + }, + { + "type": "null" + } + ] + }, + "key_deposit": { + "type": [ + "string", + "null" + ] + }, + "max_block_body_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_block_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_block_header_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_collateral_inputs": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_epoch": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_tx_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_tx_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_value_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "min_pool_cost": { + "type": [ + "string", + "null" + ] + }, + "minfee_a": { + "type": [ + "string", + "null" + ] + }, + "minfee_b": { + "type": [ + "string", + "null" + ] + }, + "n_opt": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "pool_deposit": { + "type": [ + "string", + "null" + ] + }, + "pool_pledge_influence": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "protocol_version": { + "anyOf": [ + { + "$ref": "#/definitions/ProtocolVersion" + }, + { + "type": "null" + } + ] + }, + "treasury_growth_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/MultiAsset.json b/rust/json-gen/schemas/MultiAsset.json new file mode 100644 index 0000000..07759f4 --- /dev/null +++ b/rust/json-gen/schemas/MultiAsset.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MultiAsset", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Assets" + }, + "definitions": { + "Assets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/MultiHostName.json b/rust/json-gen/schemas/MultiHostName.json new file mode 100644 index 0000000..f6a5df4 --- /dev/null +++ b/rust/json-gen/schemas/MultiHostName.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MultiHostName", + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordSRV" + } + }, + "definitions": { + "DNSRecordSRV": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/NativeScript.json b/rust/json-gen/schemas/NativeScript.json new file mode 100644 index 0000000..65153a7 --- /dev/null +++ b/rust/json-gen/schemas/NativeScript.json @@ -0,0 +1,168 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "NativeScript", + "allOf": [ + { + "$ref": "#/definitions/NativeScriptEnum" + } + ], + "definitions": { + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/NativeScripts.json b/rust/json-gen/schemas/NativeScripts.json new file mode 100644 index 0000000..7b77904 --- /dev/null +++ b/rust/json-gen/schemas/NativeScripts.json @@ -0,0 +1,167 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "NativeScripts", + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + }, + "definitions": { + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/NetworkId.json b/rust/json-gen/schemas/NetworkId.json new file mode 100644 index 0000000..2c982fb --- /dev/null +++ b/rust/json-gen/schemas/NetworkId.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "NetworkId", + "allOf": [ + { + "$ref": "#/definitions/NetworkIdKind" + } + ], + "definitions": { + "NetworkIdKind": { + "type": "string", + "enum": [ + "Testnet", + "Mainnet" + ] + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/NetworkIdKind.json b/rust/json-gen/schemas/NetworkIdKind.json new file mode 100644 index 0000000..4268d9f --- /dev/null +++ b/rust/json-gen/schemas/NetworkIdKind.json @@ -0,0 +1,9 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "NetworkIdKind", + "type": "string", + "enum": [ + "Testnet", + "Mainnet" + ] +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Nonce.json b/rust/json-gen/schemas/Nonce.json new file mode 100644 index 0000000..9d7ec86 --- /dev/null +++ b/rust/json-gen/schemas/Nonce.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Nonce", + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/OperationalCert.json b/rust/json-gen/schemas/OperationalCert.json new file mode 100644 index 0000000..743589d --- /dev/null +++ b/rust/json-gen/schemas/OperationalCert.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OperationalCert", + "type": "object", + "required": [ + "hot_vkey", + "kes_period", + "sequence_number", + "sigma" + ], + "properties": { + "hot_vkey": { + "type": "string" + }, + "kes_period": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "sequence_number": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "sigma": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/PlutusScript.json b/rust/json-gen/schemas/PlutusScript.json new file mode 100644 index 0000000..380c5b3 --- /dev/null +++ b/rust/json-gen/schemas/PlutusScript.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PlutusScript", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/PlutusScripts.json b/rust/json-gen/schemas/PlutusScripts.json new file mode 100644 index 0000000..fe4892b --- /dev/null +++ b/rust/json-gen/schemas/PlutusScripts.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PlutusScripts", + "type": "array", + "items": { + "type": "string" + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/PoolMetadata.json b/rust/json-gen/schemas/PoolMetadata.json new file mode 100644 index 0000000..148f50a --- /dev/null +++ b/rust/json-gen/schemas/PoolMetadata.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PoolMetadata", + "type": "object", + "required": [ + "pool_metadata_hash", + "url" + ], + "properties": { + "pool_metadata_hash": { + "type": "string" + }, + "url": { + "$ref": "#/definitions/URL" + } + }, + "definitions": { + "URL": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/PoolMetadataHash.json b/rust/json-gen/schemas/PoolMetadataHash.json new file mode 100644 index 0000000..b02ca96 --- /dev/null +++ b/rust/json-gen/schemas/PoolMetadataHash.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PoolMetadataHash", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/PoolParams.json b/rust/json-gen/schemas/PoolParams.json new file mode 100644 index 0000000..f8c583b --- /dev/null +++ b/rust/json-gen/schemas/PoolParams.json @@ -0,0 +1,230 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PoolParams", + "type": "object", + "required": [ + "cost", + "margin", + "operator", + "pledge", + "pool_owners", + "relays", + "reward_account", + "vrf_keyhash" + ], + "properties": { + "cost": { + "type": "string" + }, + "margin": { + "$ref": "#/definitions/UnitInterval" + }, + "operator": { + "type": "string" + }, + "pledge": { + "type": "string" + }, + "pool_metadata": { + "anyOf": [ + { + "$ref": "#/definitions/PoolMetadata" + }, + { + "type": "null" + } + ] + }, + "pool_owners": { + "$ref": "#/definitions/Ed25519KeyHashes" + }, + "relays": { + "$ref": "#/definitions/Relays" + }, + "reward_account": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + }, + "definitions": { + "DNSRecordAorAAAA": { + "type": "string" + }, + "DNSRecordSRV": { + "type": "string" + }, + "Ed25519KeyHashes": { + "type": "array", + "items": { + "type": "string" + } + }, + "Ipv4": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 4, + "minItems": 4 + }, + "Ipv6": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 16, + "minItems": 16 + }, + "MultiHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordSRV" + } + } + }, + "PoolMetadata": { + "type": "object", + "required": [ + "pool_metadata_hash", + "url" + ], + "properties": { + "pool_metadata_hash": { + "type": "string" + }, + "url": { + "$ref": "#/definitions/URL" + } + } + }, + "Relay": { + "$ref": "#/definitions/RelayEnum" + }, + "RelayEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "SingleHostAddr" + ], + "properties": { + "SingleHostAddr": { + "$ref": "#/definitions/SingleHostAddr" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "SingleHostName" + ], + "properties": { + "SingleHostName": { + "$ref": "#/definitions/SingleHostName" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MultiHostName" + ], + "properties": { + "MultiHostName": { + "$ref": "#/definitions/MultiHostName" + } + }, + "additionalProperties": false + } + ] + }, + "Relays": { + "type": "array", + "items": { + "$ref": "#/definitions/Relay" + } + }, + "SingleHostAddr": { + "type": "object", + "properties": { + "ipv4": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv4" + }, + { + "type": "null" + } + ] + }, + "ipv6": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv6" + }, + { + "type": "null" + } + ] + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "SingleHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordAorAAAA" + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "URL": { + "type": "string" + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/PoolRegistration.json b/rust/json-gen/schemas/PoolRegistration.json new file mode 100644 index 0000000..7ddb39a --- /dev/null +++ b/rust/json-gen/schemas/PoolRegistration.json @@ -0,0 +1,241 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PoolRegistration", + "type": "object", + "required": [ + "pool_params" + ], + "properties": { + "pool_params": { + "$ref": "#/definitions/PoolParams" + } + }, + "definitions": { + "DNSRecordAorAAAA": { + "type": "string" + }, + "DNSRecordSRV": { + "type": "string" + }, + "Ed25519KeyHashes": { + "type": "array", + "items": { + "type": "string" + } + }, + "Ipv4": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 4, + "minItems": 4 + }, + "Ipv6": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 16, + "minItems": 16 + }, + "MultiHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordSRV" + } + } + }, + "PoolMetadata": { + "type": "object", + "required": [ + "pool_metadata_hash", + "url" + ], + "properties": { + "pool_metadata_hash": { + "type": "string" + }, + "url": { + "$ref": "#/definitions/URL" + } + } + }, + "PoolParams": { + "type": "object", + "required": [ + "cost", + "margin", + "operator", + "pledge", + "pool_owners", + "relays", + "reward_account", + "vrf_keyhash" + ], + "properties": { + "cost": { + "type": "string" + }, + "margin": { + "$ref": "#/definitions/UnitInterval" + }, + "operator": { + "type": "string" + }, + "pledge": { + "type": "string" + }, + "pool_metadata": { + "anyOf": [ + { + "$ref": "#/definitions/PoolMetadata" + }, + { + "type": "null" + } + ] + }, + "pool_owners": { + "$ref": "#/definitions/Ed25519KeyHashes" + }, + "relays": { + "$ref": "#/definitions/Relays" + }, + "reward_account": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + } + }, + "Relay": { + "$ref": "#/definitions/RelayEnum" + }, + "RelayEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "SingleHostAddr" + ], + "properties": { + "SingleHostAddr": { + "$ref": "#/definitions/SingleHostAddr" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "SingleHostName" + ], + "properties": { + "SingleHostName": { + "$ref": "#/definitions/SingleHostName" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MultiHostName" + ], + "properties": { + "MultiHostName": { + "$ref": "#/definitions/MultiHostName" + } + }, + "additionalProperties": false + } + ] + }, + "Relays": { + "type": "array", + "items": { + "$ref": "#/definitions/Relay" + } + }, + "SingleHostAddr": { + "type": "object", + "properties": { + "ipv4": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv4" + }, + { + "type": "null" + } + ] + }, + "ipv6": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv6" + }, + { + "type": "null" + } + ] + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "SingleHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordAorAAAA" + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "URL": { + "type": "string" + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/PoolRetirement.json b/rust/json-gen/schemas/PoolRetirement.json new file mode 100644 index 0000000..e9609c4 --- /dev/null +++ b/rust/json-gen/schemas/PoolRetirement.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PoolRetirement", + "type": "object", + "required": [ + "epoch", + "pool_keyhash" + ], + "properties": { + "epoch": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "pool_keyhash": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/ProposedProtocolParameterUpdates.json b/rust/json-gen/schemas/ProposedProtocolParameterUpdates.json new file mode 100644 index 0000000..3388fe9 --- /dev/null +++ b/rust/json-gen/schemas/ProposedProtocolParameterUpdates.json @@ -0,0 +1,309 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ProposedProtocolParameterUpdates", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + }, + "definitions": { + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + }, + "Costmdls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + } + }, + "ExUnitPrices": { + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "Nonce": { + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } + }, + "ProtocolParamUpdate": { + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "type": [ + "string", + "null" + ] + }, + "collateral_percentage": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "cost_models": { + "anyOf": [ + { + "$ref": "#/definitions/Costmdls" + }, + { + "type": "null" + } + ] + }, + "d": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "execution_costs": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnitPrices" + }, + { + "type": "null" + } + ] + }, + "expansion_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "extra_entropy": { + "anyOf": [ + { + "$ref": "#/definitions/Nonce" + }, + { + "type": "null" + } + ] + }, + "key_deposit": { + "type": [ + "string", + "null" + ] + }, + "max_block_body_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_block_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_block_header_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_collateral_inputs": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_epoch": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_tx_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_tx_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_value_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "min_pool_cost": { + "type": [ + "string", + "null" + ] + }, + "minfee_a": { + "type": [ + "string", + "null" + ] + }, + "minfee_b": { + "type": [ + "string", + "null" + ] + }, + "n_opt": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "pool_deposit": { + "type": [ + "string", + "null" + ] + }, + "pool_pledge_influence": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "protocol_version": { + "anyOf": [ + { + "$ref": "#/definitions/ProtocolVersion" + }, + { + "type": "null" + } + ] + }, + "treasury_growth_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/ProtocolParamUpdate.json b/rust/json-gen/schemas/ProtocolParamUpdate.json new file mode 100644 index 0000000..83a182c --- /dev/null +++ b/rust/json-gen/schemas/ProtocolParamUpdate.json @@ -0,0 +1,303 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ProtocolParamUpdate", + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "type": [ + "string", + "null" + ] + }, + "collateral_percentage": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "cost_models": { + "anyOf": [ + { + "$ref": "#/definitions/Costmdls" + }, + { + "type": "null" + } + ] + }, + "d": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "execution_costs": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnitPrices" + }, + { + "type": "null" + } + ] + }, + "expansion_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "extra_entropy": { + "anyOf": [ + { + "$ref": "#/definitions/Nonce" + }, + { + "type": "null" + } + ] + }, + "key_deposit": { + "type": [ + "string", + "null" + ] + }, + "max_block_body_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_block_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_block_header_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_collateral_inputs": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_epoch": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_tx_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_tx_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_value_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "min_pool_cost": { + "type": [ + "string", + "null" + ] + }, + "minfee_a": { + "type": [ + "string", + "null" + ] + }, + "minfee_b": { + "type": [ + "string", + "null" + ] + }, + "n_opt": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "pool_deposit": { + "type": [ + "string", + "null" + ] + }, + "pool_pledge_influence": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "protocol_version": { + "anyOf": [ + { + "$ref": "#/definitions/ProtocolVersion" + }, + { + "type": "null" + } + ] + }, + "treasury_growth_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + }, + "Costmdls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + } + }, + "ExUnitPrices": { + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "Nonce": { + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/ProtocolVersion.json b/rust/json-gen/schemas/ProtocolVersion.json new file mode 100644 index 0000000..6f924d8 --- /dev/null +++ b/rust/json-gen/schemas/ProtocolVersion.json @@ -0,0 +1,21 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ProtocolVersion", + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/PublicKey.json b/rust/json-gen/schemas/PublicKey.json new file mode 100644 index 0000000..6cd576a --- /dev/null +++ b/rust/json-gen/schemas/PublicKey.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PublicKey", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Redeemer.json b/rust/json-gen/schemas/Redeemer.json new file mode 100644 index 0000000..6ec90dc --- /dev/null +++ b/rust/json-gen/schemas/Redeemer.json @@ -0,0 +1,54 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Redeemer", + "type": "object", + "required": [ + "data", + "ex_units", + "index", + "tag" + ], + "properties": { + "data": { + "type": "string" + }, + "ex_units": { + "$ref": "#/definitions/ExUnits" + }, + "index": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/RedeemerTag" + } + }, + "definitions": { + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "RedeemerTag": { + "$ref": "#/definitions/RedeemerTagKind" + }, + "RedeemerTagKind": { + "type": "string", + "enum": [ + "Spend", + "Mint", + "Cert", + "Reward" + ] + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/RedeemerTag.json b/rust/json-gen/schemas/RedeemerTag.json new file mode 100644 index 0000000..49c1008 --- /dev/null +++ b/rust/json-gen/schemas/RedeemerTag.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RedeemerTag", + "allOf": [ + { + "$ref": "#/definitions/RedeemerTagKind" + } + ], + "definitions": { + "RedeemerTagKind": { + "type": "string", + "enum": [ + "Spend", + "Mint", + "Cert", + "Reward" + ] + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/RedeemerTagKind.json b/rust/json-gen/schemas/RedeemerTagKind.json new file mode 100644 index 0000000..8d11791 --- /dev/null +++ b/rust/json-gen/schemas/RedeemerTagKind.json @@ -0,0 +1,11 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RedeemerTagKind", + "type": "string", + "enum": [ + "Spend", + "Mint", + "Cert", + "Reward" + ] +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Redeemers.json b/rust/json-gen/schemas/Redeemers.json new file mode 100644 index 0000000..22fed16 --- /dev/null +++ b/rust/json-gen/schemas/Redeemers.json @@ -0,0 +1,60 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Redeemers", + "type": "array", + "items": { + "$ref": "#/definitions/Redeemer" + }, + "definitions": { + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "Redeemer": { + "type": "object", + "required": [ + "data", + "ex_units", + "index", + "tag" + ], + "properties": { + "data": { + "type": "string" + }, + "ex_units": { + "$ref": "#/definitions/ExUnits" + }, + "index": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/RedeemerTag" + } + } + }, + "RedeemerTag": { + "$ref": "#/definitions/RedeemerTagKind" + }, + "RedeemerTagKind": { + "type": "string", + "enum": [ + "Spend", + "Mint", + "Cert", + "Reward" + ] + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Relay.json b/rust/json-gen/schemas/Relay.json new file mode 100644 index 0000000..40c1870 --- /dev/null +++ b/rust/json-gen/schemas/Relay.json @@ -0,0 +1,140 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Relay", + "allOf": [ + { + "$ref": "#/definitions/RelayEnum" + } + ], + "definitions": { + "DNSRecordAorAAAA": { + "type": "string" + }, + "DNSRecordSRV": { + "type": "string" + }, + "Ipv4": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 4, + "minItems": 4 + }, + "Ipv6": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 16, + "minItems": 16 + }, + "MultiHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordSRV" + } + } + }, + "RelayEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "SingleHostAddr" + ], + "properties": { + "SingleHostAddr": { + "$ref": "#/definitions/SingleHostAddr" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "SingleHostName" + ], + "properties": { + "SingleHostName": { + "$ref": "#/definitions/SingleHostName" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MultiHostName" + ], + "properties": { + "MultiHostName": { + "$ref": "#/definitions/MultiHostName" + } + }, + "additionalProperties": false + } + ] + }, + "SingleHostAddr": { + "type": "object", + "properties": { + "ipv4": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv4" + }, + { + "type": "null" + } + ] + }, + "ipv6": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv6" + }, + { + "type": "null" + } + ] + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "SingleHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordAorAAAA" + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Relays.json b/rust/json-gen/schemas/Relays.json new file mode 100644 index 0000000..73fe294 --- /dev/null +++ b/rust/json-gen/schemas/Relays.json @@ -0,0 +1,142 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Relays", + "type": "array", + "items": { + "$ref": "#/definitions/Relay" + }, + "definitions": { + "DNSRecordAorAAAA": { + "type": "string" + }, + "DNSRecordSRV": { + "type": "string" + }, + "Ipv4": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 4, + "minItems": 4 + }, + "Ipv6": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 16, + "minItems": 16 + }, + "MultiHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordSRV" + } + } + }, + "Relay": { + "$ref": "#/definitions/RelayEnum" + }, + "RelayEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "SingleHostAddr" + ], + "properties": { + "SingleHostAddr": { + "$ref": "#/definitions/SingleHostAddr" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "SingleHostName" + ], + "properties": { + "SingleHostName": { + "$ref": "#/definitions/SingleHostName" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MultiHostName" + ], + "properties": { + "MultiHostName": { + "$ref": "#/definitions/MultiHostName" + } + }, + "additionalProperties": false + } + ] + }, + "SingleHostAddr": { + "type": "object", + "properties": { + "ipv4": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv4" + }, + { + "type": "null" + } + ] + }, + "ipv6": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv6" + }, + { + "type": "null" + } + ] + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "SingleHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordAorAAAA" + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/RewardAddress.json b/rust/json-gen/schemas/RewardAddress.json new file mode 100644 index 0000000..1e9413d --- /dev/null +++ b/rust/json-gen/schemas/RewardAddress.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RewardAddress", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/RewardAddresses.json b/rust/json-gen/schemas/RewardAddresses.json new file mode 100644 index 0000000..f774837 --- /dev/null +++ b/rust/json-gen/schemas/RewardAddresses.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RewardAddresses", + "type": "array", + "items": { + "type": "string" + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/ScriptAll.json b/rust/json-gen/schemas/ScriptAll.json new file mode 100644 index 0000000..aef6698 --- /dev/null +++ b/rust/json-gen/schemas/ScriptAll.json @@ -0,0 +1,172 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ScriptAll", + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + }, + "definitions": { + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/ScriptAny.json b/rust/json-gen/schemas/ScriptAny.json new file mode 100644 index 0000000..e4a61e5 --- /dev/null +++ b/rust/json-gen/schemas/ScriptAny.json @@ -0,0 +1,172 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ScriptAny", + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + }, + "definitions": { + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/ScriptDataHash.json b/rust/json-gen/schemas/ScriptDataHash.json new file mode 100644 index 0000000..3beb632 --- /dev/null +++ b/rust/json-gen/schemas/ScriptDataHash.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ScriptDataHash", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/ScriptHash.json b/rust/json-gen/schemas/ScriptHash.json new file mode 100644 index 0000000..6cd730e --- /dev/null +++ b/rust/json-gen/schemas/ScriptHash.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ScriptHash", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/ScriptHashes.json b/rust/json-gen/schemas/ScriptHashes.json new file mode 100644 index 0000000..2de4c37 --- /dev/null +++ b/rust/json-gen/schemas/ScriptHashes.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ScriptHashes", + "type": "array", + "items": { + "type": "string" + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/ScriptNOfK.json b/rust/json-gen/schemas/ScriptNOfK.json new file mode 100644 index 0000000..76f2e44 --- /dev/null +++ b/rust/json-gen/schemas/ScriptNOfK.json @@ -0,0 +1,178 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ScriptNOfK", + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + }, + "definitions": { + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/ScriptPubkey.json b/rust/json-gen/schemas/ScriptPubkey.json new file mode 100644 index 0000000..5dbf5ba --- /dev/null +++ b/rust/json-gen/schemas/ScriptPubkey.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ScriptPubkey", + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/ScriptRef.json b/rust/json-gen/schemas/ScriptRef.json new file mode 100644 index 0000000..9962ce4 --- /dev/null +++ b/rust/json-gen/schemas/ScriptRef.json @@ -0,0 +1,196 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ScriptRef", + "allOf": [ + { + "$ref": "#/definitions/ScriptRefEnum" + } + ], + "definitions": { + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "ScriptRefEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "NativeScript" + ], + "properties": { + "NativeScript": { + "$ref": "#/definitions/NativeScript" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PlutusScript" + ], + "properties": { + "PlutusScript": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/SingleHostAddr.json b/rust/json-gen/schemas/SingleHostAddr.json new file mode 100644 index 0000000..33910c3 --- /dev/null +++ b/rust/json-gen/schemas/SingleHostAddr.json @@ -0,0 +1,57 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SingleHostAddr", + "type": "object", + "properties": { + "ipv4": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv4" + }, + { + "type": "null" + } + ] + }, + "ipv6": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv6" + }, + { + "type": "null" + } + ] + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + }, + "definitions": { + "Ipv4": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 4, + "minItems": 4 + }, + "Ipv6": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 16, + "minItems": 16 + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/SingleHostName.json b/rust/json-gen/schemas/SingleHostName.json new file mode 100644 index 0000000..cea7076 --- /dev/null +++ b/rust/json-gen/schemas/SingleHostName.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SingleHostName", + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordAorAAAA" + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + }, + "definitions": { + "DNSRecordAorAAAA": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/StakeCredType.json b/rust/json-gen/schemas/StakeCredType.json new file mode 100644 index 0000000..4e6ba52 --- /dev/null +++ b/rust/json-gen/schemas/StakeCredType.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "StakeCredType", + "oneOf": [ + { + "type": "object", + "required": [ + "Key" + ], + "properties": { + "Key": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Script" + ], + "properties": { + "Script": { + "type": "string" + } + }, + "additionalProperties": false + } + ] +} \ No newline at end of file diff --git a/rust/json-gen/schemas/StakeCredential.json b/rust/json-gen/schemas/StakeCredential.json new file mode 100644 index 0000000..31e1782 --- /dev/null +++ b/rust/json-gen/schemas/StakeCredential.json @@ -0,0 +1,39 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "StakeCredential", + "allOf": [ + { + "$ref": "#/definitions/StakeCredType" + } + ], + "definitions": { + "StakeCredType": { + "oneOf": [ + { + "type": "object", + "required": [ + "Key" + ], + "properties": { + "Key": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Script" + ], + "properties": { + "Script": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/StakeCredentials.json b/rust/json-gen/schemas/StakeCredentials.json new file mode 100644 index 0000000..e562e0f --- /dev/null +++ b/rust/json-gen/schemas/StakeCredentials.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "StakeCredentials", + "type": "array", + "items": { + "$ref": "#/definitions/StakeCredential" + }, + "definitions": { + "StakeCredType": { + "oneOf": [ + { + "type": "object", + "required": [ + "Key" + ], + "properties": { + "Key": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Script" + ], + "properties": { + "Script": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "StakeCredential": { + "$ref": "#/definitions/StakeCredType" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/StakeDelegation.json b/rust/json-gen/schemas/StakeDelegation.json new file mode 100644 index 0000000..b98831d --- /dev/null +++ b/rust/json-gen/schemas/StakeDelegation.json @@ -0,0 +1,50 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "StakeDelegation", + "type": "object", + "required": [ + "pool_keyhash", + "stake_credential" + ], + "properties": { + "pool_keyhash": { + "type": "string" + }, + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + }, + "definitions": { + "StakeCredType": { + "oneOf": [ + { + "type": "object", + "required": [ + "Key" + ], + "properties": { + "Key": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Script" + ], + "properties": { + "Script": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "StakeCredential": { + "$ref": "#/definitions/StakeCredType" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/StakeDeregistration.json b/rust/json-gen/schemas/StakeDeregistration.json new file mode 100644 index 0000000..375f14c --- /dev/null +++ b/rust/json-gen/schemas/StakeDeregistration.json @@ -0,0 +1,46 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "StakeDeregistration", + "type": "object", + "required": [ + "stake_credential" + ], + "properties": { + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + }, + "definitions": { + "StakeCredType": { + "oneOf": [ + { + "type": "object", + "required": [ + "Key" + ], + "properties": { + "Key": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Script" + ], + "properties": { + "Script": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "StakeCredential": { + "$ref": "#/definitions/StakeCredType" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/StakeRegistration.json b/rust/json-gen/schemas/StakeRegistration.json new file mode 100644 index 0000000..3ba83d3 --- /dev/null +++ b/rust/json-gen/schemas/StakeRegistration.json @@ -0,0 +1,46 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "StakeRegistration", + "type": "object", + "required": [ + "stake_credential" + ], + "properties": { + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + }, + "definitions": { + "StakeCredType": { + "oneOf": [ + { + "type": "object", + "required": [ + "Key" + ], + "properties": { + "Key": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Script" + ], + "properties": { + "Script": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "StakeCredential": { + "$ref": "#/definitions/StakeCredType" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/TimelockExpiry.json b/rust/json-gen/schemas/TimelockExpiry.json new file mode 100644 index 0000000..64b85f8 --- /dev/null +++ b/rust/json-gen/schemas/TimelockExpiry.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TimelockExpiry", + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/TimelockStart.json b/rust/json-gen/schemas/TimelockStart.json new file mode 100644 index 0000000..6a875c2 --- /dev/null +++ b/rust/json-gen/schemas/TimelockStart.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TimelockStart", + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Transaction.json b/rust/json-gen/schemas/Transaction.json new file mode 100644 index 0000000..a1b78dd --- /dev/null +++ b/rust/json-gen/schemas/Transaction.json @@ -0,0 +1,1557 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Transaction", + "type": "object", + "required": [ + "body", + "is_valid", + "witness_set" + ], + "properties": { + "auxiliary_data": { + "anyOf": [ + { + "$ref": "#/definitions/AuxiliaryData" + }, + { + "type": "null" + } + ] + }, + "body": { + "$ref": "#/definitions/TransactionBody" + }, + "is_valid": { + "type": "boolean" + }, + "witness_set": { + "$ref": "#/definitions/TransactionWitnessSet" + } + }, + "definitions": { + "Assets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "AuxiliaryData": { + "type": "object", + "required": [ + "prefer_alonzo_format" + ], + "properties": { + "metadata": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "native_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/NativeScripts" + }, + { + "type": "null" + } + ] + }, + "plutus_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/PlutusScripts" + }, + { + "type": "null" + } + ] + }, + "prefer_alonzo_format": { + "type": "boolean" + } + } + }, + "BootstrapWitness": { + "type": "object", + "required": [ + "attributes", + "chain_code", + "signature", + "vkey" + ], + "properties": { + "attributes": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "chain_code": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "signature": { + "type": "string" + }, + "vkey": { + "$ref": "#/definitions/Vkey" + } + } + }, + "BootstrapWitnesses": { + "type": "array", + "items": { + "$ref": "#/definitions/BootstrapWitness" + } + }, + "Certificate": { + "$ref": "#/definitions/CertificateEnum" + }, + "CertificateEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "StakeRegistration" + ], + "properties": { + "StakeRegistration": { + "$ref": "#/definitions/StakeRegistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "StakeDeregistration" + ], + "properties": { + "StakeDeregistration": { + "$ref": "#/definitions/StakeDeregistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "StakeDelegation" + ], + "properties": { + "StakeDelegation": { + "$ref": "#/definitions/StakeDelegation" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PoolRegistration" + ], + "properties": { + "PoolRegistration": { + "$ref": "#/definitions/PoolRegistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PoolRetirement" + ], + "properties": { + "PoolRetirement": { + "$ref": "#/definitions/PoolRetirement" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "GenesisKeyDelegation" + ], + "properties": { + "GenesisKeyDelegation": { + "$ref": "#/definitions/GenesisKeyDelegation" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MoveInstantaneousRewardsCert" + ], + "properties": { + "MoveInstantaneousRewardsCert": { + "$ref": "#/definitions/MoveInstantaneousRewardsCert" + } + }, + "additionalProperties": false + } + ] + }, + "Certificates": { + "type": "array", + "items": { + "$ref": "#/definitions/Certificate" + } + }, + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + }, + "Costmdls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + } + }, + "DNSRecordAorAAAA": { + "type": "string" + }, + "DNSRecordSRV": { + "type": "string" + }, + "DataOption": { + "oneOf": [ + { + "type": "object", + "required": [ + "DataHash" + ], + "properties": { + "DataHash": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Data" + ], + "properties": { + "Data": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "Ed25519KeyHashes": { + "type": "array", + "items": { + "type": "string" + } + }, + "ExUnitPrices": { + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "GenesisKeyDelegation": { + "type": "object", + "required": [ + "genesis_delegate_hash", + "genesishash", + "vrf_keyhash" + ], + "properties": { + "genesis_delegate_hash": { + "type": "string" + }, + "genesishash": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + } + }, + "Ipv4": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 4, + "minItems": 4 + }, + "Ipv6": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 16, + "minItems": 16 + }, + "MIREnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ToOtherPot" + ], + "properties": { + "ToOtherPot": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ToStakeCredentials" + ], + "properties": { + "ToStakeCredentials": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + }, + "additionalProperties": false + } + ] + }, + "MIRPot": { + "type": "string", + "enum": [ + "Reserves", + "Treasury" + ] + }, + "Mint": { + "type": "array", + "items": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/MintAssets" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "MintAssets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "MoveInstantaneousReward": { + "type": "object", + "required": [ + "pot", + "variant" + ], + "properties": { + "pot": { + "$ref": "#/definitions/MIRPot" + }, + "variant": { + "$ref": "#/definitions/MIREnum" + } + } + }, + "MoveInstantaneousRewardsCert": { + "type": "object", + "required": [ + "move_instantaneous_reward" + ], + "properties": { + "move_instantaneous_reward": { + "$ref": "#/definitions/MoveInstantaneousReward" + } + } + }, + "MultiAsset": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Assets" + } + }, + "MultiHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordSRV" + } + } + }, + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "NetworkId": { + "$ref": "#/definitions/NetworkIdKind" + }, + "NetworkIdKind": { + "type": "string", + "enum": [ + "Testnet", + "Mainnet" + ] + }, + "Nonce": { + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } + }, + "PlutusList": { + "type": "object", + "required": [ + "elems" + ], + "properties": { + "definite_encoding": { + "type": [ + "boolean", + "null" + ] + }, + "elems": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PlutusScripts": { + "type": "array", + "items": { + "type": "string" + } + }, + "PoolMetadata": { + "type": "object", + "required": [ + "pool_metadata_hash", + "url" + ], + "properties": { + "pool_metadata_hash": { + "type": "string" + }, + "url": { + "$ref": "#/definitions/URL" + } + } + }, + "PoolParams": { + "type": "object", + "required": [ + "cost", + "margin", + "operator", + "pledge", + "pool_owners", + "relays", + "reward_account", + "vrf_keyhash" + ], + "properties": { + "cost": { + "type": "string" + }, + "margin": { + "$ref": "#/definitions/UnitInterval" + }, + "operator": { + "type": "string" + }, + "pledge": { + "type": "string" + }, + "pool_metadata": { + "anyOf": [ + { + "$ref": "#/definitions/PoolMetadata" + }, + { + "type": "null" + } + ] + }, + "pool_owners": { + "$ref": "#/definitions/Ed25519KeyHashes" + }, + "relays": { + "$ref": "#/definitions/Relays" + }, + "reward_account": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + } + }, + "PoolRegistration": { + "type": "object", + "required": [ + "pool_params" + ], + "properties": { + "pool_params": { + "$ref": "#/definitions/PoolParams" + } + } + }, + "PoolRetirement": { + "type": "object", + "required": [ + "epoch", + "pool_keyhash" + ], + "properties": { + "epoch": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "pool_keyhash": { + "type": "string" + } + } + }, + "ProtocolParamUpdate": { + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "type": [ + "string", + "null" + ] + }, + "collateral_percentage": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "cost_models": { + "anyOf": [ + { + "$ref": "#/definitions/Costmdls" + }, + { + "type": "null" + } + ] + }, + "d": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "execution_costs": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnitPrices" + }, + { + "type": "null" + } + ] + }, + "expansion_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "extra_entropy": { + "anyOf": [ + { + "$ref": "#/definitions/Nonce" + }, + { + "type": "null" + } + ] + }, + "key_deposit": { + "type": [ + "string", + "null" + ] + }, + "max_block_body_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_block_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_block_header_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_collateral_inputs": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_epoch": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_tx_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_tx_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_value_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "min_pool_cost": { + "type": [ + "string", + "null" + ] + }, + "minfee_a": { + "type": [ + "string", + "null" + ] + }, + "minfee_b": { + "type": [ + "string", + "null" + ] + }, + "n_opt": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "pool_deposit": { + "type": [ + "string", + "null" + ] + }, + "pool_pledge_influence": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "protocol_version": { + "anyOf": [ + { + "$ref": "#/definitions/ProtocolVersion" + }, + { + "type": "null" + } + ] + }, + "treasury_growth_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "Redeemer": { + "type": "object", + "required": [ + "data", + "ex_units", + "index", + "tag" + ], + "properties": { + "data": { + "type": "string" + }, + "ex_units": { + "$ref": "#/definitions/ExUnits" + }, + "index": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/RedeemerTag" + } + } + }, + "RedeemerTag": { + "$ref": "#/definitions/RedeemerTagKind" + }, + "RedeemerTagKind": { + "type": "string", + "enum": [ + "Spend", + "Mint", + "Cert", + "Reward" + ] + }, + "Redeemers": { + "type": "array", + "items": { + "$ref": "#/definitions/Redeemer" + } + }, + "Relay": { + "$ref": "#/definitions/RelayEnum" + }, + "RelayEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "SingleHostAddr" + ], + "properties": { + "SingleHostAddr": { + "$ref": "#/definitions/SingleHostAddr" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "SingleHostName" + ], + "properties": { + "SingleHostName": { + "$ref": "#/definitions/SingleHostName" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MultiHostName" + ], + "properties": { + "MultiHostName": { + "$ref": "#/definitions/MultiHostName" + } + }, + "additionalProperties": false + } + ] + }, + "Relays": { + "type": "array", + "items": { + "$ref": "#/definitions/Relay" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "ScriptRef": { + "$ref": "#/definitions/ScriptRefEnum" + }, + "ScriptRefEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "NativeScript" + ], + "properties": { + "NativeScript": { + "$ref": "#/definitions/NativeScript" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PlutusScript" + ], + "properties": { + "PlutusScript": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "SingleHostAddr": { + "type": "object", + "properties": { + "ipv4": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv4" + }, + { + "type": "null" + } + ] + }, + "ipv6": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv6" + }, + { + "type": "null" + } + ] + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "SingleHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordAorAAAA" + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "StakeCredType": { + "oneOf": [ + { + "type": "object", + "required": [ + "Key" + ], + "properties": { + "Key": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Script" + ], + "properties": { + "Script": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "StakeCredential": { + "$ref": "#/definitions/StakeCredType" + }, + "StakeDelegation": { + "type": "object", + "required": [ + "pool_keyhash", + "stake_credential" + ], + "properties": { + "pool_keyhash": { + "type": "string" + }, + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "StakeDeregistration": { + "type": "object", + "required": [ + "stake_credential" + ], + "properties": { + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "StakeRegistration": { + "type": "object", + "required": [ + "stake_credential" + ], + "properties": { + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TransactionBody": { + "type": "object", + "required": [ + "fee", + "inputs", + "outputs" + ], + "properties": { + "auxiliary_data_hash": { + "type": [ + "string", + "null" + ] + }, + "certs": { + "anyOf": [ + { + "$ref": "#/definitions/Certificates" + }, + { + "type": "null" + } + ] + }, + "collateral": { + "anyOf": [ + { + "$ref": "#/definitions/TransactionInputs" + }, + { + "type": "null" + } + ] + }, + "collateral_return": { + "anyOf": [ + { + "$ref": "#/definitions/TransactionOutput" + }, + { + "type": "null" + } + ] + }, + "fee": { + "type": "string" + }, + "inputs": { + "$ref": "#/definitions/TransactionInputs" + }, + "mint": { + "anyOf": [ + { + "$ref": "#/definitions/Mint" + }, + { + "type": "null" + } + ] + }, + "network_id": { + "anyOf": [ + { + "$ref": "#/definitions/NetworkId" + }, + { + "type": "null" + } + ] + }, + "outputs": { + "$ref": "#/definitions/TransactionOutputs" + }, + "reference_inputs": { + "anyOf": [ + { + "$ref": "#/definitions/TransactionInputs" + }, + { + "type": "null" + } + ] + }, + "required_signers": { + "anyOf": [ + { + "$ref": "#/definitions/Ed25519KeyHashes" + }, + { + "type": "null" + } + ] + }, + "script_data_hash": { + "type": [ + "string", + "null" + ] + }, + "total_collateral": { + "type": [ + "string", + "null" + ] + }, + "ttl": { + "type": [ + "string", + "null" + ] + }, + "update": { + "anyOf": [ + { + "$ref": "#/definitions/Update" + }, + { + "type": "null" + } + ] + }, + "validity_start_interval": { + "type": [ + "string", + "null" + ] + }, + "withdrawals": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + } + }, + "TransactionInput": { + "type": "object", + "required": [ + "index", + "transaction_id" + ], + "properties": { + "index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "transaction_id": { + "type": "string" + } + } + }, + "TransactionInputs": { + "type": "array", + "items": { + "$ref": "#/definitions/TransactionInput" + } + }, + "TransactionOutput": { + "type": "object", + "required": [ + "address", + "amount" + ], + "properties": { + "address": { + "type": "string" + }, + "amount": { + "$ref": "#/definitions/Value" + }, + "plutus_data": { + "anyOf": [ + { + "$ref": "#/definitions/DataOption" + }, + { + "type": "null" + } + ] + }, + "script_ref": { + "anyOf": [ + { + "$ref": "#/definitions/ScriptRef" + }, + { + "type": "null" + } + ] + } + } + }, + "TransactionOutputs": { + "type": "array", + "items": { + "$ref": "#/definitions/TransactionOutput" + } + }, + "TransactionWitnessSet": { + "type": "object", + "properties": { + "bootstraps": { + "anyOf": [ + { + "$ref": "#/definitions/BootstrapWitnesses" + }, + { + "type": "null" + } + ] + }, + "native_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/NativeScripts" + }, + { + "type": "null" + } + ] + }, + "plutus_data": { + "anyOf": [ + { + "$ref": "#/definitions/PlutusList" + }, + { + "type": "null" + } + ] + }, + "plutus_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/PlutusScripts" + }, + { + "type": "null" + } + ] + }, + "redeemers": { + "anyOf": [ + { + "$ref": "#/definitions/Redeemers" + }, + { + "type": "null" + } + ] + }, + "vkeys": { + "anyOf": [ + { + "$ref": "#/definitions/Vkeywitnesses" + }, + { + "type": "null" + } + ] + } + } + }, + "URL": { + "type": "string" + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + }, + "Update": { + "type": "object", + "required": [ + "epoch", + "proposed_protocol_parameter_updates" + ], + "properties": { + "epoch": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "proposed_protocol_parameter_updates": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + } + }, + "Value": { + "type": "object", + "required": [ + "coin" + ], + "properties": { + "coin": { + "type": "string" + }, + "multiasset": { + "anyOf": [ + { + "$ref": "#/definitions/MultiAsset" + }, + { + "type": "null" + } + ] + } + } + }, + "Vkey": { + "type": "string" + }, + "Vkeywitness": { + "type": "object", + "required": [ + "signature", + "vkey" + ], + "properties": { + "signature": { + "type": "string" + }, + "vkey": { + "$ref": "#/definitions/Vkey" + } + } + }, + "Vkeywitnesses": { + "type": "array", + "items": { + "$ref": "#/definitions/Vkeywitness" + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/TransactionBodies.json b/rust/json-gen/schemas/TransactionBodies.json new file mode 100644 index 0000000..c7f0597 --- /dev/null +++ b/rust/json-gen/schemas/TransactionBodies.json @@ -0,0 +1,1299 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TransactionBodies", + "type": "array", + "items": { + "$ref": "#/definitions/TransactionBody" + }, + "definitions": { + "Assets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Certificate": { + "$ref": "#/definitions/CertificateEnum" + }, + "CertificateEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "StakeRegistration" + ], + "properties": { + "StakeRegistration": { + "$ref": "#/definitions/StakeRegistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "StakeDeregistration" + ], + "properties": { + "StakeDeregistration": { + "$ref": "#/definitions/StakeDeregistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "StakeDelegation" + ], + "properties": { + "StakeDelegation": { + "$ref": "#/definitions/StakeDelegation" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PoolRegistration" + ], + "properties": { + "PoolRegistration": { + "$ref": "#/definitions/PoolRegistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PoolRetirement" + ], + "properties": { + "PoolRetirement": { + "$ref": "#/definitions/PoolRetirement" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "GenesisKeyDelegation" + ], + "properties": { + "GenesisKeyDelegation": { + "$ref": "#/definitions/GenesisKeyDelegation" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MoveInstantaneousRewardsCert" + ], + "properties": { + "MoveInstantaneousRewardsCert": { + "$ref": "#/definitions/MoveInstantaneousRewardsCert" + } + }, + "additionalProperties": false + } + ] + }, + "Certificates": { + "type": "array", + "items": { + "$ref": "#/definitions/Certificate" + } + }, + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + }, + "Costmdls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + } + }, + "DNSRecordAorAAAA": { + "type": "string" + }, + "DNSRecordSRV": { + "type": "string" + }, + "DataOption": { + "oneOf": [ + { + "type": "object", + "required": [ + "DataHash" + ], + "properties": { + "DataHash": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Data" + ], + "properties": { + "Data": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "Ed25519KeyHashes": { + "type": "array", + "items": { + "type": "string" + } + }, + "ExUnitPrices": { + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "GenesisKeyDelegation": { + "type": "object", + "required": [ + "genesis_delegate_hash", + "genesishash", + "vrf_keyhash" + ], + "properties": { + "genesis_delegate_hash": { + "type": "string" + }, + "genesishash": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + } + }, + "Ipv4": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 4, + "minItems": 4 + }, + "Ipv6": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 16, + "minItems": 16 + }, + "MIREnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ToOtherPot" + ], + "properties": { + "ToOtherPot": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ToStakeCredentials" + ], + "properties": { + "ToStakeCredentials": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + }, + "additionalProperties": false + } + ] + }, + "MIRPot": { + "type": "string", + "enum": [ + "Reserves", + "Treasury" + ] + }, + "Mint": { + "type": "array", + "items": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/MintAssets" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "MintAssets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "MoveInstantaneousReward": { + "type": "object", + "required": [ + "pot", + "variant" + ], + "properties": { + "pot": { + "$ref": "#/definitions/MIRPot" + }, + "variant": { + "$ref": "#/definitions/MIREnum" + } + } + }, + "MoveInstantaneousRewardsCert": { + "type": "object", + "required": [ + "move_instantaneous_reward" + ], + "properties": { + "move_instantaneous_reward": { + "$ref": "#/definitions/MoveInstantaneousReward" + } + } + }, + "MultiAsset": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Assets" + } + }, + "MultiHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordSRV" + } + } + }, + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "NetworkId": { + "$ref": "#/definitions/NetworkIdKind" + }, + "NetworkIdKind": { + "type": "string", + "enum": [ + "Testnet", + "Mainnet" + ] + }, + "Nonce": { + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } + }, + "PoolMetadata": { + "type": "object", + "required": [ + "pool_metadata_hash", + "url" + ], + "properties": { + "pool_metadata_hash": { + "type": "string" + }, + "url": { + "$ref": "#/definitions/URL" + } + } + }, + "PoolParams": { + "type": "object", + "required": [ + "cost", + "margin", + "operator", + "pledge", + "pool_owners", + "relays", + "reward_account", + "vrf_keyhash" + ], + "properties": { + "cost": { + "type": "string" + }, + "margin": { + "$ref": "#/definitions/UnitInterval" + }, + "operator": { + "type": "string" + }, + "pledge": { + "type": "string" + }, + "pool_metadata": { + "anyOf": [ + { + "$ref": "#/definitions/PoolMetadata" + }, + { + "type": "null" + } + ] + }, + "pool_owners": { + "$ref": "#/definitions/Ed25519KeyHashes" + }, + "relays": { + "$ref": "#/definitions/Relays" + }, + "reward_account": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + } + }, + "PoolRegistration": { + "type": "object", + "required": [ + "pool_params" + ], + "properties": { + "pool_params": { + "$ref": "#/definitions/PoolParams" + } + } + }, + "PoolRetirement": { + "type": "object", + "required": [ + "epoch", + "pool_keyhash" + ], + "properties": { + "epoch": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "pool_keyhash": { + "type": "string" + } + } + }, + "ProtocolParamUpdate": { + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "type": [ + "string", + "null" + ] + }, + "collateral_percentage": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "cost_models": { + "anyOf": [ + { + "$ref": "#/definitions/Costmdls" + }, + { + "type": "null" + } + ] + }, + "d": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "execution_costs": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnitPrices" + }, + { + "type": "null" + } + ] + }, + "expansion_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "extra_entropy": { + "anyOf": [ + { + "$ref": "#/definitions/Nonce" + }, + { + "type": "null" + } + ] + }, + "key_deposit": { + "type": [ + "string", + "null" + ] + }, + "max_block_body_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_block_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_block_header_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_collateral_inputs": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_epoch": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_tx_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_tx_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_value_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "min_pool_cost": { + "type": [ + "string", + "null" + ] + }, + "minfee_a": { + "type": [ + "string", + "null" + ] + }, + "minfee_b": { + "type": [ + "string", + "null" + ] + }, + "n_opt": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "pool_deposit": { + "type": [ + "string", + "null" + ] + }, + "pool_pledge_influence": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "protocol_version": { + "anyOf": [ + { + "$ref": "#/definitions/ProtocolVersion" + }, + { + "type": "null" + } + ] + }, + "treasury_growth_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "Relay": { + "$ref": "#/definitions/RelayEnum" + }, + "RelayEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "SingleHostAddr" + ], + "properties": { + "SingleHostAddr": { + "$ref": "#/definitions/SingleHostAddr" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "SingleHostName" + ], + "properties": { + "SingleHostName": { + "$ref": "#/definitions/SingleHostName" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MultiHostName" + ], + "properties": { + "MultiHostName": { + "$ref": "#/definitions/MultiHostName" + } + }, + "additionalProperties": false + } + ] + }, + "Relays": { + "type": "array", + "items": { + "$ref": "#/definitions/Relay" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "ScriptRef": { + "$ref": "#/definitions/ScriptRefEnum" + }, + "ScriptRefEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "NativeScript" + ], + "properties": { + "NativeScript": { + "$ref": "#/definitions/NativeScript" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PlutusScript" + ], + "properties": { + "PlutusScript": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "SingleHostAddr": { + "type": "object", + "properties": { + "ipv4": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv4" + }, + { + "type": "null" + } + ] + }, + "ipv6": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv6" + }, + { + "type": "null" + } + ] + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "SingleHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordAorAAAA" + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "StakeCredType": { + "oneOf": [ + { + "type": "object", + "required": [ + "Key" + ], + "properties": { + "Key": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Script" + ], + "properties": { + "Script": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "StakeCredential": { + "$ref": "#/definitions/StakeCredType" + }, + "StakeDelegation": { + "type": "object", + "required": [ + "pool_keyhash", + "stake_credential" + ], + "properties": { + "pool_keyhash": { + "type": "string" + }, + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "StakeDeregistration": { + "type": "object", + "required": [ + "stake_credential" + ], + "properties": { + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "StakeRegistration": { + "type": "object", + "required": [ + "stake_credential" + ], + "properties": { + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TransactionBody": { + "type": "object", + "required": [ + "fee", + "inputs", + "outputs" + ], + "properties": { + "auxiliary_data_hash": { + "type": [ + "string", + "null" + ] + }, + "certs": { + "anyOf": [ + { + "$ref": "#/definitions/Certificates" + }, + { + "type": "null" + } + ] + }, + "collateral": { + "anyOf": [ + { + "$ref": "#/definitions/TransactionInputs" + }, + { + "type": "null" + } + ] + }, + "collateral_return": { + "anyOf": [ + { + "$ref": "#/definitions/TransactionOutput" + }, + { + "type": "null" + } + ] + }, + "fee": { + "type": "string" + }, + "inputs": { + "$ref": "#/definitions/TransactionInputs" + }, + "mint": { + "anyOf": [ + { + "$ref": "#/definitions/Mint" + }, + { + "type": "null" + } + ] + }, + "network_id": { + "anyOf": [ + { + "$ref": "#/definitions/NetworkId" + }, + { + "type": "null" + } + ] + }, + "outputs": { + "$ref": "#/definitions/TransactionOutputs" + }, + "reference_inputs": { + "anyOf": [ + { + "$ref": "#/definitions/TransactionInputs" + }, + { + "type": "null" + } + ] + }, + "required_signers": { + "anyOf": [ + { + "$ref": "#/definitions/Ed25519KeyHashes" + }, + { + "type": "null" + } + ] + }, + "script_data_hash": { + "type": [ + "string", + "null" + ] + }, + "total_collateral": { + "type": [ + "string", + "null" + ] + }, + "ttl": { + "type": [ + "string", + "null" + ] + }, + "update": { + "anyOf": [ + { + "$ref": "#/definitions/Update" + }, + { + "type": "null" + } + ] + }, + "validity_start_interval": { + "type": [ + "string", + "null" + ] + }, + "withdrawals": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + } + }, + "TransactionInput": { + "type": "object", + "required": [ + "index", + "transaction_id" + ], + "properties": { + "index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "transaction_id": { + "type": "string" + } + } + }, + "TransactionInputs": { + "type": "array", + "items": { + "$ref": "#/definitions/TransactionInput" + } + }, + "TransactionOutput": { + "type": "object", + "required": [ + "address", + "amount" + ], + "properties": { + "address": { + "type": "string" + }, + "amount": { + "$ref": "#/definitions/Value" + }, + "plutus_data": { + "anyOf": [ + { + "$ref": "#/definitions/DataOption" + }, + { + "type": "null" + } + ] + }, + "script_ref": { + "anyOf": [ + { + "$ref": "#/definitions/ScriptRef" + }, + { + "type": "null" + } + ] + } + } + }, + "TransactionOutputs": { + "type": "array", + "items": { + "$ref": "#/definitions/TransactionOutput" + } + }, + "URL": { + "type": "string" + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + }, + "Update": { + "type": "object", + "required": [ + "epoch", + "proposed_protocol_parameter_updates" + ], + "properties": { + "epoch": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "proposed_protocol_parameter_updates": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + } + }, + "Value": { + "type": "object", + "required": [ + "coin" + ], + "properties": { + "coin": { + "type": "string" + }, + "multiasset": { + "anyOf": [ + { + "$ref": "#/definitions/MultiAsset" + }, + { + "type": "null" + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/TransactionBody.json b/rust/json-gen/schemas/TransactionBody.json new file mode 100644 index 0000000..e0943f6 --- /dev/null +++ b/rust/json-gen/schemas/TransactionBody.json @@ -0,0 +1,1293 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TransactionBody", + "type": "object", + "required": [ + "fee", + "inputs", + "outputs" + ], + "properties": { + "auxiliary_data_hash": { + "type": [ + "string", + "null" + ] + }, + "certs": { + "anyOf": [ + { + "$ref": "#/definitions/Certificates" + }, + { + "type": "null" + } + ] + }, + "collateral": { + "anyOf": [ + { + "$ref": "#/definitions/TransactionInputs" + }, + { + "type": "null" + } + ] + }, + "collateral_return": { + "anyOf": [ + { + "$ref": "#/definitions/TransactionOutput" + }, + { + "type": "null" + } + ] + }, + "fee": { + "type": "string" + }, + "inputs": { + "$ref": "#/definitions/TransactionInputs" + }, + "mint": { + "anyOf": [ + { + "$ref": "#/definitions/Mint" + }, + { + "type": "null" + } + ] + }, + "network_id": { + "anyOf": [ + { + "$ref": "#/definitions/NetworkId" + }, + { + "type": "null" + } + ] + }, + "outputs": { + "$ref": "#/definitions/TransactionOutputs" + }, + "reference_inputs": { + "anyOf": [ + { + "$ref": "#/definitions/TransactionInputs" + }, + { + "type": "null" + } + ] + }, + "required_signers": { + "anyOf": [ + { + "$ref": "#/definitions/Ed25519KeyHashes" + }, + { + "type": "null" + } + ] + }, + "script_data_hash": { + "type": [ + "string", + "null" + ] + }, + "total_collateral": { + "type": [ + "string", + "null" + ] + }, + "ttl": { + "type": [ + "string", + "null" + ] + }, + "update": { + "anyOf": [ + { + "$ref": "#/definitions/Update" + }, + { + "type": "null" + } + ] + }, + "validity_start_interval": { + "type": [ + "string", + "null" + ] + }, + "withdrawals": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + }, + "definitions": { + "Assets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Certificate": { + "$ref": "#/definitions/CertificateEnum" + }, + "CertificateEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "StakeRegistration" + ], + "properties": { + "StakeRegistration": { + "$ref": "#/definitions/StakeRegistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "StakeDeregistration" + ], + "properties": { + "StakeDeregistration": { + "$ref": "#/definitions/StakeDeregistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "StakeDelegation" + ], + "properties": { + "StakeDelegation": { + "$ref": "#/definitions/StakeDelegation" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PoolRegistration" + ], + "properties": { + "PoolRegistration": { + "$ref": "#/definitions/PoolRegistration" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PoolRetirement" + ], + "properties": { + "PoolRetirement": { + "$ref": "#/definitions/PoolRetirement" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "GenesisKeyDelegation" + ], + "properties": { + "GenesisKeyDelegation": { + "$ref": "#/definitions/GenesisKeyDelegation" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MoveInstantaneousRewardsCert" + ], + "properties": { + "MoveInstantaneousRewardsCert": { + "$ref": "#/definitions/MoveInstantaneousRewardsCert" + } + }, + "additionalProperties": false + } + ] + }, + "Certificates": { + "type": "array", + "items": { + "$ref": "#/definitions/Certificate" + } + }, + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + }, + "Costmdls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + } + }, + "DNSRecordAorAAAA": { + "type": "string" + }, + "DNSRecordSRV": { + "type": "string" + }, + "DataOption": { + "oneOf": [ + { + "type": "object", + "required": [ + "DataHash" + ], + "properties": { + "DataHash": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Data" + ], + "properties": { + "Data": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "Ed25519KeyHashes": { + "type": "array", + "items": { + "type": "string" + } + }, + "ExUnitPrices": { + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "GenesisKeyDelegation": { + "type": "object", + "required": [ + "genesis_delegate_hash", + "genesishash", + "vrf_keyhash" + ], + "properties": { + "genesis_delegate_hash": { + "type": "string" + }, + "genesishash": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + } + }, + "Ipv4": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 4, + "minItems": 4 + }, + "Ipv6": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 16, + "minItems": 16 + }, + "MIREnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ToOtherPot" + ], + "properties": { + "ToOtherPot": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ToStakeCredentials" + ], + "properties": { + "ToStakeCredentials": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + }, + "additionalProperties": false + } + ] + }, + "MIRPot": { + "type": "string", + "enum": [ + "Reserves", + "Treasury" + ] + }, + "Mint": { + "type": "array", + "items": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/MintAssets" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "MintAssets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "MoveInstantaneousReward": { + "type": "object", + "required": [ + "pot", + "variant" + ], + "properties": { + "pot": { + "$ref": "#/definitions/MIRPot" + }, + "variant": { + "$ref": "#/definitions/MIREnum" + } + } + }, + "MoveInstantaneousRewardsCert": { + "type": "object", + "required": [ + "move_instantaneous_reward" + ], + "properties": { + "move_instantaneous_reward": { + "$ref": "#/definitions/MoveInstantaneousReward" + } + } + }, + "MultiAsset": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Assets" + } + }, + "MultiHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordSRV" + } + } + }, + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "NetworkId": { + "$ref": "#/definitions/NetworkIdKind" + }, + "NetworkIdKind": { + "type": "string", + "enum": [ + "Testnet", + "Mainnet" + ] + }, + "Nonce": { + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } + }, + "PoolMetadata": { + "type": "object", + "required": [ + "pool_metadata_hash", + "url" + ], + "properties": { + "pool_metadata_hash": { + "type": "string" + }, + "url": { + "$ref": "#/definitions/URL" + } + } + }, + "PoolParams": { + "type": "object", + "required": [ + "cost", + "margin", + "operator", + "pledge", + "pool_owners", + "relays", + "reward_account", + "vrf_keyhash" + ], + "properties": { + "cost": { + "type": "string" + }, + "margin": { + "$ref": "#/definitions/UnitInterval" + }, + "operator": { + "type": "string" + }, + "pledge": { + "type": "string" + }, + "pool_metadata": { + "anyOf": [ + { + "$ref": "#/definitions/PoolMetadata" + }, + { + "type": "null" + } + ] + }, + "pool_owners": { + "$ref": "#/definitions/Ed25519KeyHashes" + }, + "relays": { + "$ref": "#/definitions/Relays" + }, + "reward_account": { + "type": "string" + }, + "vrf_keyhash": { + "type": "string" + } + } + }, + "PoolRegistration": { + "type": "object", + "required": [ + "pool_params" + ], + "properties": { + "pool_params": { + "$ref": "#/definitions/PoolParams" + } + } + }, + "PoolRetirement": { + "type": "object", + "required": [ + "epoch", + "pool_keyhash" + ], + "properties": { + "epoch": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "pool_keyhash": { + "type": "string" + } + } + }, + "ProtocolParamUpdate": { + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "type": [ + "string", + "null" + ] + }, + "collateral_percentage": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "cost_models": { + "anyOf": [ + { + "$ref": "#/definitions/Costmdls" + }, + { + "type": "null" + } + ] + }, + "d": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "execution_costs": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnitPrices" + }, + { + "type": "null" + } + ] + }, + "expansion_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "extra_entropy": { + "anyOf": [ + { + "$ref": "#/definitions/Nonce" + }, + { + "type": "null" + } + ] + }, + "key_deposit": { + "type": [ + "string", + "null" + ] + }, + "max_block_body_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_block_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_block_header_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_collateral_inputs": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_epoch": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_tx_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_tx_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_value_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "min_pool_cost": { + "type": [ + "string", + "null" + ] + }, + "minfee_a": { + "type": [ + "string", + "null" + ] + }, + "minfee_b": { + "type": [ + "string", + "null" + ] + }, + "n_opt": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "pool_deposit": { + "type": [ + "string", + "null" + ] + }, + "pool_pledge_influence": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "protocol_version": { + "anyOf": [ + { + "$ref": "#/definitions/ProtocolVersion" + }, + { + "type": "null" + } + ] + }, + "treasury_growth_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "Relay": { + "$ref": "#/definitions/RelayEnum" + }, + "RelayEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "SingleHostAddr" + ], + "properties": { + "SingleHostAddr": { + "$ref": "#/definitions/SingleHostAddr" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "SingleHostName" + ], + "properties": { + "SingleHostName": { + "$ref": "#/definitions/SingleHostName" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "MultiHostName" + ], + "properties": { + "MultiHostName": { + "$ref": "#/definitions/MultiHostName" + } + }, + "additionalProperties": false + } + ] + }, + "Relays": { + "type": "array", + "items": { + "$ref": "#/definitions/Relay" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "ScriptRef": { + "$ref": "#/definitions/ScriptRefEnum" + }, + "ScriptRefEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "NativeScript" + ], + "properties": { + "NativeScript": { + "$ref": "#/definitions/NativeScript" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PlutusScript" + ], + "properties": { + "PlutusScript": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "SingleHostAddr": { + "type": "object", + "properties": { + "ipv4": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv4" + }, + { + "type": "null" + } + ] + }, + "ipv6": { + "anyOf": [ + { + "$ref": "#/definitions/Ipv6" + }, + { + "type": "null" + } + ] + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "SingleHostName": { + "type": "object", + "required": [ + "dns_name" + ], + "properties": { + "dns_name": { + "$ref": "#/definitions/DNSRecordAorAAAA" + }, + "port": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + }, + "StakeCredType": { + "oneOf": [ + { + "type": "object", + "required": [ + "Key" + ], + "properties": { + "Key": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Script" + ], + "properties": { + "Script": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "StakeCredential": { + "$ref": "#/definitions/StakeCredType" + }, + "StakeDelegation": { + "type": "object", + "required": [ + "pool_keyhash", + "stake_credential" + ], + "properties": { + "pool_keyhash": { + "type": "string" + }, + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "StakeDeregistration": { + "type": "object", + "required": [ + "stake_credential" + ], + "properties": { + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "StakeRegistration": { + "type": "object", + "required": [ + "stake_credential" + ], + "properties": { + "stake_credential": { + "$ref": "#/definitions/StakeCredential" + } + } + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TransactionInput": { + "type": "object", + "required": [ + "index", + "transaction_id" + ], + "properties": { + "index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "transaction_id": { + "type": "string" + } + } + }, + "TransactionInputs": { + "type": "array", + "items": { + "$ref": "#/definitions/TransactionInput" + } + }, + "TransactionOutput": { + "type": "object", + "required": [ + "address", + "amount" + ], + "properties": { + "address": { + "type": "string" + }, + "amount": { + "$ref": "#/definitions/Value" + }, + "plutus_data": { + "anyOf": [ + { + "$ref": "#/definitions/DataOption" + }, + { + "type": "null" + } + ] + }, + "script_ref": { + "anyOf": [ + { + "$ref": "#/definitions/ScriptRef" + }, + { + "type": "null" + } + ] + } + } + }, + "TransactionOutputs": { + "type": "array", + "items": { + "$ref": "#/definitions/TransactionOutput" + } + }, + "URL": { + "type": "string" + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + }, + "Update": { + "type": "object", + "required": [ + "epoch", + "proposed_protocol_parameter_updates" + ], + "properties": { + "epoch": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "proposed_protocol_parameter_updates": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + } + }, + "Value": { + "type": "object", + "required": [ + "coin" + ], + "properties": { + "coin": { + "type": "string" + }, + "multiasset": { + "anyOf": [ + { + "$ref": "#/definitions/MultiAsset" + }, + { + "type": "null" + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/TransactionHash.json b/rust/json-gen/schemas/TransactionHash.json new file mode 100644 index 0000000..e712b99 --- /dev/null +++ b/rust/json-gen/schemas/TransactionHash.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TransactionHash", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/TransactionInput.json b/rust/json-gen/schemas/TransactionInput.json new file mode 100644 index 0000000..f193d3f --- /dev/null +++ b/rust/json-gen/schemas/TransactionInput.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TransactionInput", + "type": "object", + "required": [ + "index", + "transaction_id" + ], + "properties": { + "index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "transaction_id": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/TransactionInputs.json b/rust/json-gen/schemas/TransactionInputs.json new file mode 100644 index 0000000..1519084 --- /dev/null +++ b/rust/json-gen/schemas/TransactionInputs.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TransactionInputs", + "type": "array", + "items": { + "$ref": "#/definitions/TransactionInput" + }, + "definitions": { + "TransactionInput": { + "type": "object", + "required": [ + "index", + "transaction_id" + ], + "properties": { + "index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "transaction_id": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/TransactionMetadatum.json b/rust/json-gen/schemas/TransactionMetadatum.json new file mode 100644 index 0000000..2c7a821 --- /dev/null +++ b/rust/json-gen/schemas/TransactionMetadatum.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TransactionMetadatum", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/TransactionOutput.json b/rust/json-gen/schemas/TransactionOutput.json new file mode 100644 index 0000000..5abdb15 --- /dev/null +++ b/rust/json-gen/schemas/TransactionOutput.json @@ -0,0 +1,288 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TransactionOutput", + "type": "object", + "required": [ + "address", + "amount" + ], + "properties": { + "address": { + "type": "string" + }, + "amount": { + "$ref": "#/definitions/Value" + }, + "plutus_data": { + "anyOf": [ + { + "$ref": "#/definitions/DataOption" + }, + { + "type": "null" + } + ] + }, + "script_ref": { + "anyOf": [ + { + "$ref": "#/definitions/ScriptRef" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "Assets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "DataOption": { + "oneOf": [ + { + "type": "object", + "required": [ + "DataHash" + ], + "properties": { + "DataHash": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Data" + ], + "properties": { + "Data": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "MultiAsset": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Assets" + } + }, + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "ScriptRef": { + "$ref": "#/definitions/ScriptRefEnum" + }, + "ScriptRefEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "NativeScript" + ], + "properties": { + "NativeScript": { + "$ref": "#/definitions/NativeScript" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PlutusScript" + ], + "properties": { + "PlutusScript": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "Value": { + "type": "object", + "required": [ + "coin" + ], + "properties": { + "coin": { + "type": "string" + }, + "multiasset": { + "anyOf": [ + { + "$ref": "#/definitions/MultiAsset" + }, + { + "type": "null" + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/TransactionOutputs.json b/rust/json-gen/schemas/TransactionOutputs.json new file mode 100644 index 0000000..62cb6b6 --- /dev/null +++ b/rust/json-gen/schemas/TransactionOutputs.json @@ -0,0 +1,294 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TransactionOutputs", + "type": "array", + "items": { + "$ref": "#/definitions/TransactionOutput" + }, + "definitions": { + "Assets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "DataOption": { + "oneOf": [ + { + "type": "object", + "required": [ + "DataHash" + ], + "properties": { + "DataHash": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Data" + ], + "properties": { + "Data": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "MultiAsset": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Assets" + } + }, + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "ScriptRef": { + "$ref": "#/definitions/ScriptRefEnum" + }, + "ScriptRefEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "NativeScript" + ], + "properties": { + "NativeScript": { + "$ref": "#/definitions/NativeScript" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PlutusScript" + ], + "properties": { + "PlutusScript": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TransactionOutput": { + "type": "object", + "required": [ + "address", + "amount" + ], + "properties": { + "address": { + "type": "string" + }, + "amount": { + "$ref": "#/definitions/Value" + }, + "plutus_data": { + "anyOf": [ + { + "$ref": "#/definitions/DataOption" + }, + { + "type": "null" + } + ] + }, + "script_ref": { + "anyOf": [ + { + "$ref": "#/definitions/ScriptRef" + }, + { + "type": "null" + } + ] + } + } + }, + "Value": { + "type": "object", + "required": [ + "coin" + ], + "properties": { + "coin": { + "type": "string" + }, + "multiasset": { + "anyOf": [ + { + "$ref": "#/definitions/MultiAsset" + }, + { + "type": "null" + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/TransactionUnspentOutput.json b/rust/json-gen/schemas/TransactionUnspentOutput.json new file mode 100644 index 0000000..d66d973 --- /dev/null +++ b/rust/json-gen/schemas/TransactionUnspentOutput.json @@ -0,0 +1,320 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TransactionUnspentOutput", + "type": "object", + "required": [ + "input", + "output" + ], + "properties": { + "input": { + "$ref": "#/definitions/TransactionInput" + }, + "output": { + "$ref": "#/definitions/TransactionOutput" + } + }, + "definitions": { + "Assets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "DataOption": { + "oneOf": [ + { + "type": "object", + "required": [ + "DataHash" + ], + "properties": { + "DataHash": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Data" + ], + "properties": { + "Data": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "MultiAsset": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Assets" + } + }, + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "ScriptRef": { + "$ref": "#/definitions/ScriptRefEnum" + }, + "ScriptRefEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "NativeScript" + ], + "properties": { + "NativeScript": { + "$ref": "#/definitions/NativeScript" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PlutusScript" + ], + "properties": { + "PlutusScript": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TransactionInput": { + "type": "object", + "required": [ + "index", + "transaction_id" + ], + "properties": { + "index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "transaction_id": { + "type": "string" + } + } + }, + "TransactionOutput": { + "type": "object", + "required": [ + "address", + "amount" + ], + "properties": { + "address": { + "type": "string" + }, + "amount": { + "$ref": "#/definitions/Value" + }, + "plutus_data": { + "anyOf": [ + { + "$ref": "#/definitions/DataOption" + }, + { + "type": "null" + } + ] + }, + "script_ref": { + "anyOf": [ + { + "$ref": "#/definitions/ScriptRef" + }, + { + "type": "null" + } + ] + } + } + }, + "Value": { + "type": "object", + "required": [ + "coin" + ], + "properties": { + "coin": { + "type": "string" + }, + "multiasset": { + "anyOf": [ + { + "$ref": "#/definitions/MultiAsset" + }, + { + "type": "null" + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/TransactionUnspentOutputs.json b/rust/json-gen/schemas/TransactionUnspentOutputs.json new file mode 100644 index 0000000..2a445a6 --- /dev/null +++ b/rust/json-gen/schemas/TransactionUnspentOutputs.json @@ -0,0 +1,326 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TransactionUnspentOutputs", + "type": "array", + "items": { + "$ref": "#/definitions/TransactionUnspentOutput" + }, + "definitions": { + "Assets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "DataOption": { + "oneOf": [ + { + "type": "object", + "required": [ + "DataHash" + ], + "properties": { + "DataHash": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Data" + ], + "properties": { + "Data": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "MultiAsset": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Assets" + } + }, + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "ScriptRef": { + "$ref": "#/definitions/ScriptRefEnum" + }, + "ScriptRefEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "NativeScript" + ], + "properties": { + "NativeScript": { + "$ref": "#/definitions/NativeScript" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "PlutusScript" + ], + "properties": { + "PlutusScript": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TransactionInput": { + "type": "object", + "required": [ + "index", + "transaction_id" + ], + "properties": { + "index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "transaction_id": { + "type": "string" + } + } + }, + "TransactionOutput": { + "type": "object", + "required": [ + "address", + "amount" + ], + "properties": { + "address": { + "type": "string" + }, + "amount": { + "$ref": "#/definitions/Value" + }, + "plutus_data": { + "anyOf": [ + { + "$ref": "#/definitions/DataOption" + }, + { + "type": "null" + } + ] + }, + "script_ref": { + "anyOf": [ + { + "$ref": "#/definitions/ScriptRef" + }, + { + "type": "null" + } + ] + } + } + }, + "TransactionUnspentOutput": { + "type": "object", + "required": [ + "input", + "output" + ], + "properties": { + "input": { + "$ref": "#/definitions/TransactionInput" + }, + "output": { + "$ref": "#/definitions/TransactionOutput" + } + } + }, + "Value": { + "type": "object", + "required": [ + "coin" + ], + "properties": { + "coin": { + "type": "string" + }, + "multiasset": { + "anyOf": [ + { + "$ref": "#/definitions/MultiAsset" + }, + { + "type": "null" + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/TransactionWitnessSet.json b/rust/json-gen/schemas/TransactionWitnessSet.json new file mode 100644 index 0000000..54cef16 --- /dev/null +++ b/rust/json-gen/schemas/TransactionWitnessSet.json @@ -0,0 +1,371 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TransactionWitnessSet", + "type": "object", + "properties": { + "bootstraps": { + "anyOf": [ + { + "$ref": "#/definitions/BootstrapWitnesses" + }, + { + "type": "null" + } + ] + }, + "native_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/NativeScripts" + }, + { + "type": "null" + } + ] + }, + "plutus_data": { + "anyOf": [ + { + "$ref": "#/definitions/PlutusList" + }, + { + "type": "null" + } + ] + }, + "plutus_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/PlutusScripts" + }, + { + "type": "null" + } + ] + }, + "redeemers": { + "anyOf": [ + { + "$ref": "#/definitions/Redeemers" + }, + { + "type": "null" + } + ] + }, + "vkeys": { + "anyOf": [ + { + "$ref": "#/definitions/Vkeywitnesses" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "BootstrapWitness": { + "type": "object", + "required": [ + "attributes", + "chain_code", + "signature", + "vkey" + ], + "properties": { + "attributes": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "chain_code": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "signature": { + "type": "string" + }, + "vkey": { + "$ref": "#/definitions/Vkey" + } + } + }, + "BootstrapWitnesses": { + "type": "array", + "items": { + "$ref": "#/definitions/BootstrapWitness" + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "PlutusList": { + "type": "object", + "required": [ + "elems" + ], + "properties": { + "definite_encoding": { + "type": [ + "boolean", + "null" + ] + }, + "elems": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PlutusScripts": { + "type": "array", + "items": { + "type": "string" + } + }, + "Redeemer": { + "type": "object", + "required": [ + "data", + "ex_units", + "index", + "tag" + ], + "properties": { + "data": { + "type": "string" + }, + "ex_units": { + "$ref": "#/definitions/ExUnits" + }, + "index": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/RedeemerTag" + } + } + }, + "RedeemerTag": { + "$ref": "#/definitions/RedeemerTagKind" + }, + "RedeemerTagKind": { + "type": "string", + "enum": [ + "Spend", + "Mint", + "Cert", + "Reward" + ] + }, + "Redeemers": { + "type": "array", + "items": { + "$ref": "#/definitions/Redeemer" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "Vkey": { + "type": "string" + }, + "Vkeywitness": { + "type": "object", + "required": [ + "signature", + "vkey" + ], + "properties": { + "signature": { + "type": "string" + }, + "vkey": { + "$ref": "#/definitions/Vkey" + } + } + }, + "Vkeywitnesses": { + "type": "array", + "items": { + "$ref": "#/definitions/Vkeywitness" + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/TransactionWitnessSets.json b/rust/json-gen/schemas/TransactionWitnessSets.json new file mode 100644 index 0000000..09e47b6 --- /dev/null +++ b/rust/json-gen/schemas/TransactionWitnessSets.json @@ -0,0 +1,377 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TransactionWitnessSets", + "type": "array", + "items": { + "$ref": "#/definitions/TransactionWitnessSet" + }, + "definitions": { + "BootstrapWitness": { + "type": "object", + "required": [ + "attributes", + "chain_code", + "signature", + "vkey" + ], + "properties": { + "attributes": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "chain_code": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "signature": { + "type": "string" + }, + "vkey": { + "$ref": "#/definitions/Vkey" + } + } + }, + "BootstrapWitnesses": { + "type": "array", + "items": { + "$ref": "#/definitions/BootstrapWitness" + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "NativeScript": { + "$ref": "#/definitions/NativeScriptEnum" + }, + "NativeScriptEnum": { + "oneOf": [ + { + "type": "object", + "required": [ + "ScriptPubkey" + ], + "properties": { + "ScriptPubkey": { + "$ref": "#/definitions/ScriptPubkey" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAll" + ], + "properties": { + "ScriptAll": { + "$ref": "#/definitions/ScriptAll" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptAny" + ], + "properties": { + "ScriptAny": { + "$ref": "#/definitions/ScriptAny" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ScriptNOfK" + ], + "properties": { + "ScriptNOfK": { + "$ref": "#/definitions/ScriptNOfK" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockStart" + ], + "properties": { + "TimelockStart": { + "$ref": "#/definitions/TimelockStart" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "TimelockExpiry" + ], + "properties": { + "TimelockExpiry": { + "$ref": "#/definitions/TimelockExpiry" + } + }, + "additionalProperties": false + } + ] + }, + "NativeScripts": { + "type": "array", + "items": { + "$ref": "#/definitions/NativeScript" + } + }, + "PlutusList": { + "type": "object", + "required": [ + "elems" + ], + "properties": { + "definite_encoding": { + "type": [ + "boolean", + "null" + ] + }, + "elems": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PlutusScripts": { + "type": "array", + "items": { + "type": "string" + } + }, + "Redeemer": { + "type": "object", + "required": [ + "data", + "ex_units", + "index", + "tag" + ], + "properties": { + "data": { + "type": "string" + }, + "ex_units": { + "$ref": "#/definitions/ExUnits" + }, + "index": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/RedeemerTag" + } + } + }, + "RedeemerTag": { + "$ref": "#/definitions/RedeemerTagKind" + }, + "RedeemerTagKind": { + "type": "string", + "enum": [ + "Spend", + "Mint", + "Cert", + "Reward" + ] + }, + "Redeemers": { + "type": "array", + "items": { + "$ref": "#/definitions/Redeemer" + } + }, + "ScriptAll": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptAny": { + "type": "object", + "required": [ + "native_scripts" + ], + "properties": { + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptNOfK": { + "type": "object", + "required": [ + "n", + "native_scripts" + ], + "properties": { + "n": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "native_scripts": { + "$ref": "#/definitions/NativeScripts" + } + } + }, + "ScriptPubkey": { + "type": "object", + "required": [ + "addr_keyhash" + ], + "properties": { + "addr_keyhash": { + "type": "string" + } + } + }, + "TimelockExpiry": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TimelockStart": { + "type": "object", + "required": [ + "slot" + ], + "properties": { + "slot": { + "type": "string" + } + } + }, + "TransactionWitnessSet": { + "type": "object", + "properties": { + "bootstraps": { + "anyOf": [ + { + "$ref": "#/definitions/BootstrapWitnesses" + }, + { + "type": "null" + } + ] + }, + "native_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/NativeScripts" + }, + { + "type": "null" + } + ] + }, + "plutus_data": { + "anyOf": [ + { + "$ref": "#/definitions/PlutusList" + }, + { + "type": "null" + } + ] + }, + "plutus_scripts": { + "anyOf": [ + { + "$ref": "#/definitions/PlutusScripts" + }, + { + "type": "null" + } + ] + }, + "redeemers": { + "anyOf": [ + { + "$ref": "#/definitions/Redeemers" + }, + { + "type": "null" + } + ] + }, + "vkeys": { + "anyOf": [ + { + "$ref": "#/definitions/Vkeywitnesses" + }, + { + "type": "null" + } + ] + } + } + }, + "Vkey": { + "type": "string" + }, + "Vkeywitness": { + "type": "object", + "required": [ + "signature", + "vkey" + ], + "properties": { + "signature": { + "type": "string" + }, + "vkey": { + "$ref": "#/definitions/Vkey" + } + } + }, + "Vkeywitnesses": { + "type": "array", + "items": { + "$ref": "#/definitions/Vkeywitness" + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/URL.json b/rust/json-gen/schemas/URL.json new file mode 100644 index 0000000..ee611a1 --- /dev/null +++ b/rust/json-gen/schemas/URL.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "URL", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/UnitInterval.json b/rust/json-gen/schemas/UnitInterval.json new file mode 100644 index 0000000..5e8baf3 --- /dev/null +++ b/rust/json-gen/schemas/UnitInterval.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UnitInterval", + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Update.json b/rust/json-gen/schemas/Update.json new file mode 100644 index 0000000..3602e19 --- /dev/null +++ b/rust/json-gen/schemas/Update.json @@ -0,0 +1,323 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Update", + "type": "object", + "required": [ + "epoch", + "proposed_protocol_parameter_updates" + ], + "properties": { + "epoch": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "proposed_protocol_parameter_updates": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + } + } + }, + "definitions": { + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + }, + "Costmdls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + } + }, + "ExUnitPrices": { + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "Nonce": { + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } + }, + "ProtocolParamUpdate": { + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "type": [ + "string", + "null" + ] + }, + "collateral_percentage": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "cost_models": { + "anyOf": [ + { + "$ref": "#/definitions/Costmdls" + }, + { + "type": "null" + } + ] + }, + "d": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "execution_costs": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnitPrices" + }, + { + "type": "null" + } + ] + }, + "expansion_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "extra_entropy": { + "anyOf": [ + { + "$ref": "#/definitions/Nonce" + }, + { + "type": "null" + } + ] + }, + "key_deposit": { + "type": [ + "string", + "null" + ] + }, + "max_block_body_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_block_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_block_header_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_collateral_inputs": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_epoch": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_tx_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_tx_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_value_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "min_pool_cost": { + "type": [ + "string", + "null" + ] + }, + "minfee_a": { + "type": [ + "string", + "null" + ] + }, + "minfee_b": { + "type": [ + "string", + "null" + ] + }, + "n_opt": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "pool_deposit": { + "type": [ + "string", + "null" + ] + }, + "pool_pledge_influence": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "protocol_version": { + "anyOf": [ + { + "$ref": "#/definitions/ProtocolVersion" + }, + { + "type": "null" + } + ] + }, + "treasury_growth_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/VRFCert.json b/rust/json-gen/schemas/VRFCert.json new file mode 100644 index 0000000..bc5ab40 --- /dev/null +++ b/rust/json-gen/schemas/VRFCert.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VRFCert", + "type": "object", + "required": [ + "output", + "proof" + ], + "properties": { + "output": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "proof": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/VRFKeyHash.json b/rust/json-gen/schemas/VRFKeyHash.json new file mode 100644 index 0000000..2f0d6d8 --- /dev/null +++ b/rust/json-gen/schemas/VRFKeyHash.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VRFKeyHash", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/VRFVKey.json b/rust/json-gen/schemas/VRFVKey.json new file mode 100644 index 0000000..4e3f95d --- /dev/null +++ b/rust/json-gen/schemas/VRFVKey.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VRFVKey", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Value.json b/rust/json-gen/schemas/Value.json new file mode 100644 index 0000000..1be10d5 --- /dev/null +++ b/rust/json-gen/schemas/Value.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Value", + "type": "object", + "required": [ + "coin" + ], + "properties": { + "coin": { + "type": "string" + }, + "multiasset": { + "anyOf": [ + { + "$ref": "#/definitions/MultiAsset" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "Assets": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "MultiAsset": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Assets" + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Vkey.json b/rust/json-gen/schemas/Vkey.json new file mode 100644 index 0000000..f3a86d0 --- /dev/null +++ b/rust/json-gen/schemas/Vkey.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Vkey", + "type": "string" +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Vkeywitness.json b/rust/json-gen/schemas/Vkeywitness.json new file mode 100644 index 0000000..d7d94c0 --- /dev/null +++ b/rust/json-gen/schemas/Vkeywitness.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Vkeywitness", + "type": "object", + "required": [ + "signature", + "vkey" + ], + "properties": { + "signature": { + "type": "string" + }, + "vkey": { + "$ref": "#/definitions/Vkey" + } + }, + "definitions": { + "Vkey": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Vkeywitnesses.json b/rust/json-gen/schemas/Vkeywitnesses.json new file mode 100644 index 0000000..baf616e --- /dev/null +++ b/rust/json-gen/schemas/Vkeywitnesses.json @@ -0,0 +1,28 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Vkeywitnesses", + "type": "array", + "items": { + "$ref": "#/definitions/Vkeywitness" + }, + "definitions": { + "Vkey": { + "type": "string" + }, + "Vkeywitness": { + "type": "object", + "required": [ + "signature", + "vkey" + ], + "properties": { + "signature": { + "type": "string" + }, + "vkey": { + "$ref": "#/definitions/Vkey" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/schemas/Withdrawals.json b/rust/json-gen/schemas/Withdrawals.json new file mode 100644 index 0000000..a73b2b5 --- /dev/null +++ b/rust/json-gen/schemas/Withdrawals.json @@ -0,0 +1,309 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Withdrawals", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProtocolParamUpdate" + }, + "definitions": { + "CostModel": { + "type": "array", + "items": { + "type": "string" + } + }, + "Costmdls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CostModel" + } + }, + "ExUnitPrices": { + "type": "object", + "required": [ + "mem_price", + "step_price" + ], + "properties": { + "mem_price": { + "$ref": "#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "#/definitions/UnitInterval" + } + } + }, + "ExUnits": { + "type": "object", + "required": [ + "mem", + "steps" + ], + "properties": { + "mem": { + "type": "string" + }, + "steps": { + "type": "string" + } + } + }, + "Nonce": { + "type": "object", + "properties": { + "hash": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "maxItems": 32, + "minItems": 32 + } + } + }, + "ProtocolParamUpdate": { + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "type": [ + "string", + "null" + ] + }, + "collateral_percentage": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "cost_models": { + "anyOf": [ + { + "$ref": "#/definitions/Costmdls" + }, + { + "type": "null" + } + ] + }, + "d": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "execution_costs": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnitPrices" + }, + { + "type": "null" + } + ] + }, + "expansion_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "extra_entropy": { + "anyOf": [ + { + "$ref": "#/definitions/Nonce" + }, + { + "type": "null" + } + ] + }, + "key_deposit": { + "type": [ + "string", + "null" + ] + }, + "max_block_body_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_block_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_block_header_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_collateral_inputs": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_epoch": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_tx_ex_units": { + "anyOf": [ + { + "$ref": "#/definitions/ExUnits" + }, + { + "type": "null" + } + ] + }, + "max_tx_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "max_value_size": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "min_pool_cost": { + "type": [ + "string", + "null" + ] + }, + "minfee_a": { + "type": [ + "string", + "null" + ] + }, + "minfee_b": { + "type": [ + "string", + "null" + ] + }, + "n_opt": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "pool_deposit": { + "type": [ + "string", + "null" + ] + }, + "pool_pledge_influence": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + }, + "protocol_version": { + "anyOf": [ + { + "$ref": "#/definitions/ProtocolVersion" + }, + { + "type": "null" + } + ] + }, + "treasury_growth_rate": { + "anyOf": [ + { + "$ref": "#/definitions/UnitInterval" + }, + { + "type": "null" + } + ] + } + } + }, + "ProtocolVersion": { + "type": "object", + "required": [ + "major", + "minor" + ], + "properties": { + "major": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "minor": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "UnitInterval": { + "type": "object", + "required": [ + "denominator", + "numerator" + ], + "properties": { + "denominator": { + "type": "string" + }, + "numerator": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/rust/json-gen/src/main.rs b/rust/json-gen/src/main.rs new file mode 100644 index 0000000..1199ca0 --- /dev/null +++ b/rust/json-gen/src/main.rs @@ -0,0 +1,163 @@ +use std::fs; +use std::path::Path; + +use cardano_serialization_lib::address::*; +use cardano_serialization_lib::crypto::*; +use cardano_serialization_lib::metadata::*; +use cardano_serialization_lib::plutus::*; +use cardano_serialization_lib::utils::*; +use cardano_serialization_lib::*; + +//#[macro_export] +macro_rules! gen_json_schema { + ($name:ident) => { + //let out_dir = std::env::var_os("OUT_DIR").expect("no env"); + let dest_path = Path::new(&"schemas").join(&format!("{}.json", stringify!($name))); + fs::write( + &dest_path, + serde_json::to_string_pretty(&schemars::schema_for!($name)).unwrap(), + ) + .unwrap(); + }; +} + +fn main() { + let schema_path = Path::new(&"schemas"); + if !schema_path.exists() { + fs::create_dir(schema_path).unwrap(); + } + // lib.rs + gen_json_schema!(UnitInterval); + gen_json_schema!(Transaction); + gen_json_schema!(TransactionInputs); + gen_json_schema!(TransactionOutputs); + gen_json_schema!(Certificates); + gen_json_schema!(TransactionBody); + gen_json_schema!(TransactionInput); + gen_json_schema!(TransactionOutput); + gen_json_schema!(StakeRegistration); + gen_json_schema!(StakeDeregistration); + gen_json_schema!(StakeDelegation); + gen_json_schema!(Ed25519KeyHashes); + gen_json_schema!(Relays); + gen_json_schema!(PoolParams); + gen_json_schema!(PoolRegistration); + gen_json_schema!(PoolRetirement); + gen_json_schema!(GenesisKeyDelegation); + gen_json_schema!(MoveInstantaneousRewardsCert); + gen_json_schema!(Certificate); + //gen_json_schema!(CertificateEnum); + gen_json_schema!(MIRPot); + gen_json_schema!(MIRToStakeCredentials); + gen_json_schema!(MoveInstantaneousReward); + gen_json_schema!(MIREnum); + gen_json_schema!(Ipv4); + gen_json_schema!(Ipv6); + gen_json_schema!(URL); + gen_json_schema!(DNSRecordAorAAAA); + gen_json_schema!(DNSRecordSRV); + gen_json_schema!(SingleHostAddr); + gen_json_schema!(SingleHostName); + gen_json_schema!(MultiHostName); + gen_json_schema!(Relay); + //gen_json_schema!(RelayEnum); + gen_json_schema!(PoolMetadata); + gen_json_schema!(StakeCredentials); + gen_json_schema!(RewardAddresses); + gen_json_schema!(Withdrawals); + gen_json_schema!(TransactionWitnessSet); + gen_json_schema!(ScriptPubkey); + gen_json_schema!(ScriptAll); + gen_json_schema!(ScriptAny); + gen_json_schema!(ScriptNOfK); + gen_json_schema!(TimelockStart); + gen_json_schema!(TimelockExpiry); + gen_json_schema!(NativeScript); + //gen_json_schema!(NativeScriptEnum); + gen_json_schema!(NativeScripts); + gen_json_schema!(Update); + gen_json_schema!(GenesisHashes); + gen_json_schema!(ScriptHashes); + gen_json_schema!(ProposedProtocolParameterUpdates); + gen_json_schema!(ProtocolVersion); + gen_json_schema!(ProtocolParamUpdate); + gen_json_schema!(TransactionBodies); + gen_json_schema!(TransactionWitnessSets); + gen_json_schema!(AuxiliaryDataSet); + gen_json_schema!(Block); + gen_json_schema!(Header); + gen_json_schema!(OperationalCert); + gen_json_schema!(HeaderBody); + gen_json_schema!(AssetName); + gen_json_schema!(AssetNames); + gen_json_schema!(Assets); + gen_json_schema!(MultiAsset); + gen_json_schema!(MintAssets); + gen_json_schema!(Mint); + gen_json_schema!(NetworkId); + gen_json_schema!(NetworkIdKind); + gen_json_schema!(ScriptRef); + gen_json_schema!(DataOption); + gen_json_schema!(HeaderLeaderCertEnum); + + // crypto.rs + gen_json_schema!(PublicKey); + gen_json_schema!(Vkey); + //gen_json_schema!(Vkeys); + gen_json_schema!(Vkeywitness); + gen_json_schema!(Vkeywitnesses); + gen_json_schema!(BootstrapWitness); + gen_json_schema!(BootstrapWitnesses); + gen_json_schema!(Ed25519Signature); + gen_json_schema!(Ed25519KeyHash); + gen_json_schema!(ScriptHash); + gen_json_schema!(TransactionHash); + gen_json_schema!(GenesisDelegateHash); + gen_json_schema!(GenesisHash); + gen_json_schema!(AuxiliaryDataHash); + gen_json_schema!(PoolMetadataHash); + gen_json_schema!(VRFKeyHash); + gen_json_schema!(BlockHash); + gen_json_schema!(DataHash); + gen_json_schema!(ScriptDataHash); + gen_json_schema!(VRFVKey); + gen_json_schema!(KESVKey); + gen_json_schema!(Nonce); + gen_json_schema!(VRFCert); + // address.rs + gen_json_schema!(StakeCredential); + gen_json_schema!(StakeCredType); + gen_json_schema!(Address); + gen_json_schema!(RewardAddress); + // plutus.rs + gen_json_schema!(PlutusScript); + gen_json_schema!(PlutusScripts); + // gen_json_schema!(ConstrPlutusData); + gen_json_schema!(CostModel); + gen_json_schema!(Costmdls); + gen_json_schema!(ExUnitPrices); + gen_json_schema!(ExUnits); + gen_json_schema!(Language); + gen_json_schema!(LanguageKind); + gen_json_schema!(Languages); + // gen_json_schema!(PlutusMap); + // gen_json_schema!(PlutusData); + // gen_json_schema!(PlutusList); + // gen_json_schema!(PlutusDataEnum); + gen_json_schema!(Redeemer); + gen_json_schema!(RedeemerTag); + gen_json_schema!(RedeemerTagKind); + gen_json_schema!(Redeemers); + //gen_json_schema!(Strings); + // metadata.rs + gen_json_schema!(TransactionMetadatum); + gen_json_schema!(GeneralTransactionMetadata); + gen_json_schema!(AuxiliaryData); + // utils.rs + gen_json_schema!(BigNum); + gen_json_schema!(BigInt); + gen_json_schema!(Int); + gen_json_schema!(Value); + gen_json_schema!(TransactionUnspentOutput); + gen_json_schema!(TransactionUnspentOutputs); +} diff --git a/rust/src/core/utils/script.rs b/rust/src/core/utils/script.rs index 27a1a56..15c3309 100644 --- a/rust/src/core/utils/script.rs +++ b/rust/src/core/utils/script.rs @@ -1,5 +1,7 @@ +use crate::*; use cardano_serialization_lib as csl; +#[wasm_bindgen] pub fn get_v2_script_hash(script: &str) -> String { csl::plutus::PlutusScript::from_hex_with_version( script, diff --git a/scripts/json-ts-types.js b/scripts/json-ts-types.js new file mode 100644 index 0000000..137b2d2 --- /dev/null +++ b/scripts/json-ts-types.js @@ -0,0 +1,37 @@ +const fs = require('fs'); + +const inputFile = fs.readFileSync('./rust/pkg/sidan_csl_rs.d.ts', 'utf8').split(/\r?\n/); +//console.log(inputFile); +let currentClass = null; +for (let i = 0; i < inputFile.length; ++i) { + let line = inputFile[i]; + //const r = /export class ([a-zA-Z]+){/.exec(line); + const classDef = /export class(.*){/.exec(line); + if (classDef != null && classDef.length > 1) { + currentClass = classDef[1].trim(); + //console.log(`reading class ${currentClass}`); + continue; + } + //const toJson = /\sto_json\(\): any;/.exec(line); + //console.log(toJson); + inputFile[i] = line.replace(/(\s?to_js_value\(\)\s?:\s?)(any)(;)/, `$1${currentClass}JSON$3`); + if (line != inputFile[i]) { + continue; + } + // TODO: we might want to make sure we don't have other cases where this would replace + // things it shouldn't. We'd have to do some go-back-a-few-lines replace to only do this + // for to_json() comments. + inputFile[i] = line.replace(/(\s?\*\s?\@returns\s\{)(any)(\})/, `$1${currentClass}JSON$3`); + //const m = /(\s?\*\s?\@returns\s\{)(any)(\})/.exec(line); + //console.log(`${m} | ${line}`); +} +const jsonDefs = fs.readFileSync('./rust/json-gen/output/json-types.d.ts', 'utf8'); +fs.writeFile( + './rust/pkg/sidan-csl-rs.d.ts', + `${inputFile.join('\n')}\n${jsonDefs}`, + (err) => { + if (err != null) { + console.log(`err writing file: ${err}`) + } + } +); diff --git a/scripts/publish-helper.js b/scripts/publish-helper.js new file mode 100644 index 0000000..7cb6911 --- /dev/null +++ b/scripts/publish-helper.js @@ -0,0 +1,34 @@ +const fs = require('fs'); +const oldPkg = require('../publish/package.json'); + +const flowFile = 'sidan_csl_rs.js.flow'; +if (oldPkg.files.find(entry => entry === flowFile) == null) { + oldPkg.files.push(flowFile); +} +if (oldPkg.name === 'sidan-csl-rs') { + oldPkg.name = '@sidan-lab/' + oldPkg.name + process.argv.slice(2)[0]; +} +if (process.argv.slice(2)[0] === '-browser' || process.argv.slice(2)[0] === '-asmjs') { + // due to a bug in wasm-pack, this file is missing from browser builds + const missingFile = 'sidan_csl_rs_bg.js'; + if (oldPkg.files.find(entry => entry === missingFile) == null) { + oldPkg.files.push(missingFile); + } +} +if (process.argv.slice(2)[0] === '-asmjs') { + // need to replace WASM with ASM package + const missingFile = 'sidan_csl_rs_bg.wasm'; + oldPkg.files = [ + 'sidan_csl_rs.asm.js', + ...oldPkg.files.filter(file => file !== 'sidan_csl_rs_bg.wasm') + ]; +} + +oldPkg.repository = { + type: "git", + url: "git+https://github.com/sidan-lab/sidan-csl-rs.git" +}; +oldPkg.author = "sidan-lab"; +oldPkg.license = "Apache-2.0"; +console.log(oldPkg); +fs.writeFileSync('./publish/package.json', JSON.stringify(oldPkg, null, 2)); diff --git a/scripts/run-json2ts.js b/scripts/run-json2ts.js new file mode 100644 index 0000000..f97fa28 --- /dev/null +++ b/scripts/run-json2ts.js @@ -0,0 +1,110 @@ +const fs = require('fs'); +const json2ts = require('json-schema-to-typescript'); +const path = require('path'); + +const schemasDir = path.join('rust', 'json-gen', 'schemas'); +const schemaFiles = fs.readdirSync(schemasDir).filter(file => path.extname(file) === '.json'); + +function replaceRef(obj) { + if (obj['$ref'] != null && typeof obj['$ref'] === 'string' && obj['$ref'].startsWith('#/definitions/')) { + obj['$ref'] = obj['$ref'].replace(/^(#\/definitions\/)/, '') + '.json';//`file:`) + '.json#'; + console.log(`replacing: ${obj['$ref']}`); + } +} + +function replaceRefs(node) { + Object.entries(node).forEach(([k, v]) => { + if (typeof v === 'object') { + replaceRef(v); + replaceRefs(v); + /*if (v.additionalProperties != null) { + replaceRef(v.additionalProperties); + }*/ + } + }); +} + +Promise.all(schemaFiles.map(schemaFile => { + const completeName = path.join(schemasDir, schemaFile); + //console.log(`Processing: ${completeName}`); + const originalFile = fs.readFileSync(completeName, 'utf8'); + let schemaObj = JSON.parse(originalFile); + //console.log(`ORIGINAL: ${JSON.stringify(schemaObj)}\n`); + + // this gets rid of [k: string]: unknown in generated .ts + // but we shouldn't do this if it already exists in the case + // of map types + if (typeof schemaObj.additionalProperties !== 'object') { + schemaObj.additionalProperties = false; + } + + // NOTE: Due to infinite recursion in recursive types (e.g. NativeScript) + // possibly due to a bug in the schema->ts lib, we instead just remove the + // duplicates after the fact. Self-referencing is confirmed not supported, + // but there has been mentions in those github issues of support for other + // recursive types correctly. + // + // It's possibly related to directly using "Foo.json" in replaceRefs() + // but I was not able to get this working using the $ref external file: syntax + // that seemed to be valid online. + // We can also take advantage of the post-removal to easily remove 2 weird unused + // outputs that shouldn't have been generated to begin with (String and MapOf_*) + + /* + // we need to make all references by external so we don't duplicate declarations + if (schemaObj.definitions != null) { + // eliminate in-file definitions + schemaObj.definitions = []; + // change all refs from local to external + replaceRefs(schemaObj); + } + */ + + //console.log(`NEW: ${JSON.stringify(schemaObj)}\n\n\n\n\n`); + return json2ts.compile(schemaObj, schemaFile, { + declareExternallyReferenced: false, + cwd: schemasDir,//path.join(process.cwd(), schemasDir), + bannerComment: '' + }).catch(e => { console.error(`${schemaFile}: ${e}`); }); + +})).then(tsDefs => { + fs.mkdirSync(path.join('rust', 'json-gen', 'output'), { recursive: true }); + const defs = tsDefs.join('').split(/\r?\n/); + let dedupedDefs = []; + let start = null; + let added = new Set(); + const addDef = (cur) => { + if (start != null) { + let defName = defs[start].match(/export\s+(type|interface)\s+(\w+).*/); + let defKey = null; + if (defName != null && defName.length > 2) { + defKey = defName[2]; + } else { + console.error(`run-json2ts.js could not find name for de-dup(${defName != null}): "${defs[start]}"`); + } + if (defKey == null || !added.has(defKey)) { + for (let j = start; j < cur; ++j) { + dedupedDefs.push(defs[j]); + } + if (defKey != null) { + added.add(defKey); + } + } + } + start = cur; + }; + for (let i = 0; i < defs.length; ++i) { + if (defs[i].startsWith('export')) { + addDef(i); + } + } + addDef(defs.length); + // prepend 'JSON' to all identifiers here so they don't conflict with main .ts types + for (let i = 0; i < dedupedDefs.length; ++i) { + for (let id of added) { + dedupedDefs[i] = dedupedDefs[i].replace(new RegExp(`\\b${id}\\b`), id + 'JSON'); + } + } + return fs.writeFileSync(path.join('rust', 'json-gen', 'output', 'json-types.d.ts'), dedupedDefs.join('\n')); +}); +