diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0eb7a62..a55844d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -181,17 +181,11 @@ jobs: needs: [build] runs-on: ubuntu-latest steps: - - name: Sanity Check no. 1 - run: | - echo ${{ github.sha }} - name: Checkout uses: actions/checkout@v3 - uses: actions/download-artifact@v3 with: path: artifacts - - name: Sanity Check no. 2 - run: | - ls -laR ./artifacts/ - name: Extract Artifacts working-directory: artifacts run: | @@ -208,20 +202,21 @@ jobs: mkdir "$fn" tar -xvzf "$f" --directory="$fn"; done - - name: Sanity Check no. 3 - run: | - ls -laR ./artifacts/ - name: Setup .NET SDK uses: actions/setup-dotnet@5a3fa01c67e60dba8f95e2878436c7151c4b5f01 with: dotnet-version: 7.0.x - - name: Configure Version # TODO missing support for stable packages on releases (where VERSION_SUFFIX should not be appended) + - name: Configure Version run: | GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD | sed 's/\//-/g') GIT_COMMIT=$(git log -1 --format=%h ) CORE_VERSION=$(cat radix-engine-toolkit/Cargo.toml | grep -e '^version' | cut -d'"' -f 2) VERSION_SUFFIX=${GIT_BRANCH}-${GIT_COMMIT} VERSION=${CORE_VERSION}-${VERSION_SUFFIX} + + if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then + VERSION=${CORE_VERSION} + fi sed -i "s/\(\)[^<>]*\(<\/version>\)/\1$VERSION\2/g" interop/csharp/RadixDlt.RadixEngineToolkit.Native.nuspec @@ -229,10 +224,6 @@ jobs: - name: NuGet Pack working-directory: interop/csharp run: nuget pack - - name: Sanity Check no. 4 - run: | - md5sum ./artifacts/native/aarch64-apple-darwin/libradix_engine_toolkit.dylib - md5sum ./interop/csharp/RadixDlt.RadixEngineToolkit.Native.nuspec - name: Publish Packages working-directory: interop/csharp run: dotnet nuget push RadixDlt.RadixEngineToolkit.Native.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ORG_API_KEY }} \ No newline at end of file diff --git a/native-json-interface/Cargo.toml b/native-json-interface/Cargo.toml index 9fcfd577..007c74ed 100644 --- a/native-json-interface/Cargo.toml +++ b/native-json-interface/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "native-json-interface" -version = "0.8.0" +version = "0.8.1" edition = "2021" [dependencies] diff --git a/native-json-interface/src/lib.rs b/native-json-interface/src/lib.rs index c8ac1284..54e8ead7 100644 --- a/native-json-interface/src/lib.rs +++ b/native-json-interface/src/lib.rs @@ -68,6 +68,7 @@ pub mod native { export_handler!(InformationHandler as information); export_handler!(ConvertManifestHandler as convert_manifest); + export_handler!(AnalyzeManifestHandler as analyze_manifest); export_handler!(CompileTransactionIntentHandler as compile_transaction_intent); export_handler!(CompileSignedTransactionIntentHandler as compile_signed_transaction_intent); @@ -167,6 +168,9 @@ pub mod jni { export_handler!( ConvertManifestHandler as Java_com_radixdlt_toolkit_RadixEngineToolkitFFI_convertManifest ); + export_handler!( + AnalyzeManifestHandler as Java_com_radixdlt_toolkit_RadixEngineToolkitFFI_analyzeManifest + ); export_handler!( CompileTransactionIntentHandler diff --git a/radix-engine-toolkit/Cargo.toml b/radix-engine-toolkit/Cargo.toml index c76e1fac..96f70bc9 100644 --- a/radix-engine-toolkit/Cargo.toml +++ b/radix-engine-toolkit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "radix-engine-toolkit" -version = "0.8.0" +version = "0.8.1" edition = "2021" build = "build.rs" diff --git a/radix-engine-toolkit/src/model/instruction.rs b/radix-engine-toolkit/src/model/instruction.rs index b7fd7e38..cabbdc47 100644 --- a/radix-engine-toolkit/src/model/instruction.rs +++ b/radix-engine-toolkit/src/model/instruction.rs @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -use std::collections::HashSet; +use std::collections::BTreeSet; use crate::address::Bech32Coder; use crate::error::Result; @@ -115,7 +115,7 @@ pub enum Instruction { /// The non-fungible ids to take from the worktop. This is a set (serialized as a JSON /// array) of `NonFungibleLocalId`s from the Value model. - #[schemars(with = "HashSet")] + #[schemars(with = "BTreeSet")] ids: Vec, /// A bucket to put the taken resources into. This field is serialized as a `Bucket` from @@ -157,7 +157,7 @@ pub enum Instruction { /// The non-fungible ids of the resource to assert their existence in the worktop. This is /// a set (serialized as a JSON array) of `NonFungibleLocalId`s from the Value model. - #[schemars(with = "HashSet")] + #[schemars(with = "BTreeSet")] ids: Vec, }, @@ -216,7 +216,7 @@ pub enum Instruction { /// The non-fungible ids to create a proof of. This is a set (serialized as a JSON array) /// of `NonFungibleLocalId`s from the Value model. - #[schemars(with = "HashSet")] + #[schemars(with = "BTreeSet")] ids: Vec, /// A proof to put the resource proof into. This field is serialized as a `Proof` from the diff --git a/radix-engine-toolkit/src/request/analyze_manifest.rs b/radix-engine-toolkit/src/request/analyze_manifest.rs new file mode 100644 index 00000000..80298c64 --- /dev/null +++ b/radix-engine-toolkit/src/request/analyze_manifest.rs @@ -0,0 +1,201 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +use std::collections::BTreeSet; + +use crate::error::Result; +use crate::model::instruction_list::InstructionKind; +use crate::model::TransactionManifest; +use crate::{ + traverse_instruction, AccountInteractionsInstructionVisitor, AddressValueAggregator, + ConvertManifestHandler, Handler, Instruction, InstructionList, NetworkAwareComponentAddress, + NetworkAwarePackageAddress, NetworkAwareResourceAddress, ValueNetworkAggregatorVisitor, +}; +use scrypto::prelude::ComponentAddress; +use serializable::serializable; + +// ================= +// Model Definition +// ================= + +/// Analyzes the passed manifest to determine the entities that this manifest interacts with. +#[serializable] +pub struct AnalyzeManifestRequest { + /// An unsigned 8 bit integer serialized as a string which represents the ID of the network + /// that the manifest will be used on. The primary use of this is for any Bech32m encoding + /// or decoding of addresses + #[schemars(with = "String")] + #[schemars(regex(pattern = "[0-9]+"))] + #[serde_as(as = "serde_with::DisplayFromStr")] + pub network_id: u8, + + /// The manifest to convert to the format described by `instructions_output_kind` + pub manifest: TransactionManifest, +} + +/// The response of the [`AnalyzeManifestRequest`] +#[serializable] +pub struct AnalyzeManifestResponse { + /// A set of all of the package addresses seen in the manifest. The underlying type of this is + /// an array of `PackageAddress`es from the `Value` model. + #[schemars(with = "BTreeSet")] + #[serde_as(as = "BTreeSet>")] + pub package_addresses: BTreeSet, + + /// A set of all of the component addresses seen in the manifest. The underlying type of this + /// is an array of `ComponentAddress`es from the `Value` model. + #[schemars(with = "BTreeSet")] + #[serde_as(as = "BTreeSet>")] + pub component_addresses: BTreeSet, + + /// A set of all of the resource addresses seen in the manifest. The underlying type of this is + /// an array of `ResourceAddress`es from the `Value` model. + #[schemars(with = "BTreeSet")] + #[serde_as(as = "BTreeSet>")] + pub resource_addresses: BTreeSet, + + /// A set of all of the account component addresses seen in the manifest. The underlying type + /// of this is an array of `ComponentAddress`es from the `Value` model. + #[schemars(with = "BTreeSet")] + #[serde_as(as = "BTreeSet>")] + pub account_addresses: BTreeSet, + + /// A set of all of the account component addresses in the manifest which had methods invoked + /// on them that would typically require auth (or a signature) to be called successfully. + /// This is a subset of the addresses seen in `account_addresses`. The underlying type of + /// this is an array of `ComponentAddress`es from the `Value` model. + #[schemars(with = "BTreeSet")] + #[serde_as(as = "BTreeSet>")] + pub accounts_requiring_auth: BTreeSet, + + /// A set of all of the account component addresses in the manifest which were withdrawn from. + /// This is a subset of the addresses seen in `account_addresses`. The underlying type of this + /// is an array of `ComponentAddress`es from the `Value` model. + #[schemars(with = "BTreeSet")] + #[serde_as(as = "BTreeSet>")] + pub accounts_withdrawn_from: BTreeSet, + + /// A set of all of the account component addresses in the manifest which were deposited into. + /// This is a subset of the addresses seen in `account_addresses`. The underlying type of this + /// is an array of `ComponentAddress`es from the `Value` model. + #[schemars(with = "BTreeSet")] + #[serde_as(as = "BTreeSet>")] + pub accounts_deposited_into: BTreeSet, +} + +// =============== +// Implementation +// =============== + +pub struct AnalyzeManifestHandler; + +impl Handler for AnalyzeManifestHandler { + fn pre_process(mut request: AnalyzeManifestRequest) -> Result { + // Visitors + let mut network_aggregator_visitor = ValueNetworkAggregatorVisitor::default(); + + // Instructions + let instructions: &mut [Instruction] = match request.manifest.instructions { + InstructionList::Parsed(ref mut instructions) => instructions, + InstructionList::String(..) => &mut [], + }; + + // Traverse instructions with visitors + instructions + .iter_mut() + .map(|instruction| { + traverse_instruction(instruction, &mut [&mut network_aggregator_visitor], &mut []) + }) + .collect::>>()?; + + // Check for network mismatches + if let Some(network_id) = network_aggregator_visitor + .0 + .iter() + .find(|network_id| **network_id != request.network_id) + { + return Err(crate::Error::NetworkMismatchError { + found: *network_id, + expected: request.network_id, + }); + } + Ok(request) + } + + fn handle(request: &AnalyzeManifestRequest) -> Result { + // Getting the instructions in the passed manifest as parsed instructions + let mut instructions = { + let manifest = ConvertManifestHandler::fulfill(crate::ConvertManifestRequest { + network_id: request.network_id, + instructions_output_kind: InstructionKind::Parsed, + manifest: request.manifest.clone(), + })? + .manifest; + + match manifest.instructions { + InstructionList::Parsed(instructions) => Ok(instructions), + InstructionList::String(..) => Err(crate::error::Error::Infallible { + message: "Impossible Case! We converted to parsed but it's still a string!" + .into(), + }), + } + }?; + + // Setting up the visitors and traversing the instructions + let mut address_aggregator_visitor = AddressValueAggregator::default(); + let mut account_interactions_visitor = AccountInteractionsInstructionVisitor::default(); + instructions + .iter_mut() + .map(|instruction| { + traverse_instruction( + instruction, + &mut [&mut address_aggregator_visitor], + &mut [&mut account_interactions_visitor], + ) + }) + .collect::>>()?; + + let response = AnalyzeManifestResponse { + package_addresses: address_aggregator_visitor.package_addresses, + resource_addresses: address_aggregator_visitor.resource_addresses, + component_addresses: address_aggregator_visitor.component_addresses.clone(), + account_addresses: address_aggregator_visitor + .component_addresses + .into_iter() + .filter(|address| { + matches!( + address.address, + ComponentAddress::Account(..) + | ComponentAddress::EcdsaSecp256k1VirtualAccount(..) + | ComponentAddress::EddsaEd25519VirtualAccount(..) + ) + }) + .collect(), + accounts_requiring_auth: account_interactions_visitor.auth_required, + accounts_withdrawn_from: account_interactions_visitor.accounts_withdrawn_from, + accounts_deposited_into: account_interactions_visitor.accounts_deposited_into, + }; + Ok(response) + } + + fn post_process( + _: &AnalyzeManifestRequest, + response: AnalyzeManifestResponse, + ) -> Result { + Ok(response) + } +} diff --git a/radix-engine-toolkit/src/request/mod.rs b/radix-engine-toolkit/src/request/mod.rs index fa68efc8..7617331d 100644 --- a/radix-engine-toolkit/src/request/mod.rs +++ b/radix-engine-toolkit/src/request/mod.rs @@ -40,11 +40,13 @@ pub mod derive_non_fungible_global_id_from_public_key; pub mod derive_virtual_account_address; pub mod derive_virtual_identity_address; +pub mod analyze_manifest; pub mod known_entity_addresses; pub mod statically_validate_transaction; pub mod traits; +pub use analyze_manifest::*; pub use compile_notarized_transaction::*; pub use compile_signed_transaction_intent::*; pub use compile_transaction_intent::*; diff --git a/radix-engine-toolkit/src/visitor/instruction/account_interactions_visitor.rs b/radix-engine-toolkit/src/visitor/instruction/account_interactions_visitor.rs new file mode 100644 index 00000000..540ff607 --- /dev/null +++ b/radix-engine-toolkit/src/visitor/instruction/account_interactions_visitor.rs @@ -0,0 +1,153 @@ +use std::collections::BTreeSet; + +use crate::{InstructionVisitor, NetworkAwareComponentAddress, Value}; +use scrypto::prelude::ComponentAddress; + +/// A visitor whose main responsibility is determining the kind of interactions involved with +/// accounts +#[derive(Debug, Default)] +pub struct AccountInteractionsInstructionVisitor { + pub auth_required: BTreeSet, + pub accounts_withdrawn_from: BTreeSet, + pub accounts_deposited_into: BTreeSet, +} + +impl AccountInteractionsInstructionVisitor { + const AUTH_REQUIRING_METHODS: &'static [&'static str] = &[ + "lock_fee", + "lock_contingent_fee", + "withdraw", + "withdraw_by_amount", + "withdraw_by_ids", + "lock_fee_and_withdraw", + "lock_fee_and_withdraw_by_amount", + "lock_fee_and_withdraw_by_ids", + "create_proof", + "create_proof_by_amount", + "create_proof_by_ids", + ]; + const WITHDRAW_METHODS: &'static [&'static str] = + &["withdraw", "withdraw_by_amount", "withdraw_by_ids"]; + const DEPOSIT_METHODS: &'static [&'static str] = &["deposit", "deposit_batch"]; +} + +impl InstructionVisitor for AccountInteractionsInstructionVisitor { + fn visit_call_method( + &mut self, + component_address: &mut Value, + method_name: &mut Value, + _: &mut Option>, + ) -> crate::Result<()> { + if let ( + Value::ComponentAddress { + address: + component_address @ NetworkAwareComponentAddress { + address: + ComponentAddress::Account(..) + | ComponentAddress::EcdsaSecp256k1VirtualAccount(..) + | ComponentAddress::EddsaEd25519VirtualAccount(..), + .. + }, + }, + Value::String { value: method_name }, + ) = (component_address, method_name) + { + if Self::AUTH_REQUIRING_METHODS.contains(&method_name.as_str()) { + self.auth_required.insert(*component_address); + } + if Self::WITHDRAW_METHODS.contains(&method_name.as_str()) { + self.accounts_withdrawn_from.insert(*component_address); + } + if Self::DEPOSIT_METHODS.contains(&method_name.as_str()) { + self.accounts_deposited_into.insert(*component_address); + } + }; + Ok(()) + } + + fn visit_set_metadata( + &mut self, + entity_address: &mut Value, + _: &mut Value, + _: &mut Value, + ) -> crate::Result<()> { + if let Value::ComponentAddress { + address: + component_address @ NetworkAwareComponentAddress { + address: + ComponentAddress::Account(..) + | ComponentAddress::EcdsaSecp256k1VirtualAccount(..) + | ComponentAddress::EddsaEd25519VirtualAccount(..), + .. + }, + } = entity_address + { + self.auth_required.insert(*component_address); + }; + Ok(()) + } + + fn visit_set_component_royalty_config( + &mut self, + component_address: &mut crate::Value, + _: &mut crate::Value, + ) -> crate::Result<()> { + if let Value::ComponentAddress { + address: + component_address @ NetworkAwareComponentAddress { + address: + ComponentAddress::Account(..) + | ComponentAddress::EcdsaSecp256k1VirtualAccount(..) + | ComponentAddress::EddsaEd25519VirtualAccount(..), + .. + }, + } = component_address + { + self.auth_required.insert(*component_address); + }; + Ok(()) + } + + fn visit_claim_component_royalty( + &mut self, + component_address: &mut crate::Value, + ) -> crate::Result<()> { + if let Value::ComponentAddress { + address: + component_address @ NetworkAwareComponentAddress { + address: + ComponentAddress::Account(..) + | ComponentAddress::EcdsaSecp256k1VirtualAccount(..) + | ComponentAddress::EddsaEd25519VirtualAccount(..), + .. + }, + } = component_address + { + self.auth_required.insert(*component_address); + }; + Ok(()) + } + + fn visit_set_method_access_rule( + &mut self, + entity_address: &mut crate::Value, + _: &mut crate::Value, + _: &mut crate::Value, + _: &mut crate::Value, + ) -> crate::Result<()> { + if let Value::ComponentAddress { + address: + component_address @ NetworkAwareComponentAddress { + address: + ComponentAddress::Account(..) + | ComponentAddress::EcdsaSecp256k1VirtualAccount(..) + | ComponentAddress::EddsaEd25519VirtualAccount(..), + .. + }, + } = entity_address + { + self.auth_required.insert(*component_address); + }; + Ok(()) + } +} diff --git a/radix-engine-toolkit/src/visitor/instruction/mod.rs b/radix-engine-toolkit/src/visitor/instruction/mod.rs index 1378a01c..dbe07997 100644 --- a/radix-engine-toolkit/src/visitor/instruction/mod.rs +++ b/radix-engine-toolkit/src/visitor/instruction/mod.rs @@ -1,3 +1,5 @@ +pub mod account_interactions_visitor; pub mod instruction_visitor; +pub use account_interactions_visitor::*; pub use instruction_visitor::*; diff --git a/radix-engine-toolkit/src/visitor/value/address_aggregator_visitor.rs b/radix-engine-toolkit/src/visitor/value/address_aggregator_visitor.rs new file mode 100644 index 00000000..1ebcfb0d --- /dev/null +++ b/radix-engine-toolkit/src/visitor/value/address_aggregator_visitor.rs @@ -0,0 +1,61 @@ +use std::collections::BTreeSet; + +use crate::{ + NetworkAwareComponentAddress, NetworkAwarePackageAddress, NetworkAwareResourceAddress, Value, + ValueVisitor, +}; + +/// An address aggregator visitor which collects all of the encountered global entity addresses and +/// stored them in its state. +#[derive(Debug, Default)] +pub struct AddressValueAggregator { + pub component_addresses: BTreeSet, + pub resource_addresses: BTreeSet, + pub package_addresses: BTreeSet, +} + +impl ValueVisitor for AddressValueAggregator { + fn visit_component_address(&mut self, value: &mut crate::Value) -> crate::Result<()> { + if let Value::ComponentAddress { address } = value { + self.component_addresses.insert(*address); + Ok(()) + } else { + Err(crate::Error::Infallible { + message: "Expected component address!".into(), + }) + } + } + + fn visit_resource_address(&mut self, value: &mut crate::Value) -> crate::Result<()> { + if let Value::ResourceAddress { address } = value { + self.resource_addresses.insert(*address); + Ok(()) + } else { + Err(crate::Error::Infallible { + message: "Expected resource address!".into(), + }) + } + } + + fn visit_package_address(&mut self, value: &mut crate::Value) -> crate::Result<()> { + if let Value::PackageAddress { address } = value { + self.package_addresses.insert(*address); + Ok(()) + } else { + Err(crate::Error::Infallible { + message: "Expected package address!".into(), + }) + } + } + + fn visit_non_fungible_global_id(&mut self, value: &mut crate::Value) -> crate::Result<()> { + if let Value::NonFungibleGlobalId { address } = value { + self.resource_addresses.insert(address.resource_address); + Ok(()) + } else { + Err(crate::Error::Infallible { + message: "Expected non-fungible global id!".into(), + }) + } + } +} diff --git a/radix-engine-toolkit/src/visitor/value/mod.rs b/radix-engine-toolkit/src/visitor/value/mod.rs index c2a946d5..38ce310f 100644 --- a/radix-engine-toolkit/src/visitor/value/mod.rs +++ b/radix-engine-toolkit/src/visitor/value/mod.rs @@ -1,7 +1,9 @@ +pub mod address_aggregator_visitor; pub mod aliasing_visitor; pub mod network_aggregator_visitor; pub mod value_visitor; +pub use address_aggregator_visitor::*; pub use aliasing_visitor::*; pub use network_aggregator_visitor::*; pub use value_visitor::*; diff --git a/radix-engine-toolkit/src/visitor/value/network_aggregator_visitor.rs b/radix-engine-toolkit/src/visitor/value/network_aggregator_visitor.rs index d07f7c43..fe63e602 100644 --- a/radix-engine-toolkit/src/visitor/value/network_aggregator_visitor.rs +++ b/radix-engine-toolkit/src/visitor/value/network_aggregator_visitor.rs @@ -1,4 +1,4 @@ -use std::collections::HashSet; +use std::collections::BTreeSet; use crate::{Value, ValueVisitor}; @@ -6,7 +6,7 @@ use crate::{Value, ValueVisitor}; /// addresses use. This is typically used in operations where we wish to check for network id /// mismatches. #[derive(Debug, Default)] -pub struct ValueNetworkAggregatorVisitor(pub HashSet); +pub struct ValueNetworkAggregatorVisitor(pub BTreeSet); impl ValueVisitor for ValueNetworkAggregatorVisitor { fn visit_component_address(&mut self, value: &mut crate::Value) -> crate::Result<()> { diff --git a/schema/out/examples/request-examples.md b/schema/out/examples/request-examples.md index 6928a8f0..80abe252 100644 --- a/schema/out/examples/request-examples.md +++ b/schema/out/examples/request-examples.md @@ -552,6 +552,86 @@ This document contains examples and descriptions of the different requests and r ``` +## Analyze Manifest + +| Function Name | `analyze_manifest` | +| ----------------- | :----------------- | +| JNI Function Name | `Java_RadixEngineToolkitFFI_analyzeManifest` | +| Functionality | Analyzes the manifest returning back all of the addresses involved in the manifest alongside some useful information on whether the accounts were withdrawn from, deposited into, or just used in the manifest in general. | +| Request Type | `AnalyzeManifestRequest` | +| Response Type | `AnalyzeManifestResponse` | + +
+ Request Example + +```json +{ + "network_id": "242", + "manifest": { + "instructions": { + "type": "String", + "value": "CALL_METHOD\n ComponentAddress(\"account_sim1q02r73u7nv47h80e30pc3q6ylsj7mgvparm3pnsm780qgsy064\")\n \"withdraw_by_amount\"\n Decimal(\"5\")\n ResourceAddress(\"resource_sim1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzqu57yag\");\nTAKE_FROM_WORKTOP_BY_AMOUNT\n Decimal(\"2\")\n ResourceAddress(\"resource_sim1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzqu57yag\")\n Bucket(\"bucket1\");\nCALL_METHOD\n ComponentAddress(\"component_sim1q2f9vmyrmeladvz0ejfttcztqv3genlsgpu9vue83mcs835hum\")\n \"buy_gumball\"\n Bucket(\"bucket1\");\nASSERT_WORKTOP_CONTAINS_BY_AMOUNT\n Decimal(\"3\")\n ResourceAddress(\"resource_sim1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzqu57yag\");\nASSERT_WORKTOP_CONTAINS\n ResourceAddress(\"resource_sim1qzhdk7tq68u8msj38r6v6yqa5myc64ejx3ud20zlh9gseqtux6\");\nTAKE_FROM_WORKTOP\n ResourceAddress(\"resource_sim1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzqu57yag\")\n Bucket(\"bucket2\");\nCREATE_PROOF_FROM_BUCKET\n Bucket(\"bucket2\")\n Proof(\"proof1\");\nCLONE_PROOF\n Proof(\"proof1\")\n Proof(\"proof2\");\nDROP_PROOF\n Proof(\"proof1\");\nDROP_PROOF\n Proof(\"proof2\");\nCALL_METHOD\n ComponentAddress(\"account_sim1q02r73u7nv47h80e30pc3q6ylsj7mgvparm3pnsm780qgsy064\")\n \"create_proof_by_amount\"\n Decimal(\"5\")\n ResourceAddress(\"resource_sim1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzqu57yag\");\nPOP_FROM_AUTH_ZONE\n Proof(\"proof3\");\nDROP_PROOF\n Proof(\"proof3\");\nRETURN_TO_WORKTOP\n Bucket(\"bucket2\");\nTAKE_FROM_WORKTOP_BY_IDS\n Array(NonFungibleLocalId(\"#1#\"))\n ResourceAddress(\"resource_sim1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzqu57yag\")\n Bucket(\"bucket3\");\nDROP_ALL_PROOFS;\nCALL_METHOD\n ComponentAddress(\"account_sim1q02r73u7nv47h80e30pc3q6ylsj7mgvparm3pnsm780qgsy064\")\n \"deposit_batch\"\n Expression(\"ENTIRE_WORKTOP\");\n" + }, + "blobs": [] + } +} +``` +
+ +
+ Response Example + +```json +{ + "package_addresses": [], + "component_addresses": [ + { + "type": "ComponentAddress", + "address": "component_sim1q2f9vmyrmeladvz0ejfttcztqv3genlsgpu9vue83mcs835hum" + }, + { + "type": "ComponentAddress", + "address": "account_sim1q02r73u7nv47h80e30pc3q6ylsj7mgvparm3pnsm780qgsy064" + } + ], + "resource_addresses": [ + { + "type": "ResourceAddress", + "address": "resource_sim1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzqu57yag" + }, + { + "type": "ResourceAddress", + "address": "resource_sim1qzhdk7tq68u8msj38r6v6yqa5myc64ejx3ud20zlh9gseqtux6" + } + ], + "account_addresses": [ + { + "type": "ComponentAddress", + "address": "account_sim1q02r73u7nv47h80e30pc3q6ylsj7mgvparm3pnsm780qgsy064" + } + ], + "accounts_requiring_auth": [ + { + "type": "ComponentAddress", + "address": "account_sim1q02r73u7nv47h80e30pc3q6ylsj7mgvparm3pnsm780qgsy064" + } + ], + "accounts_withdrawn_from": [ + { + "type": "ComponentAddress", + "address": "account_sim1q02r73u7nv47h80e30pc3q6ylsj7mgvparm3pnsm780qgsy064" + } + ], + "accounts_deposited_into": [ + { + "type": "ComponentAddress", + "address": "account_sim1q02r73u7nv47h80e30pc3q6ylsj7mgvparm3pnsm780qgsy064" + } + ] +} +``` +
+ ## Compile Transaction Intent | Function Name | `compile_transaction_intent` | diff --git a/schema/out/schema/analyze_manifest_request.json b/schema/out/schema/analyze_manifest_request.json new file mode 100644 index 00000000..04743b1e --- /dev/null +++ b/schema/out/schema/analyze_manifest_request.json @@ -0,0 +1,2697 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AnalyzeManifestRequest", + "description": "Analyzes the passed manifest to determine the entities that this manifest interacts with.", + "type": "object", + "required": [ + "manifest", + "network_id" + ], + "properties": { + "network_id": { + "description": "An unsigned 8 bit integer serialized as a string which represents the ID of the network that the manifest will be used on. The primary use of this is for any Bech32m encoding or decoding of addresses", + "type": "string", + "pattern": "[0-9]+" + }, + "manifest": { + "description": "The manifest to convert to the format described by `instructions_output_kind`", + "allOf": [ + { + "$ref": "#/definitions/TransactionManifest" + } + ] + } + }, + "definitions": { + "TransactionManifest": { + "description": "A transaction intent consisting of instructions as well as blobs", + "type": "object", + "required": [ + "blobs", + "instructions" + ], + "properties": { + "instructions": { + "description": "The transaction manifest instructions to be executed in the transaction.", + "allOf": [ + { + "$ref": "#/definitions/InstructionList" + } + ] + }, + "blobs": { + "description": "An array of byte arrays which is serialized as an array of hex strings which represents the blobs included in the transaction.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "InstructionList": { + "description": "A discriminated union of possible representations of manifest instructions. Currently, two representations are supported: a string representation which is the same as that seen in the local simulator, resim, and pretty much everywhere, as well as a parsed format which is a vector of instructions where each instruction is represented through the `Instruction` model.", + "oneOf": [ + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "String" + ] + }, + "value": { + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Parsed" + ] + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Instruction" + } + } + } + } + ] + }, + "Instruction": { + "description": "The Instruction model defines the structure that transaction manifest instructions follow during communication with the Radix Engine Toolkit", + "oneOf": [ + { + "description": "An instruction to call a function with the given list of arguments on the given package address and blueprint name.", + "type": "object", + "required": [ + "blueprint_name", + "function_name", + "instruction", + "package_address" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CALL_FUNCTION" + ] + }, + "package_address": { + "description": "The address of the package containing the blueprint that contains the desired function. This package address is serialized as the `PackageAddress` variant of the `Value` model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "blueprint_name": { + "description": "A string of the name of the blueprint containing the desired function. This field is serialized as a `String` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "function_name": { + "description": "A string of the name of the function to call. This field is serialized as a `String` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "arguments": { + "description": "An optional array of `Value` arguments to call the function with. If this array is empty or is not provided, then the function is called with no arguments.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + { + "description": "An instruction to call a method with a given name on a given component address with the given list of arguments.", + "type": "object", + "required": [ + "component_address", + "instruction", + "method_name" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CALL_METHOD" + ] + }, + "component_address": { + "description": "The address of the component which contains the method to be invoked. This field is serialized as a `ComponentAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "method_name": { + "description": "A string of the name of the method to call. his field is serialized as a `String` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "arguments": { + "description": "An optional array of `Value` arguments to call the method with. If this array is empty or is not provided, then the method is called with no arguments.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + { + "description": "An instruction to take the entire amount of a given resource address from the worktop and put it in a bucket.", + "type": "object", + "required": [ + "instruction", + "into_bucket", + "resource_address" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "TAKE_FROM_WORKTOP" + ] + }, + "resource_address": { + "description": "The address of the resource to take from the worktop. This field is serialized as a `ResourceAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "into_bucket": { + "description": "A bucket to put the taken resources into. This field is serialized as a `Bucket` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to take the an amount of a given resource address from the worktop and put it in a bucket.", + "type": "object", + "required": [ + "amount", + "instruction", + "into_bucket", + "resource_address" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "TAKE_FROM_WORKTOP_BY_AMOUNT" + ] + }, + "resource_address": { + "description": "The address of the resource to take from the worktop. This field is serialized as a `ResourceAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "amount": { + "description": "The amount of the resource to take from the worktop. This field is serialized as a `Decimal` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "into_bucket": { + "description": "A bucket to put the taken resources into. This field is serialized as a `Bucket` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to take the a set of non-fungible ids of a given resource address from the worktop and put it in a bucket.", + "type": "object", + "required": [ + "ids", + "instruction", + "into_bucket", + "resource_address" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "TAKE_FROM_WORKTOP_BY_IDS" + ] + }, + "resource_address": { + "description": "The address of the resource to take from the worktop. This field is serialized as a `ResourceAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "ids": { + "description": "The non-fungible ids to take from the worktop. This is a set (serialized as a JSON array) of `NonFungibleLocalId`s from the Value model.", + "type": "array", + "items": { + "$ref": "#/definitions/NonFungibleLocalId" + }, + "uniqueItems": true + }, + "into_bucket": { + "description": "A bucket to put the taken resources into. This field is serialized as a `Bucket` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "Returns a bucket of tokens to the worktop.", + "type": "object", + "required": [ + "bucket", + "instruction" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "RETURN_TO_WORKTOP" + ] + }, + "bucket": { + "description": "The bucket to return to the worktop.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to assert that a given resource exists in the worktop.", + "type": "object", + "required": [ + "instruction", + "resource_address" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "ASSERT_WORKTOP_CONTAINS" + ] + }, + "resource_address": { + "description": "The address of the resource to perform the assertion on. This field is serialized as a `ResourceAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to assert that a specific amount of a specific resource address exists in the worktop.", + "type": "object", + "required": [ + "amount", + "instruction", + "resource_address" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "ASSERT_WORKTOP_CONTAINS_BY_AMOUNT" + ] + }, + "resource_address": { + "description": "The address of the resource to perform the assertion on. This field is serialized as a `ResourceAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "amount": { + "description": "The amount of the resource to assert their existence in the worktop. This field is serialized as a `Decimal` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to assert that a set ids of a specific resource address exists in the worktop.", + "type": "object", + "required": [ + "ids", + "instruction", + "resource_address" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "ASSERT_WORKTOP_CONTAINS_BY_IDS" + ] + }, + "resource_address": { + "description": "The address of the resource to perform the assertion on. This field is serialized as a `ResourceAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "ids": { + "description": "The non-fungible ids of the resource to assert their existence in the worktop. This is a set (serialized as a JSON array) of `NonFungibleLocalId`s from the Value model.", + "type": "array", + "items": { + "$ref": "#/definitions/NonFungibleLocalId" + }, + "uniqueItems": true + } + } + }, + { + "description": "An instruction which pops a proof from the AuthZone stack and into an identifiable proof", + "type": "object", + "required": [ + "instruction", + "into_proof" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "POP_FROM_AUTH_ZONE" + ] + }, + "into_proof": { + "description": "The proof to put the popped proof into. This is serialized as a `Proof` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction that pushes a proof to the auth zone stack.", + "type": "object", + "required": [ + "instruction", + "proof" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "PUSH_TO_AUTH_ZONE" + ] + }, + "proof": { + "description": "The proof to push to the auth zone stack. This is serialized as a `Proof` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction which clears the auth zone stack by dropping all of the proofs in that stack.", + "type": "object", + "required": [ + "instruction" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CLEAR_AUTH_ZONE" + ] + } + } + }, + { + "description": "An instruction to create a proof of the entire amount of a given resource address from the auth zone.", + "type": "object", + "required": [ + "instruction", + "into_proof", + "resource_address" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CREATE_PROOF_FROM_AUTH_ZONE" + ] + }, + "resource_address": { + "description": "The address of the resource to create a proof of. This field is serialized as a `ResourceAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "into_proof": { + "description": "A proof to put the resource proof into. This field is serialized as a `Proof` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to create a proof of the an amount of a given resource address from the auth zone.", + "type": "object", + "required": [ + "amount", + "instruction", + "into_proof", + "resource_address" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CREATE_PROOF_FROM_AUTH_ZONE_BY_AMOUNT" + ] + }, + "resource_address": { + "description": "The address of the resource to create a proof of. This field is serialized as a `ResourceAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "amount": { + "description": "The amount of the resource to create a proof of. This field is serialized as a `Decimal` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "into_proof": { + "description": "A proof to put the resource proof into. This field is serialized as a `Proof` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to create a proof of the a set of non-fungible ids of a given resource address from the auth zone.", + "type": "object", + "required": [ + "ids", + "instruction", + "into_proof", + "resource_address" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CREATE_PROOF_FROM_AUTH_ZONE_BY_IDS" + ] + }, + "resource_address": { + "description": "The address of the resource to create a proof of. This field is serialized as a `ResourceAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "ids": { + "description": "The non-fungible ids to create a proof of. This is a set (serialized as a JSON array) of `NonFungibleLocalId`s from the Value model.", + "type": "array", + "items": { + "$ref": "#/definitions/NonFungibleLocalId" + }, + "uniqueItems": true + }, + "into_proof": { + "description": "A proof to put the resource proof into. This field is serialized as a `Proof` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to create a proof given a bucket of some resources", + "type": "object", + "required": [ + "bucket", + "instruction", + "into_proof" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CREATE_PROOF_FROM_BUCKET" + ] + }, + "bucket": { + "description": "The bucket of resources to create a proof from. This field is serialized as a `Bucket` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "into_proof": { + "description": "The proof variable that the proof should go to. This field is serialized as a `Proof` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to clone a proof creating a second proof identical to the original", + "type": "object", + "required": [ + "instruction", + "into_proof", + "proof" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CLONE_PROOF" + ] + }, + "proof": { + "description": "The original proof, or the proof to be cloned. This field is serialized as a `Proof` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "into_proof": { + "description": "The proof variable that the proof should go to. This field is serialized as a `Proof` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to drop a proof.", + "type": "object", + "required": [ + "instruction", + "proof" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "DROP_PROOF" + ] + }, + "proof": { + "description": "The proof to drop. This field is serialized as a `Proof` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to drop all proofs currently present in the transaction context.", + "type": "object", + "required": [ + "instruction" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "DROP_ALL_PROOFS" + ] + } + } + }, + { + "description": "An instruction to publish a package and set it's associated royalty configs, metadata, and access rules.", + "type": "object", + "required": [ + "abi", + "access_rules", + "code", + "instruction", + "metadata", + "royalty_config" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "PUBLISH_PACKAGE" + ] + }, + "code": { + "description": "The blob of the package code. This field is serialized as a `Blob` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "abi": { + "description": "The blob of the package ABI. This field is serialized as a `Blob` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "royalty_config": { + "description": "The configurations of the royalty for the package. The underlying type of this is a Map where the key is a string of the blueprint name and the value is a `RoyaltyConfig`. This is serialized as an `Map` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "metadata": { + "description": "The metadata to use for the package. The underlying type of this is a string-string Map of the metadata. This is serialized as an `Map` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "access_rules": { + "description": "The access rules to use for the package. This is serialized as a `Tuple` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to publish a package with an associated \"owner\" badge where all of the authority on the package is in the hands of said owner.", + "type": "object", + "required": [ + "abi", + "code", + "instruction", + "owner_badge" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "PUBLISH_PACKAGE_WITH_OWNER" + ] + }, + "code": { + "description": "The blob of the package code. This field is serialized as a `Blob` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "abi": { + "description": "The blob of the package ABI. This field is serialized as a `Blob` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "owner_badge": { + "description": "The non-fungible address of the owner badge of this package. This field is serialized as a `NonFungibleGlobalId` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to burn a bucket of tokens.", + "type": "object", + "required": [ + "bucket", + "instruction" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "BURN_RESOURCE" + ] + }, + "bucket": { + "description": "The bucket of tokens to burn.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction ot recall resources from a known vault.", + "type": "object", + "required": [ + "amount", + "instruction", + "vault_id" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "RECALL_RESOURCE" + ] + }, + "vault_id": { + "description": "The id of the vault of the tokens to recall. This field is serialized as an `Own` from the value model and is expected to be an `Own::Vault`.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "amount": { + "description": "The amount of tokens to recall from the vault. This field is serialized as a `Decimal` field from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to set the metadata on an entity.", + "type": "object", + "required": [ + "entity_address", + "instruction", + "key", + "value" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "SET_METADATA" + ] + }, + "entity_address": { + "description": "The address of the entity to set metadata on. This is a discriminated union of types where it can either be a `ResourceAddress`, `ComponentAddress`, `PackageAddress` or a `ComponentAddress`.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "key": { + "description": "A string of the key to set the metadata for. This field is serialized as a `String` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "value": { + "description": "A string of the value to set the metadata for. This field is serialized as a `String` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to modify the royalties of a package.", + "type": "object", + "required": [ + "instruction", + "package_address", + "royalty_config" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "SET_PACKAGE_ROYALTY_CONFIG" + ] + }, + "package_address": { + "description": "The address of the package to set the royalty on. This is serialized as a `PackageAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "royalty_config": { + "description": "The configurations of the royalty for the package. The underlying type of this is a Map where the key is a string of the blueprint name and the value is a `RoyaltyConfig`. This is serialized as an `Map` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to modify the royalties on a component", + "type": "object", + "required": [ + "component_address", + "instruction", + "royalty_config" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "SET_COMPONENT_ROYALTY_CONFIG" + ] + }, + "component_address": { + "description": "The component address of the component to modify royalties for. This field is serialized as a `ComponentAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "royalty_config": { + "description": "The royalty config to set on the component. This is an `Enum` from the `Value` model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to claim royalties of a package", + "type": "object", + "required": [ + "instruction", + "package_address" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CLAIM_PACKAGE_ROYALTY" + ] + }, + "package_address": { + "description": "The package address of the package to claim royalties for. This field is serialized as a `PackageAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to claim royalties of a component", + "type": "object", + "required": [ + "component_address", + "instruction" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CLAIM_COMPONENT_ROYALTY" + ] + }, + "component_address": { + "description": "The component address of the component to claim royalties for. This field is serialized as a `ComponentAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to modify the access rules of a method that an entity has.", + "type": "object", + "required": [ + "entity_address", + "index", + "instruction", + "key", + "rule" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "SET_METHOD_ACCESS_RULE" + ] + }, + "entity_address": { + "description": "The entity address of the entity to modify the access rules for.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "index": { + "description": "Entity access rules is a stack of access rules, this index allows referring to a specific \"layer\" in said stack. This field is serialized as a `U32` from the `Value` model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "key": { + "description": "The method key for the method to set the access rule of. This field is serialized as an `Enum` from the Value model", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "rule": { + "description": "The new access rule to set in-place of the old one. This field is serialized as an `Enum` from the Value model", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to mint fungible resources", + "type": "object", + "required": [ + "amount", + "instruction", + "resource_address" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "MINT_FUNGIBLE" + ] + }, + "resource_address": { + "description": "The address of the resource to mint tokens of. This field is serialized as a `ResourceAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "amount": { + "description": "The amount of fungible tokens to mint of this resource. This field is serialized as a `Decimal` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to mint non-fungibles of a resource", + "type": "object", + "required": [ + "entries", + "instruction", + "resource_address" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "MINT_NON_FUNGIBLE" + ] + }, + "resource_address": { + "description": "The address of the resource to mint tokens of. This field is serialized as a `ResourceAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "entries": { + "description": "The non-fungible tokens to mint. The underlying type of this is a map which maps a `NonFungibleLocalId` to a tuple of two `Value` elements where each element is a struct of the immutable and mutable parts of the non-fungible data.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to mint non-fungibles of a non-fungible resource that uses UUID as the type id and perform auto incrimination of ID.", + "type": "object", + "required": [ + "entries", + "instruction", + "resource_address" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "MINT_UUID_NON_FUNGIBLE" + ] + }, + "resource_address": { + "description": "The address of the resource to mint tokens of. This field is serialized as a `ResourceAddress` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "entries": { + "description": "The non-fungible tokens to mint. The underlying type is a vector of tuples of two `Value` elements where each element is a struct of the immutable and mutable parts of the non-fungible data.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to create a new fungible resource.", + "type": "object", + "required": [ + "access_rules", + "divisibility", + "initial_supply", + "instruction", + "metadata" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CREATE_FUNGIBLE_RESOURCE" + ] + }, + "divisibility": { + "description": "The divisibility of the resource. This field is serialized as a `U8` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "metadata": { + "description": "The metadata to set on the resource. The underlying type of this is a string-string Map of the metadata. This is serialized as an `Map` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "access_rules": { + "description": "The access rules to use for the resource. The underlying type of this is a map which maps a `ResourceMethodAuthKey` enum to a tuple of two `AccessRule`s denoting the current behavior and the mutability. This is serialized as an `Map` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "initial_supply": { + "description": "An optional decimal value of the initial supply to mint during resource creation. If present, this is serialized as a `Decimal` from the value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to create a fungible resource with an associated \"owner\" badge where all of the authority on the resource is in the hands of said owner.", + "type": "object", + "required": [ + "divisibility", + "initial_supply", + "instruction", + "metadata", + "owner_badge" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CREATE_FUNGIBLE_RESOURCE_WITH_OWNER" + ] + }, + "divisibility": { + "description": "The divisibility of the resource. This field is serialized as a `U8` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "metadata": { + "description": "The metadata to set on the resource. The underlying type of this is a string-string Map of the metadata. This is serialized as an `Map` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "owner_badge": { + "description": "The non-fungible address of the owner badge of this resource. This field is serialized as a `NonFungibleGlobalId` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "initial_supply": { + "description": "An optional decimal value of the initial supply to mint during resource creation. If present, this is serialized as a `Decimal` from the value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to create a new non-fungible resource.", + "type": "object", + "required": [ + "access_rules", + "id_type", + "initial_supply", + "instruction", + "metadata" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CREATE_NON_FUNGIBLE_RESOURCE" + ] + }, + "id_type": { + "description": "The type of the non-fungible id to use for this resource. This field is serialized as an `Enum` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "metadata": { + "description": "The metadata to set on the resource. The underlying type of this is a string-string Map of the metadata. This is serialized as an `Map` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "access_rules": { + "description": "The access rules to use for the resource. The underlying type of this is a map which maps a `ResourceMethodAuthKey` enum to a tuple of two `AccessRule`s denoting the current behavior and the mutability. This is serialized as an `Map` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "initial_supply": { + "description": "An optional initial supply for the non-fungible resource being created. The underlying type of this is a map which maps a `NonFungibleLocalId` to a tuple of two `Value` elements where each element is a struct of the immutable and mutable parts of the non-fungible data.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "An instruction to create a non-fungible resource with an associated \"owner\" badge where all of the authority on the resource is in the hands of said owner.", + "type": "object", + "required": [ + "id_type", + "initial_supply", + "instruction", + "metadata", + "owner_badge" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CREATE_NON_FUNGIBLE_RESOURCE_WITH_OWNER" + ] + }, + "id_type": { + "description": "The type of the non-fungible id to use for this resource. This field is serialized as an `Enum` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "metadata": { + "description": "The metadata to set on the resource. The underlying type of this is a string-string Map of the metadata. This is serialized as an `Map` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "owner_badge": { + "description": "The non-fungible address of the owner badge of this resource. This field is serialized as a `NonFungibleGlobalId` from the Value model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "initial_supply": { + "description": "An optional initial supply for the non-fungible resource being created. The underlying type of this is a map which maps a `NonFungibleLocalId` to a tuple of two `Value` elements where each element is a struct of the immutable and mutable parts of the non-fungible data.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "Creates a new access controller native component with the passed set of rules as the current active rule set and the specified timed recovery delay in minutes.", + "type": "object", + "required": [ + "confirmation_role", + "controlled_asset", + "instruction", + "primary_role", + "recovery_role", + "timed_recovery_delay_in_minutes" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CREATE_ACCESS_CONTROLLER" + ] + }, + "controlled_asset": { + "description": "A bucket of the asset that will be controlled by the access controller. The underlying type of this is a `Bucket` from the `Value` model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "primary_role": { + "description": "The access rule to use for the primary role of the access controller. The underlying type of this is an `Enum` from the `Value` model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "recovery_role": { + "description": "The access rule to use for the recovery role of the access controller. The underlying type of this is an `Enum` from the `Value` model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "confirmation_role": { + "description": "The access rule to use for the confirmation role of the access controller. The underlying type of this is an `Enum` from the `Value` model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "timed_recovery_delay_in_minutes": { + "description": "The recovery delay in minutes to use for the access controller. The underlying type of this is an `Enum` or an `Option` from the `Value` model of an unsigned 32-bit integer of the time in minutes.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "Creates a new identity native component with the passed access rule.", + "type": "object", + "required": [ + "access_rule", + "instruction" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CREATE_IDENTITY" + ] + }, + "access_rule": { + "description": "The access rule to protect the identity with. The underlying type of this is an `Enum` from the `Value` model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "Assert that the given access rule is currently fulfilled by the proofs in the Auth Zone of the transaction", + "type": "object", + "required": [ + "access_rule", + "instruction" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "ASSERT_ACCESS_RULE" + ] + }, + "access_rule": { + "description": "The access rule to assert. The underlying type of this is an `Enum` from the `Value` model which represents the access rule to assert.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + }, + { + "description": "Creates a validator given the public key of the owner who controls it", + "type": "object", + "required": [ + "instruction", + "key", + "owner_access_rule" + ], + "properties": { + "instruction": { + "type": "string", + "enum": [ + "CREATE_VALIDATOR" + ] + }, + "key": { + "description": "The ECDSA Secp256k1 public key of the owner of the validator. The underlying type of this is an `EcdsaSecp256k1PublicKey` from the `Value` model.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + }, + "owner_access_rule": { + "description": "The access rule to protect the validator with. The underlying type of this is an `Enum` from the `Value` model which represents the access rule to assert.", + "allOf": [ + { + "$ref": "#/definitions/Value" + } + ] + } + } + } + ] + }, + "Value": { + "description": "The Value model used to describe all of the types that the Radix Engine Toolkit accepts and returns.", + "oneOf": [ + { + "description": "A boolean value which can either be true or false", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Bool" + ] + }, + "value": { + "type": "boolean" + } + } + }, + { + "description": "An 8-bit unsigned integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "U8" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 16-bit unsigned integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "U16" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 32-bit unsigned integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "U32" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 64-bit unsigned integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "U64" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 128-bit unsigned integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "U128" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "An 8-bit signed integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "I8" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 16-bit signed integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "I16" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 32-bit signed integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "I32" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 64-bit signed integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "I64" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 128-bit signed integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "I128" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A type representing a string", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "String" + ] + }, + "value": { + "type": "string" + } + } + }, + { + "description": "A Rust-style Enum which has a variant and can optionally also have a list of values (acting in a way similar to discriminated algebraic sum types)", + "type": "object", + "required": [ + "type", + "variant" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Enum" + ] + }, + "variant": { + "description": "The name of the variant of the enum", + "allOf": [ + { + "$ref": "#/definitions/EnumDiscriminator" + } + ] + }, + "fields": { + "description": "Optional fields that the enum may have", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + { + "description": "The `Some` case of Rust Options where the value is some Value", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Some" + ] + }, + "value": { + "$ref": "#/definitions/Value" + } + } + }, + { + "description": "The `None` case of Rust Options where there is value", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "None" + ] + } + } + }, + { + "description": "The `Ok` case of Rust Results where the value is some Value", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Ok" + ] + }, + "value": { + "$ref": "#/definitions/Value" + } + } + }, + { + "description": "The `Err` case of Rust Results where the value is some Value", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Err" + ] + }, + "value": { + "$ref": "#/definitions/Value" + } + } + }, + { + "description": "An array values of a single value kind", + "type": "object", + "required": [ + "element_kind", + "elements", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Array" + ] + }, + "element_kind": { + "description": "The kind of elements that the array contains. An array will be validated to ensure that it contains a single element kind.", + "allOf": [ + { + "$ref": "#/definitions/ValueKind" + } + ] + }, + "elements": { + "description": "The elements of the array which may contain 0 or more elements.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + { + "description": "A key-value map of values where all keys are of a single kind and all values are of a single kind", + "type": "object", + "required": [ + "entries", + "key_value_kind", + "type", + "value_value_kind" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Map" + ] + }, + "key_value_kind": { + "description": "The kind of the keys used for the map. A map will be validated to ensure that its keys are all of a single kind.", + "allOf": [ + { + "$ref": "#/definitions/ValueKind" + } + ] + }, + "value_value_kind": { + "description": "The kind of the values used for the map. A map will be validated to ensure that its values are all of a single kind.", + "allOf": [ + { + "$ref": "#/definitions/ValueKind" + } + ] + }, + "entries": { + "description": "A vector of tuples representing the entires in the map where each tuple is made up of two elements: a key and a value.", + "type": "array", + "items": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/Value" + }, + { + "$ref": "#/definitions/Value" + } + ], + "maxItems": 2, + "minItems": 2 + } + } + } + }, + { + "description": "An array of elements where elements could be of different kinds.", + "type": "object", + "required": [ + "elements", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Tuple" + ] + }, + "elements": { + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + { + "description": "A Scrypto Decimal which has a precision of 18 decimal places and has a maximum and minimum of 57896044618658097711785492504343953926634992332820282019728.792003956564819967 and -57896044618658097711785492504343953926634992332820282019728.792003956564819968 respectively", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Decimal" + ] + }, + "value": { + "type": "string", + "pattern": "[+-]?([0-9]*[.])?[0-9]+" + } + } + }, + { + "description": "A Scrypto PreciseDecimal which has a precision of 64 decimal places and has a maximum and minimum of 670390396497129854978701249910292306373968291029619668886178072186088201503677348840093714. 9083451713845015929093243025426876941405973284973216824503042047 and -670390396497129854978701249910292306373968291029619668886178072186088201503677348840093714.9083451713845015929093243025426876941405973284973216824503042048 respectively", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "PreciseDecimal" + ] + }, + "value": { + "type": "string", + "pattern": "[+-]?([0-9]*[.])?[0-9]+" + } + } + }, + { + "description": "Represents a tagged enum of Radix Engine Nodes which may be owned in the point of view of the transaction manifest.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Own" + ] + }, + "value": { + "$ref": "#/definitions/Own" + } + } + }, + { + "description": "Represents a Bech32m encoded human-readable component address. This address is serialized as a human-readable bech32m encoded string.", + "type": "object", + "required": [ + "address", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ComponentAddress" + ] + }, + "address": { + "type": "string" + } + } + }, + { + "description": "Represents a Bech32m encoded human-readable resource address. This address is serialized as a human-readable bech32m encoded string.", + "type": "object", + "required": [ + "address", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ResourceAddress" + ] + }, + "address": { + "type": "string" + } + } + }, + { + "description": "Represents a Bech32m encoded human-readable package address. This address is serialized as a human-readable bech32m encoded string.", + "type": "object", + "required": [ + "address", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "PackageAddress" + ] + }, + "address": { + "type": "string" + } + } + }, + { + "description": "Represents a hash coming from Scrypto's and the Radix Engine's common hash function. The hashing function that they use is SHA256 which produces 32 byte long hashes which are serialized as a 64 character long hex string (since hex encoding doubles the Integer of bytes needed)", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Hash" + ] + }, + "value": { + "type": "string", + "maxLength": 64, + "minLength": 64, + "pattern": "[0-9a-fA-F]+" + } + } + }, + { + "description": "A byte array of 33 bytes which are serialized as a 66 character long hex-encoded string representing a public key from the ECDSA Secp256k1 elliptic curve.", + "type": "object", + "required": [ + "public_key", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "EcdsaSecp256k1PublicKey" + ] + }, + "public_key": { + "type": "string", + "maxLength": 66, + "minLength": 66, + "pattern": "[0-9a-fA-F]+" + } + } + }, + { + "description": "A byte array of 65 bytes which are serialized as a 130 character long hex-encoded string representing a signature from the ECDSA Secp256k1 elliptic curve. An important note on ECDSA Secp256k1 signatures is that the format used and accepted by Scrypto is [v, r, s] where `v` is the recovery id and is a single byte and `r` and `s` are the signature results and are 32 bytes each.", + "type": "object", + "required": [ + "signature", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "EcdsaSecp256k1Signature" + ] + }, + "signature": { + "type": "string", + "maxLength": 130, + "minLength": 130, + "pattern": "[0-9a-fA-F]+" + } + } + }, + { + "description": "A byte array of 32 bytes which are serialized as a 64 character long hex-encoded string representing a public key from the EDDSA Ed25519 edwards curve.", + "type": "object", + "required": [ + "public_key", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "EddsaEd25519PublicKey" + ] + }, + "public_key": { + "type": "string", + "maxLength": 64, + "minLength": 64, + "pattern": "[0-9a-fA-F]+" + } + } + }, + { + "description": "A byte array of 64 bytes which are serialized as a 128 character long hex-encoded string representing a signature from the EDDSA Ed25519 edwards curve.", + "type": "object", + "required": [ + "signature", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "EddsaEd25519Signature" + ] + }, + "signature": { + "type": "string", + "maxLength": 128, + "minLength": 128, + "pattern": "[0-9a-fA-F]+" + } + } + }, + { + "description": "Represents a Scrypto bucket which is identified through a transient identifier which is either a string or an unsigned 32-bit integer which is serialized as a Integer.", + "type": "object", + "required": [ + "identifier", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Bucket" + ] + }, + "identifier": { + "$ref": "#/definitions/BucketId" + } + } + }, + { + "description": "Represents a Scrypto proof which is identified through a transient identifier which is either a string or an unsigned 32-bit integer which is serialized as a Integer.", + "type": "object", + "required": [ + "identifier", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Proof" + ] + }, + "identifier": { + "$ref": "#/definitions/ProofId" + } + } + }, + { + "description": "Represents non-fungible ids which is a discriminated union of the different types that non-fungible ids may be.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "NonFungibleLocalId" + ] + }, + "value": { + "$ref": "#/definitions/NonFungibleLocalId" + } + } + }, + { + "description": "Represents a non-fungible address which may be considered as the \"global\" address of a non-fungible unit as it contains both the resource address and the non-fungible id for that unit.", + "type": "object", + "required": [ + "non_fungible_local_id", + "resource_address", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "NonFungibleGlobalId" + ] + }, + "resource_address": { + "$ref": "#/definitions/Value" + }, + "non_fungible_local_id": { + "$ref": "#/definitions/Value" + } + } + }, + { + "description": "Represents a transaction manifest expression.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Expression" + ] + }, + "value": { + "$ref": "#/definitions/Expression" + } + } + }, + { + "description": "Represents the hash of a blob provided as part of a transaction manifest. This is represented as a byte array of 32 bytes which is serialized as a hex string.", + "type": "object", + "required": [ + "hash", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Blob" + ] + }, + "hash": { + "$ref": "#/definitions/Blob" + } + } + }, + { + "description": "Represents a byte array of an unknown size which is serialized as a hex string", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Bytes" + ] + }, + "value": { + "type": "string" + } + } + } + ] + }, + "EnumDiscriminator": { + "description": "A union of the types of discriminators that enums may have. This may either be a string or an 8-bit unsigned number.", + "oneOf": [ + { + "type": "object", + "required": [ + "discriminator", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "String" + ] + }, + "discriminator": { + "description": "A string discriminator of the fully qualified well-known enum name", + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "discriminator", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "U8" + ] + }, + "discriminator": { + "description": "An 8-bit unsigned integer serialized as a string.", + "type": "string", + "pattern": "[0-9]+" + } + } + } + ] + }, + "ValueKind": { + "description": "An Enum of all of the supported kinds of values by the Radix Engine Toolkit. This enum is essentially the `type` tags used for the value model.", + "type": "string", + "enum": [ + "Bool", + "U8", + "U16", + "U32", + "U64", + "U128", + "I8", + "I16", + "I32", + "I64", + "I128", + "String", + "Enum", + "Some", + "None", + "Ok", + "Err", + "Map", + "Array", + "Tuple", + "Decimal", + "PreciseDecimal", + "Own", + "ComponentAddress", + "ResourceAddress", + "PackageAddress", + "Hash", + "EcdsaSecp256k1PublicKey", + "EcdsaSecp256k1Signature", + "EddsaEd25519PublicKey", + "EddsaEd25519Signature", + "Bucket", + "Proof", + "NonFungibleLocalId", + "NonFungibleGlobalId", + "Expression", + "Blob", + "Bytes" + ] + }, + "Own": { + "description": "Represents a tagged enum of Radix Engine Nodes which may be owned in the point of view of the transaction manifest.", + "oneOf": [ + { + "description": "Represents an owned KeyValueStore", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "KeyValueStore" + ] + }, + "value": { + "$ref": "#/definitions/NodeIdentifier" + } + } + }, + { + "description": "Represents an owned Component", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Component" + ] + }, + "value": { + "$ref": "#/definitions/NodeIdentifier" + } + } + }, + { + "description": "Represents an owned Vault", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Vault" + ] + }, + "value": { + "$ref": "#/definitions/NodeIdentifier" + } + } + }, + { + "description": "Represents an owned Bucket identified through an unsigned 32-bit integer which is serialized as a string", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Bucket" + ] + }, + "value": { + "type": "string" + } + } + }, + { + "description": "Represents an owned Proof identified through an unsigned 32-bit integer which is serialized as a string", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Proof" + ] + }, + "value": { + "type": "string" + } + } + } + ] + }, + "NodeIdentifier": { + "description": "Represents a Radix Engine persistent node identifier which is 36 bytes long and serialized as a hexadecimal string of length 72 (since hex encoding doubles the number of bytes needed.)", + "type": "string", + "maxLength": 72, + "minLength": 72, + "pattern": "[0-9a-fA-F]+" + }, + "BucketId": { + "description": "Represents a BucketId which uses a transient identifier.", + "allOf": [ + { + "$ref": "#/definitions/TransientIdentifier" + } + ] + }, + "TransientIdentifier": { + "description": "Represents a tagged transient identifier typically used as an identifiers for Scrypto buckets and proofs. Could either be a string or an unsigned 32-bit number (which is serialized as a number and not a string)", + "oneOf": [ + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "String" + ] + }, + "value": { + "description": "A string identifier", + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "U32" + ] + }, + "value": { + "description": "A 32-bit unsigned integer which is serialized and deserialized as a string.", + "type": "string", + "pattern": "[0-9]+" + } + } + } + ] + }, + "ProofId": { + "description": "Represents a ProofId which uses a transient identifier.", + "allOf": [ + { + "$ref": "#/definitions/TransientIdentifier" + } + ] + }, + "NonFungibleLocalId": { + "description": "Represents non-fungible ids which is a discriminated union of the different types that non-fungible ids may be.", + "oneOf": [ + { + "description": "A 64 bit unsigned integer non-fungible id type which is serialized as a string", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Integer" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 128 bit unsigned integer UUID non-fungible id type which is serialized as a string", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "UUID" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "An byte array non-fungible id type which is serialized as a hex string. This can be between 1 and 64 bytes in length which translates to a length range of 2 and 128 when hex-encoded.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Bytes" + ] + }, + "value": { + "type": "string", + "maxLength": 128, + "minLength": 2, + "pattern": "[0-9a-fA-F]+" + } + } + }, + { + "description": "A string non-fungible id. This can be between 1 and 64 characters long.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "String" + ] + }, + "value": { + "type": "string", + "maxLength": 64, + "minLength": 1 + } + } + } + ] + }, + "Expression": { + "description": "Represents a transaction manifest expression.", + "type": "string", + "enum": [ + "ENTIRE_WORKTOP", + "ENTIRE_AUTH_ZONE" + ] + }, + "Blob": { + "description": "Represents the hash of a blob provided as part of a transaction manifest. This is represented as a byte array of 32 bytes which is serialized as a hex string.", + "type": "string", + "maxLength": 64, + "minLength": 64, + "pattern": "[0-9a-fA-F]+" + } + } +} \ No newline at end of file diff --git a/schema/out/schema/analyze_manifest_response.json b/schema/out/schema/analyze_manifest_response.json new file mode 100644 index 00000000..e4f19835 --- /dev/null +++ b/schema/out/schema/analyze_manifest_response.json @@ -0,0 +1,1250 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AnalyzeManifestResponse", + "description": "The response of the [`AnalyzeManifestRequest`]", + "type": "object", + "required": [ + "account_addresses", + "accounts_deposited_into", + "accounts_requiring_auth", + "accounts_withdrawn_from", + "component_addresses", + "package_addresses", + "resource_addresses" + ], + "properties": { + "package_addresses": { + "description": "A set of all of the package addresses seen in the manifest. The underlying type of this is an array of `PackageAddress`es from the `Value` model.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + }, + "uniqueItems": true + }, + "component_addresses": { + "description": "A set of all of the component addresses seen in the manifest. The underlying type of this is an array of `ComponentAddress`es from the `Value` model.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + }, + "uniqueItems": true + }, + "resource_addresses": { + "description": "A set of all of the resource addresses seen in the manifest. The underlying type of this is an array of `ResourceAddress`es from the `Value` model.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + }, + "uniqueItems": true + }, + "account_addresses": { + "description": "A set of all of the account component addresses seen in the manifest. The underlying type of this is an array of `ComponentAddress`es from the `Value` model.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + }, + "uniqueItems": true + }, + "accounts_requiring_auth": { + "description": "A set of all of the account component addresses in the manifest which had methods invoked on them that would typically require auth (or a signature) to be called successfully. This is a subset of the addresses seen in `account_addresses`. The underlying type of this is an array of `ComponentAddress`es from the `Value` model.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + }, + "uniqueItems": true + }, + "accounts_withdrawn_from": { + "description": "A set of all of the account component addresses in the manifest which were withdrawn from. This is a subset of the addresses seen in `account_addresses`. The underlying type of this is an array of `ComponentAddress`es from the `Value` model.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + }, + "uniqueItems": true + }, + "accounts_deposited_into": { + "description": "A set of all of the account component addresses in the manifest which were deposited into. This is a subset of the addresses seen in `account_addresses`. The underlying type of this is an array of `ComponentAddress`es from the `Value` model.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + }, + "uniqueItems": true + } + }, + "definitions": { + "Value": { + "description": "The Value model used to describe all of the types that the Radix Engine Toolkit accepts and returns.", + "oneOf": [ + { + "description": "A boolean value which can either be true or false", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Bool" + ] + }, + "value": { + "type": "boolean" + } + } + }, + { + "description": "An 8-bit unsigned integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "U8" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 16-bit unsigned integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "U16" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 32-bit unsigned integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "U32" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 64-bit unsigned integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "U64" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 128-bit unsigned integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "U128" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "An 8-bit signed integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "I8" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 16-bit signed integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "I16" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 32-bit signed integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "I32" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 64-bit signed integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "I64" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 128-bit signed integer which is serialized and deserialized as a string.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "I128" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A type representing a string", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "String" + ] + }, + "value": { + "type": "string" + } + } + }, + { + "description": "A Rust-style Enum which has a variant and can optionally also have a list of values (acting in a way similar to discriminated algebraic sum types)", + "type": "object", + "required": [ + "type", + "variant" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Enum" + ] + }, + "variant": { + "description": "The name of the variant of the enum", + "allOf": [ + { + "$ref": "#/definitions/EnumDiscriminator" + } + ] + }, + "fields": { + "description": "Optional fields that the enum may have", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + { + "description": "The `Some` case of Rust Options where the value is some Value", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Some" + ] + }, + "value": { + "$ref": "#/definitions/Value" + } + } + }, + { + "description": "The `None` case of Rust Options where there is value", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "None" + ] + } + } + }, + { + "description": "The `Ok` case of Rust Results where the value is some Value", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Ok" + ] + }, + "value": { + "$ref": "#/definitions/Value" + } + } + }, + { + "description": "The `Err` case of Rust Results where the value is some Value", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Err" + ] + }, + "value": { + "$ref": "#/definitions/Value" + } + } + }, + { + "description": "An array values of a single value kind", + "type": "object", + "required": [ + "element_kind", + "elements", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Array" + ] + }, + "element_kind": { + "description": "The kind of elements that the array contains. An array will be validated to ensure that it contains a single element kind.", + "allOf": [ + { + "$ref": "#/definitions/ValueKind" + } + ] + }, + "elements": { + "description": "The elements of the array which may contain 0 or more elements.", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + { + "description": "A key-value map of values where all keys are of a single kind and all values are of a single kind", + "type": "object", + "required": [ + "entries", + "key_value_kind", + "type", + "value_value_kind" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Map" + ] + }, + "key_value_kind": { + "description": "The kind of the keys used for the map. A map will be validated to ensure that its keys are all of a single kind.", + "allOf": [ + { + "$ref": "#/definitions/ValueKind" + } + ] + }, + "value_value_kind": { + "description": "The kind of the values used for the map. A map will be validated to ensure that its values are all of a single kind.", + "allOf": [ + { + "$ref": "#/definitions/ValueKind" + } + ] + }, + "entries": { + "description": "A vector of tuples representing the entires in the map where each tuple is made up of two elements: a key and a value.", + "type": "array", + "items": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/Value" + }, + { + "$ref": "#/definitions/Value" + } + ], + "maxItems": 2, + "minItems": 2 + } + } + } + }, + { + "description": "An array of elements where elements could be of different kinds.", + "type": "object", + "required": [ + "elements", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Tuple" + ] + }, + "elements": { + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + } + } + }, + { + "description": "A Scrypto Decimal which has a precision of 18 decimal places and has a maximum and minimum of 57896044618658097711785492504343953926634992332820282019728.792003956564819967 and -57896044618658097711785492504343953926634992332820282019728.792003956564819968 respectively", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Decimal" + ] + }, + "value": { + "type": "string", + "pattern": "[+-]?([0-9]*[.])?[0-9]+" + } + } + }, + { + "description": "A Scrypto PreciseDecimal which has a precision of 64 decimal places and has a maximum and minimum of 670390396497129854978701249910292306373968291029619668886178072186088201503677348840093714. 9083451713845015929093243025426876941405973284973216824503042047 and -670390396497129854978701249910292306373968291029619668886178072186088201503677348840093714.9083451713845015929093243025426876941405973284973216824503042048 respectively", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "PreciseDecimal" + ] + }, + "value": { + "type": "string", + "pattern": "[+-]?([0-9]*[.])?[0-9]+" + } + } + }, + { + "description": "Represents a tagged enum of Radix Engine Nodes which may be owned in the point of view of the transaction manifest.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Own" + ] + }, + "value": { + "$ref": "#/definitions/Own" + } + } + }, + { + "description": "Represents a Bech32m encoded human-readable component address. This address is serialized as a human-readable bech32m encoded string.", + "type": "object", + "required": [ + "address", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ComponentAddress" + ] + }, + "address": { + "type": "string" + } + } + }, + { + "description": "Represents a Bech32m encoded human-readable resource address. This address is serialized as a human-readable bech32m encoded string.", + "type": "object", + "required": [ + "address", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ResourceAddress" + ] + }, + "address": { + "type": "string" + } + } + }, + { + "description": "Represents a Bech32m encoded human-readable package address. This address is serialized as a human-readable bech32m encoded string.", + "type": "object", + "required": [ + "address", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "PackageAddress" + ] + }, + "address": { + "type": "string" + } + } + }, + { + "description": "Represents a hash coming from Scrypto's and the Radix Engine's common hash function. The hashing function that they use is SHA256 which produces 32 byte long hashes which are serialized as a 64 character long hex string (since hex encoding doubles the Integer of bytes needed)", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Hash" + ] + }, + "value": { + "type": "string", + "maxLength": 64, + "minLength": 64, + "pattern": "[0-9a-fA-F]+" + } + } + }, + { + "description": "A byte array of 33 bytes which are serialized as a 66 character long hex-encoded string representing a public key from the ECDSA Secp256k1 elliptic curve.", + "type": "object", + "required": [ + "public_key", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "EcdsaSecp256k1PublicKey" + ] + }, + "public_key": { + "type": "string", + "maxLength": 66, + "minLength": 66, + "pattern": "[0-9a-fA-F]+" + } + } + }, + { + "description": "A byte array of 65 bytes which are serialized as a 130 character long hex-encoded string representing a signature from the ECDSA Secp256k1 elliptic curve. An important note on ECDSA Secp256k1 signatures is that the format used and accepted by Scrypto is [v, r, s] where `v` is the recovery id and is a single byte and `r` and `s` are the signature results and are 32 bytes each.", + "type": "object", + "required": [ + "signature", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "EcdsaSecp256k1Signature" + ] + }, + "signature": { + "type": "string", + "maxLength": 130, + "minLength": 130, + "pattern": "[0-9a-fA-F]+" + } + } + }, + { + "description": "A byte array of 32 bytes which are serialized as a 64 character long hex-encoded string representing a public key from the EDDSA Ed25519 edwards curve.", + "type": "object", + "required": [ + "public_key", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "EddsaEd25519PublicKey" + ] + }, + "public_key": { + "type": "string", + "maxLength": 64, + "minLength": 64, + "pattern": "[0-9a-fA-F]+" + } + } + }, + { + "description": "A byte array of 64 bytes which are serialized as a 128 character long hex-encoded string representing a signature from the EDDSA Ed25519 edwards curve.", + "type": "object", + "required": [ + "signature", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "EddsaEd25519Signature" + ] + }, + "signature": { + "type": "string", + "maxLength": 128, + "minLength": 128, + "pattern": "[0-9a-fA-F]+" + } + } + }, + { + "description": "Represents a Scrypto bucket which is identified through a transient identifier which is either a string or an unsigned 32-bit integer which is serialized as a Integer.", + "type": "object", + "required": [ + "identifier", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Bucket" + ] + }, + "identifier": { + "$ref": "#/definitions/BucketId" + } + } + }, + { + "description": "Represents a Scrypto proof which is identified through a transient identifier which is either a string or an unsigned 32-bit integer which is serialized as a Integer.", + "type": "object", + "required": [ + "identifier", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Proof" + ] + }, + "identifier": { + "$ref": "#/definitions/ProofId" + } + } + }, + { + "description": "Represents non-fungible ids which is a discriminated union of the different types that non-fungible ids may be.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "NonFungibleLocalId" + ] + }, + "value": { + "$ref": "#/definitions/NonFungibleLocalId" + } + } + }, + { + "description": "Represents a non-fungible address which may be considered as the \"global\" address of a non-fungible unit as it contains both the resource address and the non-fungible id for that unit.", + "type": "object", + "required": [ + "non_fungible_local_id", + "resource_address", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "NonFungibleGlobalId" + ] + }, + "resource_address": { + "$ref": "#/definitions/Value" + }, + "non_fungible_local_id": { + "$ref": "#/definitions/Value" + } + } + }, + { + "description": "Represents a transaction manifest expression.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Expression" + ] + }, + "value": { + "$ref": "#/definitions/Expression" + } + } + }, + { + "description": "Represents the hash of a blob provided as part of a transaction manifest. This is represented as a byte array of 32 bytes which is serialized as a hex string.", + "type": "object", + "required": [ + "hash", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Blob" + ] + }, + "hash": { + "$ref": "#/definitions/Blob" + } + } + }, + { + "description": "Represents a byte array of an unknown size which is serialized as a hex string", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Bytes" + ] + }, + "value": { + "type": "string" + } + } + } + ] + }, + "EnumDiscriminator": { + "description": "A union of the types of discriminators that enums may have. This may either be a string or an 8-bit unsigned number.", + "oneOf": [ + { + "type": "object", + "required": [ + "discriminator", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "String" + ] + }, + "discriminator": { + "description": "A string discriminator of the fully qualified well-known enum name", + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "discriminator", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "U8" + ] + }, + "discriminator": { + "description": "An 8-bit unsigned integer serialized as a string.", + "type": "string", + "pattern": "[0-9]+" + } + } + } + ] + }, + "ValueKind": { + "description": "An Enum of all of the supported kinds of values by the Radix Engine Toolkit. This enum is essentially the `type` tags used for the value model.", + "type": "string", + "enum": [ + "Bool", + "U8", + "U16", + "U32", + "U64", + "U128", + "I8", + "I16", + "I32", + "I64", + "I128", + "String", + "Enum", + "Some", + "None", + "Ok", + "Err", + "Map", + "Array", + "Tuple", + "Decimal", + "PreciseDecimal", + "Own", + "ComponentAddress", + "ResourceAddress", + "PackageAddress", + "Hash", + "EcdsaSecp256k1PublicKey", + "EcdsaSecp256k1Signature", + "EddsaEd25519PublicKey", + "EddsaEd25519Signature", + "Bucket", + "Proof", + "NonFungibleLocalId", + "NonFungibleGlobalId", + "Expression", + "Blob", + "Bytes" + ] + }, + "Own": { + "description": "Represents a tagged enum of Radix Engine Nodes which may be owned in the point of view of the transaction manifest.", + "oneOf": [ + { + "description": "Represents an owned KeyValueStore", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "KeyValueStore" + ] + }, + "value": { + "$ref": "#/definitions/NodeIdentifier" + } + } + }, + { + "description": "Represents an owned Component", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Component" + ] + }, + "value": { + "$ref": "#/definitions/NodeIdentifier" + } + } + }, + { + "description": "Represents an owned Vault", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Vault" + ] + }, + "value": { + "$ref": "#/definitions/NodeIdentifier" + } + } + }, + { + "description": "Represents an owned Bucket identified through an unsigned 32-bit integer which is serialized as a string", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Bucket" + ] + }, + "value": { + "type": "string" + } + } + }, + { + "description": "Represents an owned Proof identified through an unsigned 32-bit integer which is serialized as a string", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Proof" + ] + }, + "value": { + "type": "string" + } + } + } + ] + }, + "NodeIdentifier": { + "description": "Represents a Radix Engine persistent node identifier which is 36 bytes long and serialized as a hexadecimal string of length 72 (since hex encoding doubles the number of bytes needed.)", + "type": "string", + "maxLength": 72, + "minLength": 72, + "pattern": "[0-9a-fA-F]+" + }, + "BucketId": { + "description": "Represents a BucketId which uses a transient identifier.", + "allOf": [ + { + "$ref": "#/definitions/TransientIdentifier" + } + ] + }, + "TransientIdentifier": { + "description": "Represents a tagged transient identifier typically used as an identifiers for Scrypto buckets and proofs. Could either be a string or an unsigned 32-bit number (which is serialized as a number and not a string)", + "oneOf": [ + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "String" + ] + }, + "value": { + "description": "A string identifier", + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "U32" + ] + }, + "value": { + "description": "A 32-bit unsigned integer which is serialized and deserialized as a string.", + "type": "string", + "pattern": "[0-9]+" + } + } + } + ] + }, + "ProofId": { + "description": "Represents a ProofId which uses a transient identifier.", + "allOf": [ + { + "$ref": "#/definitions/TransientIdentifier" + } + ] + }, + "NonFungibleLocalId": { + "description": "Represents non-fungible ids which is a discriminated union of the different types that non-fungible ids may be.", + "oneOf": [ + { + "description": "A 64 bit unsigned integer non-fungible id type which is serialized as a string", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Integer" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "A 128 bit unsigned integer UUID non-fungible id type which is serialized as a string", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "UUID" + ] + }, + "value": { + "type": "string", + "pattern": "[0-9]+" + } + } + }, + { + "description": "An byte array non-fungible id type which is serialized as a hex string. This can be between 1 and 64 bytes in length which translates to a length range of 2 and 128 when hex-encoded.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Bytes" + ] + }, + "value": { + "type": "string", + "maxLength": 128, + "minLength": 2, + "pattern": "[0-9a-fA-F]+" + } + } + }, + { + "description": "A string non-fungible id. This can be between 1 and 64 characters long.", + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "String" + ] + }, + "value": { + "type": "string", + "maxLength": 64, + "minLength": 1 + } + } + } + ] + }, + "Expression": { + "description": "Represents a transaction manifest expression.", + "type": "string", + "enum": [ + "ENTIRE_WORKTOP", + "ENTIRE_AUTH_ZONE" + ] + }, + "Blob": { + "description": "Represents the hash of a blob provided as part of a transaction manifest. This is represented as a byte array of 32 bytes which is serialized as a hex string.", + "type": "string", + "maxLength": 64, + "minLength": 64, + "pattern": "[0-9a-fA-F]+" + } + } +} \ No newline at end of file diff --git a/schema/src/examples.rs b/schema/src/examples.rs index 25eec063..779ea430 100644 --- a/schema/src/examples.rs +++ b/schema/src/examples.rs @@ -48,7 +48,7 @@ pub fn notarized_intent() -> NotarizedTransaction { end_epoch_exclusive: 0x210, nonce: 0x22, notary_as_signatory: true, - notary_public_key: notary_private_key().public_key().clone().into(), + notary_public_key: notary_private_key().public_key().into(), tip_percentage: 0x00, }) .sign(&EcdsaSecp256k1PrivateKey::from_u64(1).unwrap()) @@ -193,7 +193,7 @@ This function allows the client the convert their manifest between the two suppo let bec32_coder = Bech32Coder::new(network_definition().id); ConvertManifestRequest { manifest: radix_engine_toolkit::TransactionManifest::from_native_manifest( - ¬arized_intent().signed_intent.intent.manifest.clone(), + ¬arized_intent().signed_intent.intent.manifest, InstructionKind::Parsed, &bec32_coder, ) @@ -204,6 +204,25 @@ This function allows the client the convert their manifest between the two suppo } } +impl ExampleData for AnalyzeManifestHandler { + fn description() -> String { + r#"Analyzes the manifest returning back all of the addresses involved in the manifest alongside some useful information on whether the accounts were withdrawn from, deposited into, or just used in the manifest in general."#.to_owned() + } + + fn example_request() -> AnalyzeManifestRequest { + let bec32_coder = Bech32Coder::new(network_definition().id); + AnalyzeManifestRequest { + manifest: radix_engine_toolkit::TransactionManifest::from_native_manifest( + ¬arized_intent().signed_intent.intent.manifest, + InstructionKind::String, + &bec32_coder, + ) + .unwrap(), + network_id: network_definition().id, + } + } +} + impl ExampleData for CompileTransactionIntentHandler { diff --git a/schema/src/main.rs b/schema/src/main.rs index 646a9bef..ffdf8226 100644 --- a/schema/src/main.rs +++ b/schema/src/main.rs @@ -60,6 +60,8 @@ pub fn generate_json_schema() -> Result<(), GenerationError> { radix_engine_toolkit::request::InformationResponse, radix_engine_toolkit::request::ConvertManifestRequest, radix_engine_toolkit::request::ConvertManifestResponse, + radix_engine_toolkit::request::AnalyzeManifestRequest, + radix_engine_toolkit::request::AnalyzeManifestResponse, radix_engine_toolkit::request::CompileTransactionIntentRequest, radix_engine_toolkit::request::CompileTransactionIntentResponse, radix_engine_toolkit::request::DecompileTransactionIntentRequest, @@ -130,6 +132,7 @@ fn generate_request_examples() -> Result<(), GenerationError> { let examples = InMemoryExamplesBuilder::new() .add_example::() .add_example::() + .add_example::() .add_example::() .add_example::() .add_example::()