From 89a8bcde36aeda551cb0e3f9aa3e9fcf315fe1cc Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 17 May 2024 06:17:37 +1000 Subject: [PATCH] Add schemars::JsonSchema derives to all types (#347) * Add schemars::JsonSchema derives to all types * add test * remove unused dev dep * silence clippy warning * regen with new feature and manual impls from willem * upd * fix * upd * fix overflow * add first version of command * ping to draft7 * upd * group new features * custom types * upd * upd ver * update xdr * upd * upd * fix claimable balance id --- .github/workflows/rust.yml | 2 +- Cargo.lock | 42 ++ Cargo.toml | 4 +- Makefile | 31 +- src/bin/stellar-xdr/main.rs | 5 +- src/cli/mod.rs | 4 +- src/cli/types.rs | 18 +- src/cli/types/schema.rs | 68 ++ src/curr/generated.rs | 1248 +++++++++++++++++++++++++++++++++++ src/curr/jsonschema.rs | 29 + src/curr/mod.rs | 1 + src/next/generated.rs | 1248 +++++++++++++++++++++++++++++++++++ src/next/jsonschema.rs | 29 + src/next/mod.rs | 1 + tests/serde_tx_schema.rs | 13 + 15 files changed, 2729 insertions(+), 14 deletions(-) create mode 100644 src/cli/types/schema.rs create mode 100644 src/curr/jsonschema.rs create mode 100644 src/next/jsonschema.rs create mode 100644 tests/serde_tx_schema.rs diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 36520adb..c892d9f2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -7,7 +7,7 @@ on: merge_group: env: - CARGO_HACK_ARGS: --feature-powerset --exclude-features default --group-features base64,serde,arbitrary,hex + CARGO_HACK_ARGS: --feature-powerset --exclude-features default --group-features base64,serde,serde_json,schemars,arbitrary,hex jobs: diff --git a/Cargo.lock b/Cargo.lock index 8e9650a7..9d095454 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -244,6 +244,12 @@ dependencies = [ "syn 1.0.98", ] +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + [[package]] name = "escape-bytes" version = "0.1.1" @@ -415,6 +421,30 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +[[package]] +name = "schemars" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 1.0.98", +] + [[package]] name = "scratch" version = "1.0.2" @@ -441,6 +471,17 @@ dependencies = [ "syn 2.0.15", ] +[[package]] +name = "serde_derive_internals" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.98", +] + [[package]] name = "serde_json" version = "1.0.89" @@ -501,6 +542,7 @@ dependencies = [ "crate-git-revision", "escape-bytes", "hex", + "schemars", "serde", "serde_json", "serde_with", diff --git a/Cargo.toml b/Cargo.toml index 38212e4b..aec3db4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,7 @@ arbitrary = {version = "1.1.3", features = ["derive"], optional = true} clap = { version = "4.2.4", default-features = false, features = ["std", "derive", "usage", "help"], optional = true } serde_json = { version = "1.0.89", optional = true } thiserror = { version = "1.0.37", optional = true } +schemars = { version = "0.8.16", optional = true } [dev_dependencies] serde_json = "1.0.89" @@ -44,11 +45,12 @@ next = [] base64 = ["std", "dep:base64"] serde = ["alloc", "dep:serde", "dep:serde_with", "hex/serde"] serde_json = ["std", "serde", "dep:serde_json"] +schemars = ["alloc", "serde", "serde_json", "dep:schemars"] arbitrary = ["std", "dep:arbitrary"] hex = [] # Features for the CLI. -cli = ["std", "curr", "next", "base64", "serde", "serde_json", "dep:clap", "dep:thiserror"] +cli = ["std", "curr", "next", "base64", "serde", "serde_json", "schemars", "dep:clap", "dep:thiserror"] [package.metadata.docs.rs] all-features = true diff --git a/Makefile b/Makefile index 83d2c260..5caee634 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,12 @@ CARGO_HACK_ARGS=--feature-powerset --exclude-features default --group-features b CARGO_DOC_ARGS?=--open -XDRGEN_VERSION=e2cac557162d99b12ae73b846cf3d5bfe16636de +XDRGEN_VERSION=ac1653599b97b298e72c0186b5685bffa120b6aa +# XDRGEN_LOCAL=1 XDRGEN_TYPES_CUSTOM_STR_IMPL_CURR=PublicKey,AccountId,MuxedAccount,MuxedAccountMed25519,SignerKey,SignerKeyEd25519SignedPayload,NodeId,ScAddress,AssetCode,AssetCode4,AssetCode12,ClaimableBalanceId XDRGEN_TYPES_CUSTOM_STR_IMPL_NEXT=PublicKey,AccountId,MuxedAccount,MuxedAccountMed25519,SignerKey,SignerKeyEd25519SignedPayload,NodeId,ScAddress,AssetCode,AssetCode4,AssetCode12,ClaimableBalanceId +XDRGEN_TYPES_CUSTOM_JSONSCHEMA_IMPL_CURR=PublicKey,AccountId,MuxedAccount,MuxedAccountMed25519,SignerKey,SignerKeyEd25519SignedPayload,NodeId,ScAddress,AssetCode,AssetCode4,AssetCode12,ClaimableBalanceId +XDRGEN_TYPES_CUSTOM_JSONSCHEMA_IMPL_NEXT=PublicKey,AccountId,MuxedAccount,MuxedAccountMed25519,SignerKey,SignerKeyEd25519SignedPayload,NodeId,ScAddress,AssetCode,AssetCode4,AssetCode12,ClaimableBalanceId all: build test @@ -22,7 +25,7 @@ doc: RUSTDOCFLAGS="--cfg docs" cargo +nightly doc --package stellar-xdr --all-features $(CARGO_DOC_ARGS) install: - cargo install --path . --force --features cli + cargo install --locked --path . --force --features cli readme: cargo readme > README.md @@ -34,16 +37,22 @@ generate: src/curr/generated.rs xdr/curr-version src/next/generated.rs xdr/next- src/curr/generated.rs: $(sort $(wildcard xdr/curr/*.x)) > $@ -ifeq ($(LOCAL_XDRGEN),) +ifeq ($(XDRGEN_LOCAL),) docker run -i --rm -v $$PWD:/wd -w /wd docker.io/library/ruby:latest /bin/bash -c '\ gem install specific_install -v 0.3.8 && \ gem specific_install https://github.com/stellar/xdrgen.git -b $(XDRGEN_VERSION) && \ - xdrgen --language rust --namespace generated --output src/curr --rust-types-custom-str-impl $(XDRGEN_TYPES_CUSTOM_STR_IMPL_CURR) $^ \ + xdrgen --language rust --namespace generated --output src/curr \ + --rust-types-custom-str-impl $(XDRGEN_TYPES_CUSTOM_STR_IMPL_CURR) \ + --rust-types-custom-jsonschema-impl '$(XDRGEN_TYPES_CUSTOM_JSONSCHEMA_IMPL_CURR)' \ + $^ \ ' else docker run -i --rm -v $$PWD/../xdrgen:/xdrgen -v $$PWD:/wd -w /wd docker.io/library/ruby:latest /bin/bash -c '\ pushd /xdrgen && bundle install --deployment && rake install && popd && \ - xdrgen --language rust --namespace generated --output src/curr --rust-types-custom-str-impl $(XDRGEN_TYPES_CUSTOM_STR_IMPL_CURR) $^ \ + xdrgen --language rust --namespace generated --output src/curr \ + --rust-types-custom-str-impl $(XDRGEN_TYPES_CUSTOM_STR_IMPL_CURR) \ + --rust-types-custom-jsonschema-impl '$(XDRGEN_TYPES_CUSTOM_JSONSCHEMA_IMPL_CURR)' \ + $^ \ ' endif rustfmt $@ @@ -53,16 +62,22 @@ xdr/curr-version: $(wildcard .git/modules/xdr/curr/**/*) $(wildcard xdr/curr/*.x src/next/generated.rs: $(sort $(wildcard xdr/next/*.x)) > $@ -ifeq ($(LOCAL_XDRGEN),) +ifeq ($(XDRGEN_LOCAL),) docker run -i --rm -v $$PWD:/wd -w /wd docker.io/library/ruby:latest /bin/bash -c '\ gem install specific_install -v 0.3.8 && \ gem specific_install https://github.com/stellar/xdrgen.git -b $(XDRGEN_VERSION) && \ - xdrgen --language rust --namespace generated --output src/next --rust-types-custom-str-impl $(XDRGEN_TYPES_CUSTOM_STR_IMPL_NEXT) $^ \ + xdrgen --language rust --namespace generated --output src/next \ + --rust-types-custom-str-impl $(XDRGEN_TYPES_CUSTOM_STR_IMPL_NEXT) \ + --rust-types-custom-jsonschema-impl '$(XDRGEN_TYPES_CUSTOM_JSONSCHEMA_IMPL_NEXT)' \ + $^ \ ' else docker run -i --rm -v $$PWD/../xdrgen:/xdrgen -v $$PWD:/wd -w /wd docker.io/library/ruby:latest /bin/bash -c '\ pushd /xdrgen && bundle install --deployment && rake install && popd && \ - xdrgen --language rust --namespace generated --output src/next --rust-types-custom-str-impl $(XDRGEN_TYPES_CUSTOM_STR_IMPL_NEXT) $^ \ + xdrgen --language rust --namespace generated --output src/next \ + --rust-types-custom-str-impl $(XDRGEN_TYPES_CUSTOM_STR_IMPL_NEXT) \ + --rust-types-custom-jsonschema-impl '$(XDRGEN_TYPES_CUSTOM_JSONSCHEMA_IMPL_NEXT)' \ + $^ \ ' endif rustfmt $@ diff --git a/src/bin/stellar-xdr/main.rs b/src/bin/stellar-xdr/main.rs index 78ff30f3..2873708b 100644 --- a/src/bin/stellar-xdr/main.rs +++ b/src/bin/stellar-xdr/main.rs @@ -6,7 +6,10 @@ fn main() { if let Err(e) = cli::run(env::args_os()) { match e { cli::Error::Clap(e) => e.exit(), - cli::Error::Guess(_) | cli::Error::Decode(_) | cli::Error::Encode(_) => { + cli::Error::Types(_) + | cli::Error::Guess(_) + | cli::Error::Decode(_) + | cli::Error::Encode(_) => { Error::raw(clap::error::ErrorKind::ValueValidation, e).exit() } } diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 1fea239c..68dd0fb6 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -34,7 +34,7 @@ impl Root { /// If the root command is configured with state that is invalid. pub fn run(&self) -> Result<(), Error> { match &self.cmd { - Cmd::Types(c) => c.run(&self.channel), + Cmd::Types(c) => c.run(&self.channel)?, Cmd::Guess(c) => c.run(&self.channel)?, Cmd::Decode(c) => c.run(&self.channel)?, Cmd::Encode(c) => c.run(&self.channel)?, @@ -77,6 +77,8 @@ pub enum Cmd { pub enum Error { #[error("{0}")] Clap(#[from] clap::Error), + #[error("{0}")] + Types(#[from] types::Error), #[error("error decoding XDR: {0}")] Guess(#[from] guess::Error), #[error("error reading file: {0}")] diff --git a/src/cli/types.rs b/src/cli/types.rs index f089930e..e9a24715 100644 --- a/src/cli/types.rs +++ b/src/cli/types.rs @@ -1,9 +1,16 @@ pub mod list; +mod schema; use clap::{Args, Subcommand}; use crate::cli::Channel; +#[derive(thiserror::Error, Debug)] +pub enum Error { + #[error("{0}")] + SchemaError(#[from] schema::Error), +} + #[derive(Args, Debug, Clone)] #[command()] pub struct Cmd { @@ -14,17 +21,24 @@ pub struct Cmd { #[derive(Subcommand, Clone, Debug)] enum Sub { List(list::Cmd), + Schema(schema::Cmd), } impl Cmd { /// Run the CLIs types command. /// + /// ## Errors + /// + /// If the sub-command panics. + /// /// ## Panics /// - /// If the lists sub-command panics. - pub fn run(&self, channel: &Channel) { + /// If the sub-command panics. + pub fn run(&self, channel: &Channel) -> Result<(), Error> { match &self.sub { Sub::List(c) => c.run(channel), + Sub::Schema(c) => c.run(channel)?, } + Ok(()) } } diff --git a/src/cli/types/schema.rs b/src/cli/types/schema.rs new file mode 100644 index 00000000..730ca6c0 --- /dev/null +++ b/src/cli/types/schema.rs @@ -0,0 +1,68 @@ +use clap::{Args, ValueEnum}; +use schemars::gen::SchemaSettings; + +use crate::cli::Channel; + +#[derive(thiserror::Error, Debug)] +pub enum Error { + #[error("unknown type {0}, choose one of {1:?}")] + UnknownType(String, &'static [&'static str]), + #[error("error generating JSON: {0}")] + GenerateJson(#[from] serde_json::Error), +} + +#[derive(Args, Debug, Clone)] +#[command()] +pub struct Cmd { + /// XDR type to decode + #[arg(long)] + r#type: String, + + // Output format + #[arg(long, value_enum, default_value_t)] + output: OutputFormat, +} + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)] +pub enum OutputFormat { + JsonSchemaDraft7, + JsonSchemaDraft201909, +} + +impl Default for OutputFormat { + fn default() -> Self { + Self::JsonSchemaDraft201909 + } +} + +macro_rules! run_x { + ($f:ident, $m:ident) => { + fn $f(&self) -> Result<(), Error> { + use std::str::FromStr; + let r#type = crate::$m::TypeVariant::from_str(&self.r#type).map_err(|_| { + Error::UnknownType(self.r#type.clone(), &crate::$m::TypeVariant::VARIANTS_STR) + })?; + let settings = match self.output { + OutputFormat::JsonSchemaDraft7 => SchemaSettings::draft07(), + OutputFormat::JsonSchemaDraft201909 => SchemaSettings::draft2019_09(), + }; + let generator = settings.into_generator(); + let schema = r#type.json_schema(generator); + println!("{}", serde_json::to_string_pretty(&schema)?); + Ok(()) + } + }; +} + +impl Cmd { + pub fn run(&self, channel: &Channel) -> Result<(), Error> { + match channel { + Channel::Curr => self.run_curr()?, + Channel::Next => self.run_next()?, + } + Ok(()) + } + + run_x!(run_curr, curr); + run_x!(run_next, next); +} diff --git a/src/curr/generated.rs b/src/curr/generated.rs index 9d9e71e2..c4356f9f 100644 --- a/src/curr/generated.rs +++ b/src/curr/generated.rs @@ -956,6 +956,32 @@ impl Default for VecM { } } +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for VecM { + fn schema_name() -> String { + format!("VecM<{}, {}>", T::schema_name(), MAX) + } + + fn is_referenceable() -> bool { + false + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let schema = Vec::::json_schema(gen); + if let schemars::schema::Schema::Object(mut schema) = schema { + if let Some(array) = schema.array.clone() { + schema.array = Some(Box::new(schemars::schema::ArrayValidation { + max_items: Some(MAX), + ..*array + })); + } + schema.into() + } else { + schema + } + } +} + impl VecM { pub const MAX_LEN: usize = { MAX as usize }; @@ -1391,6 +1417,40 @@ impl Deref for BytesM { } } +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for BytesM { + fn schema_name() -> String { + format!("BytesM<{MAX}>") + } + + fn is_referenceable() -> bool { + false + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let schema = String::json_schema(gen); + if let schemars::schema::Schema::Object(mut schema) = schema { + schema.extensions.insert( + "contentEncoding".to_owned(), + serde_json::Value::String("hex".to_string()), + ); + schema.extensions.insert( + "contentMediaType".to_owned(), + serde_json::Value::String("application/binary".to_string()), + ); + let string = *schema.string.unwrap_or_default().clone(); + schema.string = Some(Box::new(schemars::schema::StringValidation { + max_length: MAX.checked_mul(2).map(Some).unwrap_or_default(), + min_length: None, + ..string + })); + schema.into() + } else { + schema + } + } +} + impl Default for BytesM { fn default() -> Self { Self(Vec::default()) @@ -1779,6 +1839,27 @@ impl Default for StringM { } } +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for StringM { + fn schema_name() -> String { + format!("StringM<{MAX}>") + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let schema = String::json_schema(gen); + if let schemars::schema::Schema::Object(mut schema) = schema { + let string = *schema.string.unwrap_or_default().clone(); + schema.string = Some(Box::new(schemars::schema::StringValidation { + max_length: Some(MAX), + ..string + })); + schema.into() + } else { + schema + } + } +} + impl StringM { pub const MAX_LEN: usize = { MAX as usize }; @@ -2095,6 +2176,17 @@ pub struct Frame(pub T) where T: ReadXdr; +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for Frame { + fn schema_name() -> String { + format!("Frame<{}>", T::schema_name()) + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + T::json_schema(gen) + } +} + impl ReadXdr for Frame where T: ReadXdr, @@ -2758,6 +2850,7 @@ mod test { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct Value(pub BytesM); @@ -2866,6 +2959,7 @@ impl AsRef<[u8]> for Value { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpBallot { pub counter: u32, pub value: Value, @@ -2914,6 +3008,7 @@ impl WriteXdr for ScpBallot { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScpStatementType { Prepare = 0, @@ -3030,6 +3125,7 @@ impl WriteXdr for ScpStatementType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpNomination { pub quorum_set_hash: Hash, pub votes: VecM, @@ -3082,6 +3178,7 @@ impl WriteXdr for ScpNomination { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpStatementPrepare { pub quorum_set_hash: Hash, pub ballot: ScpBallot, @@ -3142,6 +3239,7 @@ impl WriteXdr for ScpStatementPrepare { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpStatementConfirm { pub ballot: ScpBallot, pub n_prepared: u32, @@ -3197,6 +3295,7 @@ impl WriteXdr for ScpStatementConfirm { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpStatementExternalize { pub commit: ScpBallot, pub n_h: u32, @@ -3272,6 +3371,7 @@ impl WriteXdr for ScpStatementExternalize { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScpStatementPledges { Prepare(ScpStatementPrepare), @@ -3426,6 +3526,7 @@ impl WriteXdr for ScpStatementPledges { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpStatement { pub node_id: NodeId, pub slot_index: u64, @@ -3474,6 +3575,7 @@ impl WriteXdr for ScpStatement { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpEnvelope { pub statement: ScpStatement, pub signature: Signature, @@ -3520,6 +3622,7 @@ impl WriteXdr for ScpEnvelope { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpQuorumSet { pub threshold: u32, pub validators: VecM, @@ -3568,6 +3671,7 @@ impl WriteXdr for ScpQuorumSet { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigSettingContractExecutionLanesV0 { pub ledger_max_tx_count: u32, } @@ -3618,6 +3722,7 @@ impl WriteXdr for ConfigSettingContractExecutionLanesV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigSettingContractComputeV0 { pub ledger_max_instructions: i64, pub tx_max_instructions: i64, @@ -3699,6 +3804,7 @@ impl WriteXdr for ConfigSettingContractComputeV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigSettingContractLedgerCostV0 { pub ledger_max_read_ledger_entries: u32, pub ledger_max_read_bytes: u32, @@ -3782,6 +3888,7 @@ impl WriteXdr for ConfigSettingContractLedgerCostV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigSettingContractHistoricalDataV0 { pub fee_historical1_kb: i64, } @@ -3826,6 +3933,7 @@ impl WriteXdr for ConfigSettingContractHistoricalDataV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigSettingContractEventsV0 { pub tx_max_contract_events_size_bytes: u32, pub fee_contract_events1_kb: i64, @@ -3876,6 +3984,7 @@ impl WriteXdr for ConfigSettingContractEventsV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigSettingContractBandwidthV0 { pub ledger_max_txs_size_bytes: u32, pub tx_max_size_bytes: u32, @@ -4021,6 +4130,7 @@ impl WriteXdr for ConfigSettingContractBandwidthV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ContractCostType { WasmInsnExec = 0, @@ -4348,6 +4458,7 @@ impl WriteXdr for ContractCostType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractCostParamEntry { pub ext: ExtensionPoint, pub const_term: i64, @@ -4415,6 +4526,7 @@ impl WriteXdr for ContractCostParamEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct StateArchivalSettings { pub max_entry_ttl: u32, pub min_temporary_ttl: u32, @@ -4484,6 +4596,7 @@ impl WriteXdr for StateArchivalSettings { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct EvictionIterator { pub bucket_list_level: u32, pub is_curr_bucket: bool, @@ -4537,6 +4650,7 @@ pub const CONTRACT_COST_COUNT_LIMIT: u64 = 1024; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct ContractCostParams(pub VecM); @@ -4658,6 +4772,7 @@ impl AsRef<[ContractCostParamEntry]> for ContractCostParams { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ConfigSettingId { ContractMaxSizeBytes = 0, @@ -4855,6 +4970,7 @@ impl WriteXdr for ConfigSettingId { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ConfigSettingEntry { ContractMaxSizeBytes(u32), @@ -5081,6 +5197,7 @@ impl WriteXdr for ConfigSettingEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScEnvMetaKind { ScEnvMetaKindInterfaceVersion = 0, @@ -5183,6 +5300,7 @@ impl WriteXdr for ScEnvMetaKind { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScEnvMetaEntry { ScEnvMetaKindInterfaceVersion(u64), @@ -5284,6 +5402,7 @@ impl WriteXdr for ScEnvMetaEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScMetaV0 { pub key: StringM, pub val: StringM, @@ -5329,6 +5448,7 @@ impl WriteXdr for ScMetaV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScMetaKind { ScMetaV0 = 0, @@ -5431,6 +5551,7 @@ impl WriteXdr for ScMetaKind { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScMetaEntry { ScMetaV0(ScMetaV0), @@ -5568,6 +5689,7 @@ pub const SC_SPEC_DOC_LIMIT: u64 = 1024; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScSpecType { Val = 0, @@ -5792,6 +5914,7 @@ impl WriteXdr for ScSpecType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecTypeOption { pub value_type: Box, } @@ -5834,6 +5957,7 @@ impl WriteXdr for ScSpecTypeOption { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecTypeResult { pub ok_type: Box, pub error_type: Box, @@ -5878,6 +6002,7 @@ impl WriteXdr for ScSpecTypeResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecTypeVec { pub element_type: Box, } @@ -5920,6 +6045,7 @@ impl WriteXdr for ScSpecTypeVec { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecTypeMap { pub key_type: Box, pub value_type: Box, @@ -5964,6 +6090,7 @@ impl WriteXdr for ScSpecTypeMap { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecTypeTuple { pub value_types: VecM, } @@ -6005,6 +6132,7 @@ impl WriteXdr for ScSpecTypeTuple { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecTypeBytesN { pub n: u32, } @@ -6046,6 +6174,7 @@ impl WriteXdr for ScSpecTypeBytesN { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecTypeUdt { pub name: StringM<60>, } @@ -6120,6 +6249,7 @@ impl WriteXdr for ScSpecTypeUdt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScSpecTypeDef { Val, @@ -6392,6 +6522,7 @@ impl WriteXdr for ScSpecTypeDef { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtStructFieldV0 { pub doc: StringM<1024>, pub name: StringM<30>, @@ -6442,6 +6573,7 @@ impl WriteXdr for ScSpecUdtStructFieldV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtStructV0 { pub doc: StringM<1024>, pub lib: StringM<80>, @@ -6493,6 +6625,7 @@ impl WriteXdr for ScSpecUdtStructV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtUnionCaseVoidV0 { pub doc: StringM<1024>, pub name: StringM<60>, @@ -6539,6 +6672,7 @@ impl WriteXdr for ScSpecUdtUnionCaseVoidV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtUnionCaseTupleV0 { pub doc: StringM<1024>, pub name: StringM<60>, @@ -6588,6 +6722,7 @@ impl WriteXdr for ScSpecUdtUnionCaseTupleV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScSpecUdtUnionCaseV0Kind { VoidV0 = 0, @@ -6698,6 +6833,7 @@ impl WriteXdr for ScSpecUdtUnionCaseV0Kind { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScSpecUdtUnionCaseV0 { VoidV0(ScSpecUdtUnionCaseVoidV0), @@ -6811,6 +6947,7 @@ impl WriteXdr for ScSpecUdtUnionCaseV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtUnionV0 { pub doc: StringM<1024>, pub lib: StringM<80>, @@ -6863,6 +7000,7 @@ impl WriteXdr for ScSpecUdtUnionV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtEnumCaseV0 { pub doc: StringM<1024>, pub name: StringM<60>, @@ -6913,6 +7051,7 @@ impl WriteXdr for ScSpecUdtEnumCaseV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtEnumV0 { pub doc: StringM<1024>, pub lib: StringM<80>, @@ -6965,6 +7104,7 @@ impl WriteXdr for ScSpecUdtEnumV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtErrorEnumCaseV0 { pub doc: StringM<1024>, pub name: StringM<60>, @@ -7015,6 +7155,7 @@ impl WriteXdr for ScSpecUdtErrorEnumCaseV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtErrorEnumV0 { pub doc: StringM<1024>, pub lib: StringM<80>, @@ -7067,6 +7208,7 @@ impl WriteXdr for ScSpecUdtErrorEnumV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecFunctionInputV0 { pub doc: StringM<1024>, pub name: StringM<30>, @@ -7117,6 +7259,7 @@ impl WriteXdr for ScSpecFunctionInputV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecFunctionV0 { pub doc: StringM<1024>, pub name: ScSymbol, @@ -7172,6 +7315,7 @@ impl WriteXdr for ScSpecFunctionV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScSpecEntryKind { FunctionV0 = 0, @@ -7306,6 +7450,7 @@ impl WriteXdr for ScSpecEntryKind { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScSpecEntry { FunctionV0(ScSpecFunctionV0), @@ -7489,6 +7634,7 @@ impl WriteXdr for ScSpecEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScValType { Bool = 0, @@ -7708,6 +7854,7 @@ impl WriteXdr for ScValType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScErrorType { Contract = 0, @@ -7859,6 +8006,7 @@ impl WriteXdr for ScErrorType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScErrorCode { ArithDomain = 0, @@ -8020,6 +8168,7 @@ impl WriteXdr for ScErrorCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScError { Contract(u32), @@ -8177,6 +8326,7 @@ impl WriteXdr for ScError { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct UInt128Parts { pub hi: u64, pub lo: u64, @@ -8221,6 +8371,7 @@ impl WriteXdr for UInt128Parts { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Int128Parts { pub hi: i64, pub lo: u64, @@ -8267,6 +8418,7 @@ impl WriteXdr for Int128Parts { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct UInt256Parts { pub hi_hi: u64, pub hi_lo: u64, @@ -8319,6 +8471,7 @@ impl WriteXdr for UInt256Parts { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Int256Parts { pub hi_hi: i64, pub hi_lo: u64, @@ -8371,6 +8524,7 @@ impl WriteXdr for Int256Parts { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ContractExecutableType { Wasm = 0, @@ -8481,6 +8635,7 @@ impl WriteXdr for ContractExecutableType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ContractExecutable { Wasm(Hash), @@ -8589,6 +8744,7 @@ impl WriteXdr for ContractExecutable { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScAddressType { Account = 0, @@ -8804,6 +8960,7 @@ pub const SCSYMBOL_LIMIT: u64 = 32; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct ScVec(pub VecM); @@ -8909,6 +9066,7 @@ impl AsRef<[ScVal]> for ScVec { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct ScMap(pub VecM); @@ -9014,6 +9172,7 @@ impl AsRef<[ScMapEntry]> for ScMap { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct ScBytes(pub BytesM); @@ -9119,6 +9278,7 @@ impl AsRef<[u8]> for ScBytes { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct ScString(pub StringM); @@ -9224,6 +9384,7 @@ impl AsRef<[u8]> for ScString { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct ScSymbol(pub StringM<32>); @@ -9330,6 +9491,7 @@ impl AsRef<[u8]> for ScSymbol { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScNonceKey { pub nonce: i64, } @@ -9371,6 +9533,7 @@ impl WriteXdr for ScNonceKey { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScContractInstance { pub executable: ContractExecutable, pub storage: Option, @@ -9473,6 +9636,7 @@ impl WriteXdr for ScContractInstance { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScVal { Bool(bool), @@ -9725,6 +9889,7 @@ impl WriteXdr for ScVal { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScMapEntry { pub key: ScVal, pub val: ScVal, @@ -9773,6 +9938,7 @@ impl WriteXdr for ScMapEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum StoredTransactionSet { V0(TransactionSet), @@ -9878,6 +10044,7 @@ impl WriteXdr for StoredTransactionSet { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct StoredDebugTransactionSet { pub tx_set: StoredTransactionSet, pub ledger_seq: u32, @@ -9927,6 +10094,7 @@ impl WriteXdr for StoredDebugTransactionSet { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PersistedScpStateV0 { pub scp_envelopes: VecM, pub quorum_sets: VecM, @@ -9976,6 +10144,7 @@ impl WriteXdr for PersistedScpStateV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PersistedScpStateV1 { pub scp_envelopes: VecM, pub quorum_sets: VecM, @@ -10024,6 +10193,7 @@ impl WriteXdr for PersistedScpStateV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum PersistedScpState { V0(PersistedScpStateV0), @@ -10153,6 +10323,39 @@ impl core::str::FromStr for Thresholds { hex::decode(s).map_err(|_| Error::InvalidHex)?.try_into() } } +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for Thresholds { + fn schema_name() -> String { + "Thresholds".to_string() + } + + fn is_referenceable() -> bool { + false + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let schema = String::json_schema(gen); + if let schemars::schema::Schema::Object(mut schema) = schema { + schema.extensions.insert( + "contentEncoding".to_owned(), + serde_json::Value::String("hex".to_string()), + ); + schema.extensions.insert( + "contentMediaType".to_owned(), + serde_json::Value::String("application/binary".to_string()), + ); + let string = *schema.string.unwrap_or_default().clone(); + schema.string = Some(Box::new(schemars::schema::StringValidation { + max_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), + ..string + })); + schema.into() + } else { + schema + } + } +} impl From for [u8; 4] { #[must_use] fn from(x: Thresholds) -> Self { @@ -10243,6 +10446,7 @@ impl AsRef<[u8]> for Thresholds { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct String32(pub StringM<32>); @@ -10348,6 +10552,7 @@ impl AsRef<[u8]> for String32 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct String64(pub StringM<64>); @@ -10452,6 +10657,7 @@ impl AsRef<[u8]> for String64 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct SequenceNumber(pub i64); @@ -10508,6 +10714,7 @@ impl WriteXdr for SequenceNumber { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct DataValue(pub BytesM<64>); @@ -10612,6 +10819,7 @@ impl AsRef<[u8]> for DataValue { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct PoolId(pub Hash); @@ -10876,6 +11084,7 @@ impl AsRef<[u8]> for AssetCode12 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum AssetType { Native = 0, @@ -11101,6 +11310,7 @@ impl WriteXdr for AssetCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AlphaNum4 { pub asset_code: AssetCode4, pub issuer: AccountId, @@ -11146,6 +11356,7 @@ impl WriteXdr for AlphaNum4 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AlphaNum12 { pub asset_code: AssetCode12, pub issuer: AccountId, @@ -11200,6 +11411,7 @@ impl WriteXdr for AlphaNum12 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum Asset { Native, @@ -11313,6 +11525,7 @@ impl WriteXdr for Asset { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Price { pub n: i32, pub d: i32, @@ -11358,6 +11571,7 @@ impl WriteXdr for Price { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Liabilities { pub buying: i64, pub selling: i64, @@ -11406,6 +11620,7 @@ impl WriteXdr for Liabilities { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ThresholdIndexes { MasterWeight = 0, @@ -11530,6 +11745,7 @@ impl WriteXdr for ThresholdIndexes { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum LedgerEntryType { Account = 0, @@ -11680,6 +11896,7 @@ impl WriteXdr for LedgerEntryType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Signer { pub key: SignerKey, pub weight: u32, @@ -11738,6 +11955,7 @@ impl WriteXdr for Signer { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum AccountFlags { RequiredFlag = 1, @@ -11878,6 +12096,7 @@ pub const MAX_SIGNERS: u64 = 20; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct SponsorshipDescriptor(pub Option); @@ -11944,6 +12163,7 @@ impl WriteXdr for SponsorshipDescriptor { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AccountEntryExtensionV3 { pub ext: ExtensionPoint, pub seq_ledger: u32, @@ -11995,6 +12215,7 @@ impl WriteXdr for AccountEntryExtensionV3 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum AccountEntryExtensionV2Ext { V0, @@ -12109,6 +12330,7 @@ impl WriteXdr for AccountEntryExtensionV2Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AccountEntryExtensionV2 { pub num_sponsored: u32, pub num_sponsoring: u32, @@ -12163,6 +12385,7 @@ impl WriteXdr for AccountEntryExtensionV2 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum AccountEntryExtensionV1Ext { V0, @@ -12275,6 +12498,7 @@ impl WriteXdr for AccountEntryExtensionV1Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AccountEntryExtensionV1 { pub liabilities: Liabilities, pub ext: AccountEntryExtensionV1Ext, @@ -12323,6 +12547,7 @@ impl WriteXdr for AccountEntryExtensionV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum AccountEntryExt { V0, @@ -12450,6 +12675,7 @@ impl WriteXdr for AccountEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AccountEntry { pub account_id: AccountId, pub balance: i64, @@ -12526,6 +12752,7 @@ impl WriteXdr for AccountEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum TrustLineFlags { AuthorizedFlag = 1, @@ -12665,6 +12892,7 @@ pub const MASK_TRUSTLINE_FLAGS_V17: u64 = 7; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum LiquidityPoolType { LiquidityPoolConstantProduct = 0, @@ -12778,6 +13006,7 @@ impl WriteXdr for LiquidityPoolType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TrustLineAsset { Native, @@ -12899,6 +13128,7 @@ impl WriteXdr for TrustLineAsset { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TrustLineEntryExtensionV2Ext { V0, @@ -13004,6 +13234,7 @@ impl WriteXdr for TrustLineEntryExtensionV2Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TrustLineEntryExtensionV2 { pub liquidity_pool_use_count: i32, pub ext: TrustLineEntryExtensionV2Ext, @@ -13052,6 +13283,7 @@ impl WriteXdr for TrustLineEntryExtensionV2 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TrustLineEntryV1Ext { V0, @@ -13164,6 +13396,7 @@ impl WriteXdr for TrustLineEntryV1Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TrustLineEntryV1 { pub liabilities: Liabilities, pub ext: TrustLineEntryV1Ext, @@ -13224,6 +13457,7 @@ impl WriteXdr for TrustLineEntryV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TrustLineEntryExt { V0, @@ -13355,6 +13589,7 @@ impl WriteXdr for TrustLineEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TrustLineEntry { pub account_id: AccountId, pub asset: TrustLineAsset, @@ -13414,6 +13649,7 @@ impl WriteXdr for TrustLineEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum OfferEntryFlags { PassiveFlag = 1, @@ -13524,6 +13760,7 @@ pub const MASK_OFFERENTRY_FLAGS: u64 = 1; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum OfferEntryExt { V0, @@ -13642,6 +13879,7 @@ impl WriteXdr for OfferEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct OfferEntry { pub seller_id: AccountId, pub offer_id: i64, @@ -13706,6 +13944,7 @@ impl WriteXdr for OfferEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum DataEntryExt { V0, @@ -13814,6 +14053,7 @@ impl WriteXdr for DataEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct DataEntry { pub account_id: AccountId, pub data_name: String64, @@ -13870,6 +14110,7 @@ impl WriteXdr for DataEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClaimPredicateType { Unconditional = 0, @@ -14012,6 +14253,7 @@ impl WriteXdr for ClaimPredicateType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ClaimPredicate { Unconditional, @@ -14154,6 +14396,7 @@ impl WriteXdr for ClaimPredicate { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClaimantType { ClaimantTypeV0 = 0, @@ -14255,6 +14498,7 @@ impl WriteXdr for ClaimantType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClaimantV0 { pub destination: AccountId, pub predicate: ClaimPredicate, @@ -14305,6 +14549,7 @@ impl WriteXdr for ClaimantV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum Claimant { ClaimantTypeV0(ClaimantV0), @@ -14404,6 +14649,7 @@ impl WriteXdr for Claimant { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClaimableBalanceIdType { ClaimableBalanceIdTypeV0 = 0, @@ -14610,6 +14856,7 @@ impl WriteXdr for ClaimableBalanceId { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClaimableBalanceFlags { ClaimableBalanceClawbackEnabledFlag = 1, @@ -14721,6 +14968,7 @@ pub const MASK_CLAIMABLE_BALANCE_FLAGS: u64 = 0x1; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ClaimableBalanceEntryExtensionV1Ext { V0, @@ -14826,6 +15074,7 @@ impl WriteXdr for ClaimableBalanceEntryExtensionV1Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClaimableBalanceEntryExtensionV1 { pub ext: ClaimableBalanceEntryExtensionV1Ext, pub flags: u32, @@ -14874,6 +15123,7 @@ impl WriteXdr for ClaimableBalanceEntryExtensionV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ClaimableBalanceEntryExt { V0, @@ -14997,6 +15247,7 @@ impl WriteXdr for ClaimableBalanceEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClaimableBalanceEntry { pub balance_id: ClaimableBalanceId, pub claimants: VecM, @@ -15052,6 +15303,7 @@ impl WriteXdr for ClaimableBalanceEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LiquidityPoolConstantProductParameters { pub asset_a: Asset, pub asset_b: Asset, @@ -15105,6 +15357,7 @@ impl WriteXdr for LiquidityPoolConstantProductParameters { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LiquidityPoolEntryConstantProduct { pub params: LiquidityPoolConstantProductParameters, pub reserve_a: i64, @@ -15169,6 +15422,7 @@ impl WriteXdr for LiquidityPoolEntryConstantProduct { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LiquidityPoolEntryBody { LiquidityPoolConstantProduct(LiquidityPoolEntryConstantProduct), @@ -15289,6 +15543,7 @@ impl WriteXdr for LiquidityPoolEntryBody { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LiquidityPoolEntry { pub liquidity_pool_id: PoolId, pub body: LiquidityPoolEntryBody, @@ -15334,6 +15589,7 @@ impl WriteXdr for LiquidityPoolEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ContractDataDurability { Temporary = 0, @@ -15444,6 +15700,7 @@ impl WriteXdr for ContractDataDurability { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractDataEntry { pub ext: ExtensionPoint, pub contract: ScAddress, @@ -15506,6 +15763,7 @@ impl WriteXdr for ContractDataEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractCodeCostInputs { pub ext: ExtensionPoint, pub n_instructions: u32, @@ -15578,6 +15836,7 @@ impl WriteXdr for ContractCodeCostInputs { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractCodeEntryV1 { pub ext: ExtensionPoint, pub cost_inputs: ContractCodeCostInputs, @@ -15630,6 +15889,7 @@ impl WriteXdr for ContractCodeEntryV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ContractCodeEntryExt { V0, @@ -15745,6 +16005,7 @@ impl WriteXdr for ContractCodeEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractCodeEntry { pub ext: ContractCodeEntryExt, pub hash: Hash, @@ -15793,6 +16054,7 @@ impl WriteXdr for ContractCodeEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TtlEntry { pub key_hash: Hash, pub live_until_ledger_seq: u32, @@ -15839,6 +16101,7 @@ impl WriteXdr for TtlEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerEntryExtensionV1Ext { V0, @@ -15944,6 +16207,7 @@ impl WriteXdr for LedgerEntryExtensionV1Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerEntryExtensionV1 { pub sponsoring_id: SponsorshipDescriptor, pub ext: LedgerEntryExtensionV1Ext, @@ -16008,6 +16272,7 @@ impl WriteXdr for LedgerEntryExtensionV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerEntryData { Account(AccountEntry), @@ -16187,6 +16452,7 @@ impl WriteXdr for LedgerEntryData { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerEntryExt { V0, @@ -16325,6 +16591,7 @@ impl WriteXdr for LedgerEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerEntry { pub last_modified_ledger_seq: u32, pub data: LedgerEntryData, @@ -16372,6 +16639,7 @@ impl WriteXdr for LedgerEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyAccount { pub account_id: AccountId, } @@ -16414,6 +16682,7 @@ impl WriteXdr for LedgerKeyAccount { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyTrustLine { pub account_id: AccountId, pub asset: TrustLineAsset, @@ -16459,6 +16728,7 @@ impl WriteXdr for LedgerKeyTrustLine { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyOffer { pub seller_id: AccountId, pub offer_id: i64, @@ -16504,6 +16774,7 @@ impl WriteXdr for LedgerKeyOffer { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyData { pub account_id: AccountId, pub data_name: String64, @@ -16548,6 +16819,7 @@ impl WriteXdr for LedgerKeyData { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyClaimableBalance { pub balance_id: ClaimableBalanceId, } @@ -16589,6 +16861,7 @@ impl WriteXdr for LedgerKeyClaimableBalance { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyLiquidityPool { pub liquidity_pool_id: PoolId, } @@ -16632,6 +16905,7 @@ impl WriteXdr for LedgerKeyLiquidityPool { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyContractData { pub contract: ScAddress, pub key: ScVal, @@ -16679,6 +16953,7 @@ impl WriteXdr for LedgerKeyContractData { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyContractCode { pub hash: Hash, } @@ -16720,6 +16995,7 @@ impl WriteXdr for LedgerKeyContractCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyConfigSetting { pub config_setting_id: ConfigSettingId, } @@ -16762,6 +17038,7 @@ impl WriteXdr for LedgerKeyConfigSetting { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyTtl { pub key_hash: Hash, } @@ -16864,6 +17141,7 @@ impl WriteXdr for LedgerKeyTtl { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerKey { Account(LedgerKeyAccount), @@ -17049,6 +17327,7 @@ impl WriteXdr for LedgerKey { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum EnvelopeType { TxV0 = 0, @@ -17196,6 +17475,7 @@ impl WriteXdr for EnvelopeType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct UpgradeType(pub BytesM<128>); @@ -17305,6 +17585,7 @@ impl AsRef<[u8]> for UpgradeType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum StellarValueType { Basic = 0, @@ -17409,6 +17690,7 @@ impl WriteXdr for StellarValueType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerCloseValueSignature { pub node_id: NodeId, pub signature: Signature, @@ -17457,6 +17739,7 @@ impl WriteXdr for LedgerCloseValueSignature { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum StellarValueExt { Basic, @@ -17578,6 +17861,7 @@ impl WriteXdr for StellarValueExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct StellarValue { pub tx_set_hash: Hash, pub close_time: TimePoint, @@ -17639,6 +17923,7 @@ pub const MASK_LEDGER_HEADER_FLAGS: u64 = 0x7; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum LedgerHeaderFlags { TradingFlag = 1, @@ -17751,6 +18036,7 @@ impl WriteXdr for LedgerHeaderFlags { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerHeaderExtensionV1Ext { V0, @@ -17856,6 +18142,7 @@ impl WriteXdr for LedgerHeaderExtensionV1Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerHeaderExtensionV1 { pub flags: u32, pub ext: LedgerHeaderExtensionV1Ext, @@ -17904,6 +18191,7 @@ impl WriteXdr for LedgerHeaderExtensionV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerHeaderExt { V0, @@ -18042,6 +18330,7 @@ impl WriteXdr for LedgerHeaderExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerHeader { pub ledger_version: u32, pub previous_ledger_hash: Hash, @@ -18132,6 +18421,7 @@ impl WriteXdr for LedgerHeader { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum LedgerUpgradeType { Version = 1, @@ -18266,6 +18556,7 @@ impl WriteXdr for LedgerUpgradeType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigUpgradeSetKey { pub contract_id: Hash, pub content_hash: Hash, @@ -18327,6 +18618,7 @@ impl WriteXdr for ConfigUpgradeSetKey { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerUpgrade { Version(u32), @@ -18472,6 +18764,7 @@ impl WriteXdr for LedgerUpgrade { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigUpgradeSet { pub updated_entry: VecM, } @@ -18519,6 +18812,7 @@ impl WriteXdr for ConfigUpgradeSet { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum BucketEntryType { Metaentry = -1, @@ -18636,6 +18930,7 @@ impl WriteXdr for BucketEntryType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum BucketMetadataExt { V0, @@ -18743,6 +19038,7 @@ impl WriteXdr for BucketMetadataExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct BucketMetadata { pub ledger_version: u32, pub ext: BucketMetadataExt, @@ -18795,6 +19091,7 @@ impl WriteXdr for BucketMetadata { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum BucketEntry { Liveentry(LedgerEntry), @@ -18917,6 +19214,7 @@ impl WriteXdr for BucketEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum TxSetComponentType { TxsetCompTxsMaybeDiscountedFee = 0, @@ -19019,6 +19317,7 @@ impl WriteXdr for TxSetComponentType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TxSetComponentTxsMaybeDiscountedFee { pub base_fee: Option, pub txs: VecM, @@ -19069,6 +19368,7 @@ impl WriteXdr for TxSetComponentTxsMaybeDiscountedFee { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TxSetComponent { TxsetCompTxsMaybeDiscountedFee(TxSetComponentTxsMaybeDiscountedFee), @@ -19176,6 +19476,7 @@ impl WriteXdr for TxSetComponent { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionPhase { V0(VecM), @@ -19275,6 +19576,7 @@ impl WriteXdr for TransactionPhase { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionSet { pub previous_ledger_hash: Hash, pub txs: VecM, @@ -19320,6 +19622,7 @@ impl WriteXdr for TransactionSet { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionSetV1 { pub previous_ledger_hash: Hash, pub phases: VecM, @@ -19367,6 +19670,7 @@ impl WriteXdr for TransactionSetV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum GeneralizedTransactionSet { V1(TransactionSetV1), @@ -19466,6 +19770,7 @@ impl WriteXdr for GeneralizedTransactionSet { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionResultPair { pub transaction_hash: Hash, pub result: TransactionResult, @@ -19510,6 +19815,7 @@ impl WriteXdr for TransactionResultPair { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionResultSet { pub results: VecM, } @@ -19555,6 +19861,7 @@ impl WriteXdr for TransactionResultSet { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionHistoryEntryExt { V0, @@ -19669,6 +19976,7 @@ impl WriteXdr for TransactionHistoryEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionHistoryEntry { pub ledger_seq: u32, pub tx_set: TransactionSet, @@ -19718,6 +20026,7 @@ impl WriteXdr for TransactionHistoryEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionHistoryResultEntryExt { V0, @@ -19825,6 +20134,7 @@ impl WriteXdr for TransactionHistoryResultEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionHistoryResultEntry { pub ledger_seq: u32, pub tx_result_set: TransactionResultSet, @@ -19874,6 +20184,7 @@ impl WriteXdr for TransactionHistoryResultEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerHeaderHistoryEntryExt { V0, @@ -19981,6 +20292,7 @@ impl WriteXdr for LedgerHeaderHistoryEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerHeaderHistoryEntry { pub hash: Hash, pub header: LedgerHeader, @@ -20029,6 +20341,7 @@ impl WriteXdr for LedgerHeaderHistoryEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerScpMessages { pub ledger_seq: u32, pub messages: VecM, @@ -20074,6 +20387,7 @@ impl WriteXdr for LedgerScpMessages { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpHistoryEntryV0 { pub quorum_sets: VecM, pub ledger_messages: LedgerScpMessages, @@ -20120,6 +20434,7 @@ impl WriteXdr for ScpHistoryEntryV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScpHistoryEntry { V0(ScpHistoryEntryV0), @@ -20222,6 +20537,7 @@ impl WriteXdr for ScpHistoryEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum LedgerEntryChangeType { Created = 0, @@ -20344,6 +20660,7 @@ impl WriteXdr for LedgerEntryChangeType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerEntryChange { Created(LedgerEntry), @@ -20460,6 +20777,7 @@ impl WriteXdr for LedgerEntryChange { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct LedgerEntryChanges(pub VecM); @@ -20567,6 +20885,7 @@ impl AsRef<[LedgerEntryChange]> for LedgerEntryChanges { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct OperationMeta { pub changes: LedgerEntryChanges, } @@ -20609,6 +20928,7 @@ impl WriteXdr for OperationMeta { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionMetaV1 { pub tx_changes: LedgerEntryChanges, pub operations: VecM, @@ -20657,6 +20977,7 @@ impl WriteXdr for TransactionMetaV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionMetaV2 { pub tx_changes_before: LedgerEntryChanges, pub operations: VecM, @@ -20707,6 +21028,7 @@ impl WriteXdr for TransactionMetaV2 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ContractEventType { System = 0, @@ -20818,6 +21140,7 @@ impl WriteXdr for ContractEventType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractEventV0 { pub topics: VecM, pub data: ScVal, @@ -20868,6 +21191,7 @@ impl WriteXdr for ContractEventV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ContractEventBody { V0(ContractEventV0), @@ -20982,6 +21306,7 @@ impl WriteXdr for ContractEventBody { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractEvent { pub ext: ExtensionPoint, pub contract_id: Option, @@ -21033,6 +21358,7 @@ impl WriteXdr for ContractEvent { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct DiagnosticEvent { pub in_successful_contract_call: bool, pub event: ContractEvent, @@ -21106,6 +21432,7 @@ impl WriteXdr for DiagnosticEvent { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanTransactionMetaExtV1 { pub ext: ExtensionPoint, pub total_non_refundable_resource_fee_charged: i64, @@ -21161,6 +21488,7 @@ impl WriteXdr for SorobanTransactionMetaExtV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum SorobanTransactionMetaExt { V0, @@ -21273,6 +21601,7 @@ impl WriteXdr for SorobanTransactionMetaExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanTransactionMeta { pub ext: SorobanTransactionMetaExt, pub events: VecM, @@ -21331,6 +21660,7 @@ impl WriteXdr for SorobanTransactionMeta { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionMetaV3 { pub ext: ExtensionPoint, pub tx_changes_before: LedgerEntryChanges, @@ -21385,6 +21715,7 @@ impl WriteXdr for TransactionMetaV3 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct InvokeHostFunctionSuccessPreImage { pub return_value: ScVal, pub events: VecM, @@ -21437,6 +21768,7 @@ impl WriteXdr for InvokeHostFunctionSuccessPreImage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionMeta { V0(VecM), @@ -21552,6 +21884,7 @@ impl WriteXdr for TransactionMeta { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionResultMeta { pub result: TransactionResultPair, pub fee_processing: LedgerEntryChanges, @@ -21600,6 +21933,7 @@ impl WriteXdr for TransactionResultMeta { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct UpgradeEntryMeta { pub upgrade: LedgerUpgrade, pub changes: LedgerEntryChanges, @@ -21657,6 +21991,7 @@ impl WriteXdr for UpgradeEntryMeta { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerCloseMetaV0 { pub ledger_header: LedgerHeaderHistoryEntry, pub tx_set: TransactionSet, @@ -21711,6 +22046,7 @@ impl WriteXdr for LedgerCloseMetaV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerCloseMetaExtV1 { pub ext: ExtensionPoint, pub soroban_fee_write1_kb: i64, @@ -21759,6 +22095,7 @@ impl WriteXdr for LedgerCloseMetaExtV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerCloseMetaExt { V0, @@ -21888,6 +22225,7 @@ impl WriteXdr for LedgerCloseMetaExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerCloseMetaV1 { pub ext: LedgerCloseMetaExt, pub ledger_header: LedgerHeaderHistoryEntry, @@ -21957,6 +22295,7 @@ impl WriteXdr for LedgerCloseMetaV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerCloseMeta { V0(LedgerCloseMetaV0), @@ -22065,6 +22404,7 @@ impl WriteXdr for LedgerCloseMeta { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ErrorCode { Misc = 0, @@ -22184,6 +22524,7 @@ impl WriteXdr for ErrorCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SError { pub code: ErrorCode, pub msg: StringM<100>, @@ -22228,6 +22569,7 @@ impl WriteXdr for SError { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SendMore { pub num_messages: u32, } @@ -22270,6 +22612,7 @@ impl WriteXdr for SendMore { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SendMoreExtended { pub num_messages: u32, pub num_bytes: u32, @@ -22316,6 +22659,7 @@ impl WriteXdr for SendMoreExtended { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AuthCert { pub pubkey: Curve25519Public, pub expiration: u64, @@ -22371,6 +22715,7 @@ impl WriteXdr for AuthCert { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Hello { pub ledger_version: u32, pub overlay_version: u32, @@ -22444,6 +22789,7 @@ pub const AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED: u64 = 200; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Auth { pub flags: i32, } @@ -22487,6 +22833,7 @@ impl WriteXdr for Auth { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum IpAddrType { IPv4 = 0, @@ -22594,6 +22941,7 @@ impl WriteXdr for IpAddrType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum PeerAddressIp { IPv4([u8; 4]), @@ -22706,6 +23054,7 @@ impl WriteXdr for PeerAddressIp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PeerAddress { pub ip: PeerAddressIp, pub port: u32, @@ -22783,6 +23132,7 @@ impl WriteXdr for PeerAddress { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum MessageType { ErrorMsg = 0, @@ -22983,6 +23333,7 @@ impl WriteXdr for MessageType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct DontHave { pub type_: MessageType, pub req_hash: Uint256, @@ -23028,6 +23379,7 @@ impl WriteXdr for DontHave { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum SurveyMessageCommandType { SurveyTopology = 0, @@ -23130,6 +23482,7 @@ impl WriteXdr for SurveyMessageCommandType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum SurveyMessageResponseType { V0 = 0, @@ -23238,6 +23591,7 @@ impl WriteXdr for SurveyMessageResponseType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SurveyRequestMessage { pub surveyor_peer_id: NodeId, pub surveyed_peer_id: NodeId, @@ -23292,6 +23646,7 @@ impl WriteXdr for SurveyRequestMessage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SignedSurveyRequestMessage { pub request_signature: Signature, pub request: SurveyRequestMessage, @@ -23334,6 +23689,7 @@ impl WriteXdr for SignedSurveyRequestMessage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct EncryptedBody(pub BytesM<64000>); @@ -23445,6 +23801,7 @@ impl AsRef<[u8]> for EncryptedBody { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SurveyResponseMessage { pub surveyor_peer_id: NodeId, pub surveyed_peer_id: NodeId, @@ -23499,6 +23856,7 @@ impl WriteXdr for SurveyResponseMessage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SignedSurveyResponseMessage { pub response_signature: Signature, pub response: SurveyResponseMessage, @@ -23559,6 +23917,7 @@ impl WriteXdr for SignedSurveyResponseMessage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PeerStats { pub id: NodeId, pub version_str: StringM<100>, @@ -23640,6 +23999,7 @@ impl WriteXdr for PeerStats { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct PeerStatList(pub VecM); @@ -23751,6 +24111,7 @@ impl AsRef<[PeerStats]> for PeerStatList { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TopologyResponseBodyV0 { pub inbound_peers: PeerStatList, pub outbound_peers: PeerStatList, @@ -23808,6 +24169,7 @@ impl WriteXdr for TopologyResponseBodyV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TopologyResponseBodyV1 { pub inbound_peers: PeerStatList, pub outbound_peers: PeerStatList, @@ -23868,6 +24230,7 @@ impl WriteXdr for TopologyResponseBodyV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum SurveyResponseBody { V0(TopologyResponseBodyV0), @@ -23979,6 +24342,7 @@ pub const TX_ADVERT_VECTOR_MAX_SIZE: u64 = 1000; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct TxAdvertVector(pub VecM); @@ -24086,6 +24450,7 @@ impl AsRef<[Hash]> for TxAdvertVector { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct FloodAdvert { pub tx_hashes: TxAdvertVector, } @@ -24133,6 +24498,7 @@ pub const TX_DEMAND_VECTOR_MAX_SIZE: u64 = 1000; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct TxDemandVector(pub VecM); @@ -24240,6 +24606,7 @@ impl AsRef<[Hash]> for TxDemandVector { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct FloodDemand { pub tx_hashes: TxDemandVector, } @@ -24328,6 +24695,7 @@ impl WriteXdr for FloodDemand { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum StellarMessage { ErrorMsg(SError), @@ -24573,6 +24941,7 @@ impl WriteXdr for StellarMessage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AuthenticatedMessageV0 { pub sequence: u64, pub message: StellarMessage, @@ -24627,6 +24996,7 @@ impl WriteXdr for AuthenticatedMessageV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum AuthenticatedMessage { V0(AuthenticatedMessageV0), @@ -24735,6 +25105,7 @@ pub const MAX_OPS_PER_TX: u64 = 100; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LiquidityPoolParameters { LiquidityPoolConstantProduct(LiquidityPoolConstantProductParameters), @@ -24996,6 +25367,7 @@ impl WriteXdr for MuxedAccount { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct DecoratedSignature { pub hint: SignatureHint, pub signature: Signature, @@ -25067,6 +25439,7 @@ impl WriteXdr for DecoratedSignature { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum OperationType { CreateAccount = 0, @@ -25302,6 +25675,7 @@ impl WriteXdr for OperationType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct CreateAccountOp { pub destination: AccountId, pub starting_balance: i64, @@ -25348,6 +25722,7 @@ impl WriteXdr for CreateAccountOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PaymentOp { pub destination: MuxedAccount, pub asset: Asset, @@ -25404,6 +25779,7 @@ impl WriteXdr for PaymentOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PathPaymentStrictReceiveOp { pub send_asset: Asset, pub send_max: i64, @@ -25469,6 +25845,7 @@ impl WriteXdr for PathPaymentStrictReceiveOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PathPaymentStrictSendOp { pub send_asset: Asset, pub send_amount: i64, @@ -25531,6 +25908,7 @@ impl WriteXdr for PathPaymentStrictSendOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ManageSellOfferOp { pub selling: Asset, pub buying: Asset, @@ -25591,6 +25969,7 @@ impl WriteXdr for ManageSellOfferOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ManageBuyOfferOp { pub selling: Asset, pub buying: Asset, @@ -25647,6 +26026,7 @@ impl WriteXdr for ManageBuyOfferOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct CreatePassiveSellOfferOp { pub selling: Asset, pub buying: Asset, @@ -25712,6 +26092,7 @@ impl WriteXdr for CreatePassiveSellOfferOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SetOptionsOp { pub inflation_dest: Option, pub clear_flags: Option, @@ -25790,6 +26171,7 @@ impl WriteXdr for SetOptionsOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ChangeTrustAsset { Native, @@ -25912,6 +26294,7 @@ impl WriteXdr for ChangeTrustAsset { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ChangeTrustOp { pub line: ChangeTrustAsset, pub limit: i64, @@ -25960,6 +26343,7 @@ impl WriteXdr for ChangeTrustOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AllowTrustOp { pub trustor: AccountId, pub asset: AssetCode, @@ -26008,6 +26392,7 @@ impl WriteXdr for AllowTrustOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ManageDataOp { pub data_name: String64, pub data_value: Option, @@ -26052,6 +26437,7 @@ impl WriteXdr for ManageDataOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct BumpSequenceOp { pub bump_to: SequenceNumber, } @@ -26095,6 +26481,7 @@ impl WriteXdr for BumpSequenceOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct CreateClaimableBalanceOp { pub asset: Asset, pub amount: i64, @@ -26142,6 +26529,7 @@ impl WriteXdr for CreateClaimableBalanceOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClaimClaimableBalanceOp { pub balance_id: ClaimableBalanceId, } @@ -26183,6 +26571,7 @@ impl WriteXdr for ClaimClaimableBalanceOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct BeginSponsoringFutureReservesOp { pub sponsored_id: AccountId, } @@ -26226,6 +26615,7 @@ impl WriteXdr for BeginSponsoringFutureReservesOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum RevokeSponsorshipType { LedgerEntry = 0, @@ -26333,6 +26723,7 @@ impl WriteXdr for RevokeSponsorshipType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct RevokeSponsorshipOpSigner { pub account_id: AccountId, pub signer_key: SignerKey, @@ -26385,6 +26776,7 @@ impl WriteXdr for RevokeSponsorshipOpSigner { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum RevokeSponsorshipOp { LedgerEntry(LedgerKey), @@ -26495,6 +26887,7 @@ impl WriteXdr for RevokeSponsorshipOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClawbackOp { pub asset: Asset, pub from: MuxedAccount, @@ -26542,6 +26935,7 @@ impl WriteXdr for ClawbackOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClawbackClaimableBalanceOp { pub balance_id: ClaimableBalanceId, } @@ -26587,6 +26981,7 @@ impl WriteXdr for ClawbackClaimableBalanceOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SetTrustLineFlagsOp { pub trustor: AccountId, pub asset: Asset, @@ -26649,6 +27044,7 @@ pub const LIQUIDITY_POOL_FEE_V18: u64 = 30; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LiquidityPoolDepositOp { pub liquidity_pool_id: PoolId, pub max_amount_a: i64, @@ -26705,6 +27101,7 @@ impl WriteXdr for LiquidityPoolDepositOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LiquidityPoolWithdrawOp { pub liquidity_pool_id: PoolId, pub amount: i64, @@ -26758,6 +27155,7 @@ impl WriteXdr for LiquidityPoolWithdrawOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum HostFunctionType { InvokeContract = 0, @@ -26871,6 +27269,7 @@ impl WriteXdr for HostFunctionType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ContractIdPreimageType { Address = 0, @@ -26978,6 +27377,7 @@ impl WriteXdr for ContractIdPreimageType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractIdPreimageFromAddress { pub address: ScAddress, pub salt: Uint256, @@ -27030,6 +27430,7 @@ impl WriteXdr for ContractIdPreimageFromAddress { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ContractIdPreimage { Address(ContractIdPreimageFromAddress), @@ -27139,6 +27540,7 @@ impl WriteXdr for ContractIdPreimage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct CreateContractArgs { pub contract_id_preimage: ContractIdPreimage, pub executable: ContractExecutable, @@ -27184,6 +27586,7 @@ impl WriteXdr for CreateContractArgs { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct InvokeContractArgs { pub contract_address: ScAddress, pub function_name: ScSymbol, @@ -27237,6 +27640,7 @@ impl WriteXdr for InvokeContractArgs { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum HostFunction { InvokeContract(InvokeContractArgs), @@ -27358,6 +27762,7 @@ impl WriteXdr for HostFunction { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum SorobanAuthorizedFunctionType { ContractFn = 0, @@ -27468,6 +27873,7 @@ impl WriteXdr for SorobanAuthorizedFunctionType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum SorobanAuthorizedFunction { ContractFn(InvokeContractArgs), @@ -27580,6 +27986,7 @@ impl WriteXdr for SorobanAuthorizedFunction { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanAuthorizedInvocation { pub function: SorobanAuthorizedFunction, pub sub_invocations: VecM, @@ -27627,6 +28034,7 @@ impl WriteXdr for SorobanAuthorizedInvocation { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanAddressCredentials { pub address: ScAddress, pub nonce: i64, @@ -27679,6 +28087,7 @@ impl WriteXdr for SorobanAddressCredentials { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum SorobanCredentialsType { SourceAccount = 0, @@ -27789,6 +28198,7 @@ impl WriteXdr for SorobanCredentialsType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum SorobanCredentials { SourceAccount, @@ -27898,6 +28308,7 @@ impl WriteXdr for SorobanCredentials { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanAuthorizationEntry { pub credentials: SorobanCredentials, pub root_invocation: SorobanAuthorizedInvocation, @@ -27945,6 +28356,7 @@ impl WriteXdr for SorobanAuthorizationEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct InvokeHostFunctionOp { pub host_function: HostFunction, pub auth: VecM, @@ -27990,6 +28402,7 @@ impl WriteXdr for InvokeHostFunctionOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ExtendFootprintTtlOp { pub ext: ExtensionPoint, pub extend_to: u32, @@ -28034,6 +28447,7 @@ impl WriteXdr for ExtendFootprintTtlOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct RestoreFootprintOp { pub ext: ExtensionPoint, } @@ -28129,6 +28543,7 @@ impl WriteXdr for RestoreFootprintOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum OperationBody { CreateAccount(CreateAccountOp), @@ -28509,6 +28924,7 @@ impl WriteXdr for OperationBody { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Operation { pub source_account: Option, pub body: OperationBody, @@ -28555,6 +28971,7 @@ impl WriteXdr for Operation { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct HashIdPreimageOperationId { pub source_account: AccountId, pub seq_num: SequenceNumber, @@ -28606,6 +29023,7 @@ impl WriteXdr for HashIdPreimageOperationId { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct HashIdPreimageRevokeId { pub source_account: AccountId, pub seq_num: SequenceNumber, @@ -28660,6 +29078,7 @@ impl WriteXdr for HashIdPreimageRevokeId { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct HashIdPreimageContractId { pub network_id: Hash, pub contract_id_preimage: ContractIdPreimage, @@ -28707,6 +29126,7 @@ impl WriteXdr for HashIdPreimageContractId { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct HashIdPreimageSorobanAuthorization { pub network_id: Hash, pub nonce: i64, @@ -28787,6 +29207,7 @@ impl WriteXdr for HashIdPreimageSorobanAuthorization { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum HashIdPreimage { OpId(HashIdPreimageOperationId), @@ -28921,6 +29342,7 @@ impl WriteXdr for HashIdPreimage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum MemoType { None = 0, @@ -29049,6 +29471,7 @@ impl WriteXdr for MemoType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum Memo { None, @@ -29174,6 +29597,7 @@ impl WriteXdr for Memo { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TimeBounds { pub min_time: TimePoint, pub max_time: TimePoint, @@ -29219,6 +29643,7 @@ impl WriteXdr for TimeBounds { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerBounds { pub min_ledger: u32, pub max_ledger: u32, @@ -29291,6 +29716,7 @@ impl WriteXdr for LedgerBounds { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PreconditionsV2 { pub time_bounds: Option, pub ledger_bounds: Option, @@ -29350,6 +29776,7 @@ impl WriteXdr for PreconditionsV2 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum PreconditionType { None = 0, @@ -29466,6 +29893,7 @@ impl WriteXdr for PreconditionType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum Preconditions { None, @@ -29579,6 +30007,7 @@ impl WriteXdr for Preconditions { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerFootprint { pub read_only: VecM, pub read_write: VecM, @@ -29631,6 +30060,7 @@ impl WriteXdr for LedgerFootprint { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanResources { pub footprint: LedgerFootprint, pub instructions: u32, @@ -29692,6 +30122,7 @@ impl WriteXdr for SorobanResources { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanTransactionData { pub ext: ExtensionPoint, pub resources: SorobanResources, @@ -29741,6 +30172,7 @@ impl WriteXdr for SorobanTransactionData { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionV0Ext { V0, @@ -29850,6 +30282,7 @@ impl WriteXdr for TransactionV0Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionV0 { pub source_account_ed25519: Uint256, pub fee: u32, @@ -29912,6 +30345,7 @@ impl WriteXdr for TransactionV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionV0Envelope { pub tx: TransactionV0, pub signatures: VecM, @@ -29960,6 +30394,7 @@ impl WriteXdr for TransactionV0Envelope { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionExt { V0, @@ -30087,6 +30522,7 @@ impl WriteXdr for TransactionExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Transaction { pub source_account: MuxedAccount, pub fee: u32, @@ -30149,6 +30585,7 @@ impl WriteXdr for Transaction { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionV1Envelope { pub tx: Transaction, pub signatures: VecM, @@ -30195,6 +30632,7 @@ impl WriteXdr for TransactionV1Envelope { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum FeeBumpTransactionInnerTx { Tx(TransactionV1Envelope), @@ -30295,6 +30733,7 @@ impl WriteXdr for FeeBumpTransactionInnerTx { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum FeeBumpTransactionExt { V0, @@ -30406,6 +30845,7 @@ impl WriteXdr for FeeBumpTransactionExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct FeeBumpTransaction { pub fee_source: MuxedAccount, pub fee: i64, @@ -30459,6 +30899,7 @@ impl WriteXdr for FeeBumpTransaction { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct FeeBumpTransactionEnvelope { pub tx: FeeBumpTransaction, pub signatures: VecM, @@ -30509,6 +30950,7 @@ impl WriteXdr for FeeBumpTransactionEnvelope { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionEnvelope { TxV0(TransactionV0Envelope), @@ -30628,6 +31070,7 @@ impl WriteXdr for TransactionEnvelope { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionSignaturePayloadTaggedTransaction { Tx(Transaction), @@ -30740,6 +31183,7 @@ impl WriteXdr for TransactionSignaturePayloadTaggedTransaction { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionSignaturePayload { pub network_id: Hash, pub tagged_transaction: TransactionSignaturePayloadTaggedTransaction, @@ -30787,6 +31231,7 @@ impl WriteXdr for TransactionSignaturePayload { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClaimAtomType { V0 = 0, @@ -30907,6 +31352,7 @@ impl WriteXdr for ClaimAtomType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClaimOfferAtomV0 { pub seller_ed25519: Uint256, pub offer_id: i64, @@ -30973,6 +31419,7 @@ impl WriteXdr for ClaimOfferAtomV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClaimOfferAtom { pub seller_id: AccountId, pub offer_id: i64, @@ -31037,6 +31484,7 @@ impl WriteXdr for ClaimOfferAtom { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClaimLiquidityAtom { pub liquidity_pool_id: PoolId, pub asset_sold: Asset, @@ -31096,6 +31544,7 @@ impl WriteXdr for ClaimLiquidityAtom { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ClaimAtom { V0(ClaimOfferAtomV0), @@ -31219,6 +31668,7 @@ impl WriteXdr for ClaimAtom { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum CreateAccountResultCode { Success = 0, @@ -31350,6 +31800,7 @@ impl WriteXdr for CreateAccountResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum CreateAccountResult { Success, @@ -31493,6 +31944,7 @@ impl WriteXdr for CreateAccountResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum PaymentResultCode { Success = 0, @@ -31654,6 +32106,7 @@ impl WriteXdr for PaymentResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum PaymentResult { Success, @@ -31844,6 +32297,7 @@ impl WriteXdr for PaymentResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum PathPaymentStrictReceiveResultCode { Success = 0, @@ -32010,6 +32464,7 @@ impl WriteXdr for PathPaymentStrictReceiveResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SimplePaymentResult { pub destination: AccountId, pub asset: Asset, @@ -32058,6 +32513,7 @@ impl WriteXdr for SimplePaymentResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PathPaymentStrictReceiveResultSuccess { pub offers: VecM, pub last: SimplePaymentResult, @@ -32124,6 +32580,7 @@ impl WriteXdr for PathPaymentStrictReceiveResultSuccess { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum PathPaymentStrictReceiveResult { Success(PathPaymentStrictReceiveResultSuccess), @@ -32337,6 +32794,7 @@ impl WriteXdr for PathPaymentStrictReceiveResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum PathPaymentStrictSendResultCode { Success = 0, @@ -32502,6 +32960,7 @@ impl WriteXdr for PathPaymentStrictSendResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PathPaymentStrictSendResultSuccess { pub offers: VecM, pub last: SimplePaymentResult, @@ -32567,6 +33026,7 @@ impl WriteXdr for PathPaymentStrictSendResultSuccess { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum PathPaymentStrictSendResult { Success(PathPaymentStrictSendResultSuccess), @@ -32779,6 +33239,7 @@ impl WriteXdr for PathPaymentStrictSendResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ManageSellOfferResultCode { Success = 0, @@ -32946,6 +33407,7 @@ impl WriteXdr for ManageSellOfferResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ManageOfferEffect { Created = 0, @@ -33061,6 +33523,7 @@ impl WriteXdr for ManageOfferEffect { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ManageOfferSuccessResultOffer { Created(OfferEntry), @@ -33184,6 +33647,7 @@ impl WriteXdr for ManageOfferSuccessResultOffer { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ManageOfferSuccessResult { pub offers_claimed: VecM, pub offer: ManageOfferSuccessResultOffer, @@ -33243,6 +33707,7 @@ impl WriteXdr for ManageOfferSuccessResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ManageSellOfferResult { Success(ManageOfferSuccessResult), @@ -33452,6 +33917,7 @@ impl WriteXdr for ManageSellOfferResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ManageBuyOfferResultCode { Success = 0, @@ -33631,6 +34097,7 @@ impl WriteXdr for ManageBuyOfferResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ManageBuyOfferResult { Success(ManageOfferSuccessResult), @@ -33833,6 +34300,7 @@ impl WriteXdr for ManageBuyOfferResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum SetOptionsResultCode { Success = 0, @@ -34000,6 +34468,7 @@ impl WriteXdr for SetOptionsResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum SetOptionsResult { Success, @@ -34187,6 +34656,7 @@ impl WriteXdr for SetOptionsResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ChangeTrustResultCode { Success = 0, @@ -34342,6 +34812,7 @@ impl WriteXdr for ChangeTrustResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ChangeTrustResult { Success, @@ -34513,6 +34984,7 @@ impl WriteXdr for ChangeTrustResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum AllowTrustResultCode { Success = 0, @@ -34656,6 +35128,7 @@ impl WriteXdr for AllowTrustResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum AllowTrustResult { Success, @@ -34811,6 +35284,7 @@ impl WriteXdr for AllowTrustResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum AccountMergeResultCode { Success = 0, @@ -34960,6 +35434,7 @@ impl WriteXdr for AccountMergeResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum AccountMergeResult { Success(i64), @@ -35115,6 +35590,7 @@ impl WriteXdr for AccountMergeResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum InflationResultCode { Success = 0, @@ -35220,6 +35696,7 @@ impl WriteXdr for InflationResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct InflationPayout { pub destination: AccountId, pub amount: i64, @@ -35268,6 +35745,7 @@ impl WriteXdr for InflationPayout { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum InflationResult { Success(VecM), @@ -35383,6 +35861,7 @@ impl WriteXdr for InflationResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ManageDataResultCode { Success = 0, @@ -35514,6 +35993,7 @@ impl WriteXdr for ManageDataResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ManageDataResult { Success, @@ -35648,6 +36128,7 @@ impl WriteXdr for ManageDataResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum BumpSequenceResultCode { Success = 0, @@ -35758,6 +36239,7 @@ impl WriteXdr for BumpSequenceResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum BumpSequenceResult { Success, @@ -35870,6 +36352,7 @@ impl WriteXdr for BumpSequenceResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum CreateClaimableBalanceResultCode { Success = 0, @@ -36008,6 +36491,7 @@ impl WriteXdr for CreateClaimableBalanceResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum CreateClaimableBalanceResult { Success(ClaimableBalanceId), @@ -36154,6 +36638,7 @@ impl WriteXdr for CreateClaimableBalanceResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClaimClaimableBalanceResultCode { Success = 0, @@ -36291,6 +36776,7 @@ impl WriteXdr for ClaimClaimableBalanceResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ClaimClaimableBalanceResult { Success, @@ -36436,6 +36922,7 @@ impl WriteXdr for ClaimClaimableBalanceResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum BeginSponsoringFutureReservesResultCode { Success = 0, @@ -36558,6 +37045,7 @@ impl WriteXdr for BeginSponsoringFutureReservesResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum BeginSponsoringFutureReservesResult { Success, @@ -36683,6 +37171,7 @@ impl WriteXdr for BeginSponsoringFutureReservesResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum EndSponsoringFutureReservesResultCode { Success = 0, @@ -36794,6 +37283,7 @@ impl WriteXdr for EndSponsoringFutureReservesResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum EndSponsoringFutureReservesResult { Success, @@ -36910,6 +37400,7 @@ impl WriteXdr for EndSponsoringFutureReservesResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum RevokeSponsorshipResultCode { Success = 0, @@ -37047,6 +37538,7 @@ impl WriteXdr for RevokeSponsorshipResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum RevokeSponsorshipResult { Success, @@ -37193,6 +37685,7 @@ impl WriteXdr for RevokeSponsorshipResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClawbackResultCode { Success = 0, @@ -37324,6 +37817,7 @@ impl WriteXdr for ClawbackResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ClawbackResult { Success, @@ -37461,6 +37955,7 @@ impl WriteXdr for ClawbackResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClawbackClaimableBalanceResultCode { Success = 0, @@ -37583,6 +38078,7 @@ impl WriteXdr for ClawbackClaimableBalanceResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ClawbackClaimableBalanceResult { Success, @@ -37713,6 +38209,7 @@ impl WriteXdr for ClawbackClaimableBalanceResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum SetTrustLineFlagsResultCode { Success = 0, @@ -37850,6 +38347,7 @@ impl WriteXdr for SetTrustLineFlagsResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum SetTrustLineFlagsResult { Success, @@ -38003,6 +38501,7 @@ impl WriteXdr for SetTrustLineFlagsResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum LiquidityPoolDepositResultCode { Success = 0, @@ -38152,6 +38651,7 @@ impl WriteXdr for LiquidityPoolDepositResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LiquidityPoolDepositResult { Success, @@ -38316,6 +38816,7 @@ impl WriteXdr for LiquidityPoolDepositResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum LiquidityPoolWithdrawResultCode { Success = 0, @@ -38453,6 +38954,7 @@ impl WriteXdr for LiquidityPoolWithdrawResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LiquidityPoolWithdrawResult { Success, @@ -38600,6 +39102,7 @@ impl WriteXdr for LiquidityPoolWithdrawResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum InvokeHostFunctionResultCode { Success = 0, @@ -38737,6 +39240,7 @@ impl WriteXdr for InvokeHostFunctionResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum InvokeHostFunctionResult { Success(Hash), @@ -38886,6 +39390,7 @@ impl WriteXdr for InvokeHostFunctionResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ExtendFootprintTtlResultCode { Success = 0, @@ -39011,6 +39516,7 @@ impl WriteXdr for ExtendFootprintTtlResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ExtendFootprintTtlResult { Success, @@ -39146,6 +39652,7 @@ impl WriteXdr for ExtendFootprintTtlResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum RestoreFootprintResultCode { Success = 0, @@ -39271,6 +39778,7 @@ impl WriteXdr for RestoreFootprintResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum RestoreFootprintResult { Success, @@ -39407,6 +39915,7 @@ impl WriteXdr for RestoreFootprintResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum OperationResultCode { OpInner = 0, @@ -39595,6 +40104,7 @@ impl WriteXdr for OperationResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum OperationResultTr { CreateAccount(CreateAccountResult), @@ -39983,6 +40493,7 @@ impl WriteXdr for OperationResultTr { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum OperationResult { OpInner(OperationResultTr), @@ -40150,6 +40661,7 @@ impl WriteXdr for OperationResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum TransactionResultCode { TxFeeBumpInnerSuccess = 1, @@ -40365,6 +40877,7 @@ impl WriteXdr for TransactionResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum InnerTransactionResultResult { TxSuccess(VecM), @@ -40585,6 +41098,7 @@ impl WriteXdr for InnerTransactionResultResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum InnerTransactionResultExt { V0, @@ -40718,6 +41232,7 @@ impl WriteXdr for InnerTransactionResultExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct InnerTransactionResult { pub fee_charged: i64, pub result: InnerTransactionResultResult, @@ -40766,6 +41281,7 @@ impl WriteXdr for InnerTransactionResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct InnerTransactionResultPair { pub transaction_hash: Hash, pub result: InnerTransactionResult, @@ -40833,6 +41349,7 @@ impl WriteXdr for InnerTransactionResultPair { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionResultResult { TxFeeBumpInnerSuccess(InnerTransactionResultPair), @@ -41071,6 +41588,7 @@ impl WriteXdr for TransactionResultResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionResultExt { V0, @@ -41205,6 +41723,7 @@ impl WriteXdr for TransactionResultExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionResult { pub fee_charged: i64, pub result: TransactionResultResult, @@ -41278,6 +41797,39 @@ impl core::str::FromStr for Hash { hex::decode(s).map_err(|_| Error::InvalidHex)?.try_into() } } +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for Hash { + fn schema_name() -> String { + "Hash".to_string() + } + + fn is_referenceable() -> bool { + false + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let schema = String::json_schema(gen); + if let schemars::schema::Schema::Object(mut schema) = schema { + schema.extensions.insert( + "contentEncoding".to_owned(), + serde_json::Value::String("hex".to_string()), + ); + schema.extensions.insert( + "contentMediaType".to_owned(), + serde_json::Value::String("application/binary".to_string()), + ); + let string = *schema.string.unwrap_or_default().clone(); + schema.string = Some(Box::new(schemars::schema::StringValidation { + max_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), + ..string + })); + schema.into() + } else { + schema + } + } +} impl From for [u8; 32] { #[must_use] fn from(x: Hash) -> Self { @@ -41396,6 +41948,39 @@ impl core::str::FromStr for Uint256 { hex::decode(s).map_err(|_| Error::InvalidHex)?.try_into() } } +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for Uint256 { + fn schema_name() -> String { + "Uint256".to_string() + } + + fn is_referenceable() -> bool { + false + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let schema = String::json_schema(gen); + if let schemars::schema::Schema::Object(mut schema) = schema { + schema.extensions.insert( + "contentEncoding".to_owned(), + serde_json::Value::String("hex".to_string()), + ); + schema.extensions.insert( + "contentMediaType".to_owned(), + serde_json::Value::String("application/binary".to_string()), + ); + let string = *schema.string.unwrap_or_default().clone(); + schema.string = Some(Box::new(schemars::schema::StringValidation { + max_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), + ..string + })); + schema.into() + } else { + schema + } + } +} impl From for [u8; 32] { #[must_use] fn from(x: Uint256) -> Self { @@ -41517,6 +42102,7 @@ pub type Int64 = i64; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct TimePoint(pub u64); @@ -41572,6 +42158,7 @@ impl WriteXdr for TimePoint { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct Duration(pub u64); @@ -41632,6 +42219,7 @@ impl WriteXdr for Duration { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ExtensionPoint { V0, @@ -41737,6 +42325,7 @@ impl WriteXdr for ExtensionPoint { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum CryptoKeyType { Ed25519 = 0, @@ -41862,6 +42451,7 @@ impl WriteXdr for CryptoKeyType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum PublicKeyType { PublicKeyTypeEd25519 = 0, @@ -41966,6 +42556,7 @@ impl WriteXdr for PublicKeyType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum SignerKeyType { Ed25519 = 0, @@ -42362,6 +42953,7 @@ impl WriteXdr for SignerKey { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct Signature(pub BytesM<64>); @@ -42495,6 +43087,39 @@ impl core::str::FromStr for SignatureHint { hex::decode(s).map_err(|_| Error::InvalidHex)?.try_into() } } +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for SignatureHint { + fn schema_name() -> String { + "SignatureHint".to_string() + } + + fn is_referenceable() -> bool { + false + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let schema = String::json_schema(gen); + if let schemars::schema::Schema::Object(mut schema) = schema { + schema.extensions.insert( + "contentEncoding".to_owned(), + serde_json::Value::String("hex".to_string()), + ); + schema.extensions.insert( + "contentMediaType".to_owned(), + serde_json::Value::String("application/binary".to_string()), + ); + let string = *schema.string.unwrap_or_default().clone(); + schema.string = Some(Box::new(schemars::schema::StringValidation { + max_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), + ..string + })); + schema.into() + } else { + schema + } + } +} impl From for [u8; 4] { #[must_use] fn from(x: SignatureHint) -> Self { @@ -42695,6 +43320,7 @@ impl WriteXdr for AccountId { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Curve25519Secret { pub key: [u8; 32], } @@ -42736,6 +43362,7 @@ impl WriteXdr for Curve25519Secret { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Curve25519Public { pub key: [u8; 32], } @@ -42777,6 +43404,7 @@ impl WriteXdr for Curve25519Public { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct HmacSha256Key { pub key: [u8; 32], } @@ -42818,6 +43446,7 @@ impl WriteXdr for HmacSha256Key { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct HmacSha256Mac { pub mac: [u8; 32], } @@ -42849,6 +43478,7 @@ impl WriteXdr for HmacSha256Mac { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub enum TypeVariant { Value, ScpBallot, @@ -44576,6 +45206,623 @@ impl TypeVariant { pub const fn variants() -> [TypeVariant; 425] { Self::VARIANTS } + + #[cfg(feature = "schemars")] + #[must_use] + #[allow(clippy::too_many_lines)] + pub fn json_schema(&self, gen: schemars::gen::SchemaGenerator) -> schemars::schema::RootSchema { + match self { + Self::Value => gen.into_root_schema_for::(), + Self::ScpBallot => gen.into_root_schema_for::(), + Self::ScpStatementType => gen.into_root_schema_for::(), + Self::ScpNomination => gen.into_root_schema_for::(), + Self::ScpStatement => gen.into_root_schema_for::(), + Self::ScpStatementPledges => gen.into_root_schema_for::(), + Self::ScpStatementPrepare => gen.into_root_schema_for::(), + Self::ScpStatementConfirm => gen.into_root_schema_for::(), + Self::ScpStatementExternalize => gen.into_root_schema_for::(), + Self::ScpEnvelope => gen.into_root_schema_for::(), + Self::ScpQuorumSet => gen.into_root_schema_for::(), + Self::ConfigSettingContractExecutionLanesV0 => { + gen.into_root_schema_for::() + } + Self::ConfigSettingContractComputeV0 => { + gen.into_root_schema_for::() + } + Self::ConfigSettingContractLedgerCostV0 => { + gen.into_root_schema_for::() + } + Self::ConfigSettingContractHistoricalDataV0 => { + gen.into_root_schema_for::() + } + Self::ConfigSettingContractEventsV0 => { + gen.into_root_schema_for::() + } + Self::ConfigSettingContractBandwidthV0 => { + gen.into_root_schema_for::() + } + Self::ContractCostType => gen.into_root_schema_for::(), + Self::ContractCostParamEntry => gen.into_root_schema_for::(), + Self::StateArchivalSettings => gen.into_root_schema_for::(), + Self::EvictionIterator => gen.into_root_schema_for::(), + Self::ContractCostParams => gen.into_root_schema_for::(), + Self::ConfigSettingId => gen.into_root_schema_for::(), + Self::ConfigSettingEntry => gen.into_root_schema_for::(), + Self::ScEnvMetaKind => gen.into_root_schema_for::(), + Self::ScEnvMetaEntry => gen.into_root_schema_for::(), + Self::ScMetaV0 => gen.into_root_schema_for::(), + Self::ScMetaKind => gen.into_root_schema_for::(), + Self::ScMetaEntry => gen.into_root_schema_for::(), + Self::ScSpecType => gen.into_root_schema_for::(), + Self::ScSpecTypeOption => gen.into_root_schema_for::(), + Self::ScSpecTypeResult => gen.into_root_schema_for::(), + Self::ScSpecTypeVec => gen.into_root_schema_for::(), + Self::ScSpecTypeMap => gen.into_root_schema_for::(), + Self::ScSpecTypeTuple => gen.into_root_schema_for::(), + Self::ScSpecTypeBytesN => gen.into_root_schema_for::(), + Self::ScSpecTypeUdt => gen.into_root_schema_for::(), + Self::ScSpecTypeDef => gen.into_root_schema_for::(), + Self::ScSpecUdtStructFieldV0 => gen.into_root_schema_for::(), + Self::ScSpecUdtStructV0 => gen.into_root_schema_for::(), + Self::ScSpecUdtUnionCaseVoidV0 => { + gen.into_root_schema_for::() + } + Self::ScSpecUdtUnionCaseTupleV0 => { + gen.into_root_schema_for::() + } + Self::ScSpecUdtUnionCaseV0Kind => { + gen.into_root_schema_for::() + } + Self::ScSpecUdtUnionCaseV0 => gen.into_root_schema_for::(), + Self::ScSpecUdtUnionV0 => gen.into_root_schema_for::(), + Self::ScSpecUdtEnumCaseV0 => gen.into_root_schema_for::(), + Self::ScSpecUdtEnumV0 => gen.into_root_schema_for::(), + Self::ScSpecUdtErrorEnumCaseV0 => { + gen.into_root_schema_for::() + } + Self::ScSpecUdtErrorEnumV0 => gen.into_root_schema_for::(), + Self::ScSpecFunctionInputV0 => gen.into_root_schema_for::(), + Self::ScSpecFunctionV0 => gen.into_root_schema_for::(), + Self::ScSpecEntryKind => gen.into_root_schema_for::(), + Self::ScSpecEntry => gen.into_root_schema_for::(), + Self::ScValType => gen.into_root_schema_for::(), + Self::ScErrorType => gen.into_root_schema_for::(), + Self::ScErrorCode => gen.into_root_schema_for::(), + Self::ScError => gen.into_root_schema_for::(), + Self::UInt128Parts => gen.into_root_schema_for::(), + Self::Int128Parts => gen.into_root_schema_for::(), + Self::UInt256Parts => gen.into_root_schema_for::(), + Self::Int256Parts => gen.into_root_schema_for::(), + Self::ContractExecutableType => gen.into_root_schema_for::(), + Self::ContractExecutable => gen.into_root_schema_for::(), + Self::ScAddressType => gen.into_root_schema_for::(), + Self::ScAddress => gen.into_root_schema_for::(), + Self::ScVec => gen.into_root_schema_for::(), + Self::ScMap => gen.into_root_schema_for::(), + Self::ScBytes => gen.into_root_schema_for::(), + Self::ScString => gen.into_root_schema_for::(), + Self::ScSymbol => gen.into_root_schema_for::(), + Self::ScNonceKey => gen.into_root_schema_for::(), + Self::ScContractInstance => gen.into_root_schema_for::(), + Self::ScVal => gen.into_root_schema_for::(), + Self::ScMapEntry => gen.into_root_schema_for::(), + Self::StoredTransactionSet => gen.into_root_schema_for::(), + Self::StoredDebugTransactionSet => { + gen.into_root_schema_for::() + } + Self::PersistedScpStateV0 => gen.into_root_schema_for::(), + Self::PersistedScpStateV1 => gen.into_root_schema_for::(), + Self::PersistedScpState => gen.into_root_schema_for::(), + Self::Thresholds => gen.into_root_schema_for::(), + Self::String32 => gen.into_root_schema_for::(), + Self::String64 => gen.into_root_schema_for::(), + Self::SequenceNumber => gen.into_root_schema_for::(), + Self::DataValue => gen.into_root_schema_for::(), + Self::PoolId => gen.into_root_schema_for::(), + Self::AssetCode4 => gen.into_root_schema_for::(), + Self::AssetCode12 => gen.into_root_schema_for::(), + Self::AssetType => gen.into_root_schema_for::(), + Self::AssetCode => gen.into_root_schema_for::(), + Self::AlphaNum4 => gen.into_root_schema_for::(), + Self::AlphaNum12 => gen.into_root_schema_for::(), + Self::Asset => gen.into_root_schema_for::(), + Self::Price => gen.into_root_schema_for::(), + Self::Liabilities => gen.into_root_schema_for::(), + Self::ThresholdIndexes => gen.into_root_schema_for::(), + Self::LedgerEntryType => gen.into_root_schema_for::(), + Self::Signer => gen.into_root_schema_for::(), + Self::AccountFlags => gen.into_root_schema_for::(), + Self::SponsorshipDescriptor => gen.into_root_schema_for::(), + Self::AccountEntryExtensionV3 => gen.into_root_schema_for::(), + Self::AccountEntryExtensionV2 => gen.into_root_schema_for::(), + Self::AccountEntryExtensionV2Ext => { + gen.into_root_schema_for::() + } + Self::AccountEntryExtensionV1 => gen.into_root_schema_for::(), + Self::AccountEntryExtensionV1Ext => { + gen.into_root_schema_for::() + } + Self::AccountEntry => gen.into_root_schema_for::(), + Self::AccountEntryExt => gen.into_root_schema_for::(), + Self::TrustLineFlags => gen.into_root_schema_for::(), + Self::LiquidityPoolType => gen.into_root_schema_for::(), + Self::TrustLineAsset => gen.into_root_schema_for::(), + Self::TrustLineEntryExtensionV2 => { + gen.into_root_schema_for::() + } + Self::TrustLineEntryExtensionV2Ext => { + gen.into_root_schema_for::() + } + Self::TrustLineEntry => gen.into_root_schema_for::(), + Self::TrustLineEntryExt => gen.into_root_schema_for::(), + Self::TrustLineEntryV1 => gen.into_root_schema_for::(), + Self::TrustLineEntryV1Ext => gen.into_root_schema_for::(), + Self::OfferEntryFlags => gen.into_root_schema_for::(), + Self::OfferEntry => gen.into_root_schema_for::(), + Self::OfferEntryExt => gen.into_root_schema_for::(), + Self::DataEntry => gen.into_root_schema_for::(), + Self::DataEntryExt => gen.into_root_schema_for::(), + Self::ClaimPredicateType => gen.into_root_schema_for::(), + Self::ClaimPredicate => gen.into_root_schema_for::(), + Self::ClaimantType => gen.into_root_schema_for::(), + Self::Claimant => gen.into_root_schema_for::(), + Self::ClaimantV0 => gen.into_root_schema_for::(), + Self::ClaimableBalanceIdType => gen.into_root_schema_for::(), + Self::ClaimableBalanceId => gen.into_root_schema_for::(), + Self::ClaimableBalanceFlags => gen.into_root_schema_for::(), + Self::ClaimableBalanceEntryExtensionV1 => { + gen.into_root_schema_for::() + } + Self::ClaimableBalanceEntryExtensionV1Ext => { + gen.into_root_schema_for::() + } + Self::ClaimableBalanceEntry => gen.into_root_schema_for::(), + Self::ClaimableBalanceEntryExt => { + gen.into_root_schema_for::() + } + Self::LiquidityPoolConstantProductParameters => { + gen.into_root_schema_for::() + } + Self::LiquidityPoolEntry => gen.into_root_schema_for::(), + Self::LiquidityPoolEntryBody => gen.into_root_schema_for::(), + Self::LiquidityPoolEntryConstantProduct => { + gen.into_root_schema_for::() + } + Self::ContractDataDurability => gen.into_root_schema_for::(), + Self::ContractDataEntry => gen.into_root_schema_for::(), + Self::ContractCodeCostInputs => gen.into_root_schema_for::(), + Self::ContractCodeEntry => gen.into_root_schema_for::(), + Self::ContractCodeEntryExt => gen.into_root_schema_for::(), + Self::ContractCodeEntryV1 => gen.into_root_schema_for::(), + Self::TtlEntry => gen.into_root_schema_for::(), + Self::LedgerEntryExtensionV1 => gen.into_root_schema_for::(), + Self::LedgerEntryExtensionV1Ext => { + gen.into_root_schema_for::() + } + Self::LedgerEntry => gen.into_root_schema_for::(), + Self::LedgerEntryData => gen.into_root_schema_for::(), + Self::LedgerEntryExt => gen.into_root_schema_for::(), + Self::LedgerKey => gen.into_root_schema_for::(), + Self::LedgerKeyAccount => gen.into_root_schema_for::(), + Self::LedgerKeyTrustLine => gen.into_root_schema_for::(), + Self::LedgerKeyOffer => gen.into_root_schema_for::(), + Self::LedgerKeyData => gen.into_root_schema_for::(), + Self::LedgerKeyClaimableBalance => { + gen.into_root_schema_for::() + } + Self::LedgerKeyLiquidityPool => gen.into_root_schema_for::(), + Self::LedgerKeyContractData => gen.into_root_schema_for::(), + Self::LedgerKeyContractCode => gen.into_root_schema_for::(), + Self::LedgerKeyConfigSetting => gen.into_root_schema_for::(), + Self::LedgerKeyTtl => gen.into_root_schema_for::(), + Self::EnvelopeType => gen.into_root_schema_for::(), + Self::UpgradeType => gen.into_root_schema_for::(), + Self::StellarValueType => gen.into_root_schema_for::(), + Self::LedgerCloseValueSignature => { + gen.into_root_schema_for::() + } + Self::StellarValue => gen.into_root_schema_for::(), + Self::StellarValueExt => gen.into_root_schema_for::(), + Self::LedgerHeaderFlags => gen.into_root_schema_for::(), + Self::LedgerHeaderExtensionV1 => gen.into_root_schema_for::(), + Self::LedgerHeaderExtensionV1Ext => { + gen.into_root_schema_for::() + } + Self::LedgerHeader => gen.into_root_schema_for::(), + Self::LedgerHeaderExt => gen.into_root_schema_for::(), + Self::LedgerUpgradeType => gen.into_root_schema_for::(), + Self::ConfigUpgradeSetKey => gen.into_root_schema_for::(), + Self::LedgerUpgrade => gen.into_root_schema_for::(), + Self::ConfigUpgradeSet => gen.into_root_schema_for::(), + Self::BucketEntryType => gen.into_root_schema_for::(), + Self::BucketMetadata => gen.into_root_schema_for::(), + Self::BucketMetadataExt => gen.into_root_schema_for::(), + Self::BucketEntry => gen.into_root_schema_for::(), + Self::TxSetComponentType => gen.into_root_schema_for::(), + Self::TxSetComponent => gen.into_root_schema_for::(), + Self::TxSetComponentTxsMaybeDiscountedFee => { + gen.into_root_schema_for::() + } + Self::TransactionPhase => gen.into_root_schema_for::(), + Self::TransactionSet => gen.into_root_schema_for::(), + Self::TransactionSetV1 => gen.into_root_schema_for::(), + Self::GeneralizedTransactionSet => { + gen.into_root_schema_for::() + } + Self::TransactionResultPair => gen.into_root_schema_for::(), + Self::TransactionResultSet => gen.into_root_schema_for::(), + Self::TransactionHistoryEntry => gen.into_root_schema_for::(), + Self::TransactionHistoryEntryExt => { + gen.into_root_schema_for::() + } + Self::TransactionHistoryResultEntry => { + gen.into_root_schema_for::() + } + Self::TransactionHistoryResultEntryExt => { + gen.into_root_schema_for::() + } + Self::LedgerHeaderHistoryEntry => { + gen.into_root_schema_for::() + } + Self::LedgerHeaderHistoryEntryExt => { + gen.into_root_schema_for::() + } + Self::LedgerScpMessages => gen.into_root_schema_for::(), + Self::ScpHistoryEntryV0 => gen.into_root_schema_for::(), + Self::ScpHistoryEntry => gen.into_root_schema_for::(), + Self::LedgerEntryChangeType => gen.into_root_schema_for::(), + Self::LedgerEntryChange => gen.into_root_schema_for::(), + Self::LedgerEntryChanges => gen.into_root_schema_for::(), + Self::OperationMeta => gen.into_root_schema_for::(), + Self::TransactionMetaV1 => gen.into_root_schema_for::(), + Self::TransactionMetaV2 => gen.into_root_schema_for::(), + Self::ContractEventType => gen.into_root_schema_for::(), + Self::ContractEvent => gen.into_root_schema_for::(), + Self::ContractEventBody => gen.into_root_schema_for::(), + Self::ContractEventV0 => gen.into_root_schema_for::(), + Self::DiagnosticEvent => gen.into_root_schema_for::(), + Self::SorobanTransactionMetaExtV1 => { + gen.into_root_schema_for::() + } + Self::SorobanTransactionMetaExt => { + gen.into_root_schema_for::() + } + Self::SorobanTransactionMeta => gen.into_root_schema_for::(), + Self::TransactionMetaV3 => gen.into_root_schema_for::(), + Self::InvokeHostFunctionSuccessPreImage => { + gen.into_root_schema_for::() + } + Self::TransactionMeta => gen.into_root_schema_for::(), + Self::TransactionResultMeta => gen.into_root_schema_for::(), + Self::UpgradeEntryMeta => gen.into_root_schema_for::(), + Self::LedgerCloseMetaV0 => gen.into_root_schema_for::(), + Self::LedgerCloseMetaExtV1 => gen.into_root_schema_for::(), + Self::LedgerCloseMetaExt => gen.into_root_schema_for::(), + Self::LedgerCloseMetaV1 => gen.into_root_schema_for::(), + Self::LedgerCloseMeta => gen.into_root_schema_for::(), + Self::ErrorCode => gen.into_root_schema_for::(), + Self::SError => gen.into_root_schema_for::(), + Self::SendMore => gen.into_root_schema_for::(), + Self::SendMoreExtended => gen.into_root_schema_for::(), + Self::AuthCert => gen.into_root_schema_for::(), + Self::Hello => gen.into_root_schema_for::(), + Self::Auth => gen.into_root_schema_for::(), + Self::IpAddrType => gen.into_root_schema_for::(), + Self::PeerAddress => gen.into_root_schema_for::(), + Self::PeerAddressIp => gen.into_root_schema_for::(), + Self::MessageType => gen.into_root_schema_for::(), + Self::DontHave => gen.into_root_schema_for::(), + Self::SurveyMessageCommandType => { + gen.into_root_schema_for::() + } + Self::SurveyMessageResponseType => { + gen.into_root_schema_for::() + } + Self::SurveyRequestMessage => gen.into_root_schema_for::(), + Self::SignedSurveyRequestMessage => { + gen.into_root_schema_for::() + } + Self::EncryptedBody => gen.into_root_schema_for::(), + Self::SurveyResponseMessage => gen.into_root_schema_for::(), + Self::SignedSurveyResponseMessage => { + gen.into_root_schema_for::() + } + Self::PeerStats => gen.into_root_schema_for::(), + Self::PeerStatList => gen.into_root_schema_for::(), + Self::TopologyResponseBodyV0 => gen.into_root_schema_for::(), + Self::TopologyResponseBodyV1 => gen.into_root_schema_for::(), + Self::SurveyResponseBody => gen.into_root_schema_for::(), + Self::TxAdvertVector => gen.into_root_schema_for::(), + Self::FloodAdvert => gen.into_root_schema_for::(), + Self::TxDemandVector => gen.into_root_schema_for::(), + Self::FloodDemand => gen.into_root_schema_for::(), + Self::StellarMessage => gen.into_root_schema_for::(), + Self::AuthenticatedMessage => gen.into_root_schema_for::(), + Self::AuthenticatedMessageV0 => gen.into_root_schema_for::(), + Self::LiquidityPoolParameters => gen.into_root_schema_for::(), + Self::MuxedAccount => gen.into_root_schema_for::(), + Self::MuxedAccountMed25519 => gen.into_root_schema_for::(), + Self::DecoratedSignature => gen.into_root_schema_for::(), + Self::OperationType => gen.into_root_schema_for::(), + Self::CreateAccountOp => gen.into_root_schema_for::(), + Self::PaymentOp => gen.into_root_schema_for::(), + Self::PathPaymentStrictReceiveOp => { + gen.into_root_schema_for::() + } + Self::PathPaymentStrictSendOp => gen.into_root_schema_for::(), + Self::ManageSellOfferOp => gen.into_root_schema_for::(), + Self::ManageBuyOfferOp => gen.into_root_schema_for::(), + Self::CreatePassiveSellOfferOp => { + gen.into_root_schema_for::() + } + Self::SetOptionsOp => gen.into_root_schema_for::(), + Self::ChangeTrustAsset => gen.into_root_schema_for::(), + Self::ChangeTrustOp => gen.into_root_schema_for::(), + Self::AllowTrustOp => gen.into_root_schema_for::(), + Self::ManageDataOp => gen.into_root_schema_for::(), + Self::BumpSequenceOp => gen.into_root_schema_for::(), + Self::CreateClaimableBalanceOp => { + gen.into_root_schema_for::() + } + Self::ClaimClaimableBalanceOp => gen.into_root_schema_for::(), + Self::BeginSponsoringFutureReservesOp => { + gen.into_root_schema_for::() + } + Self::RevokeSponsorshipType => gen.into_root_schema_for::(), + Self::RevokeSponsorshipOp => gen.into_root_schema_for::(), + Self::RevokeSponsorshipOpSigner => { + gen.into_root_schema_for::() + } + Self::ClawbackOp => gen.into_root_schema_for::(), + Self::ClawbackClaimableBalanceOp => { + gen.into_root_schema_for::() + } + Self::SetTrustLineFlagsOp => gen.into_root_schema_for::(), + Self::LiquidityPoolDepositOp => gen.into_root_schema_for::(), + Self::LiquidityPoolWithdrawOp => gen.into_root_schema_for::(), + Self::HostFunctionType => gen.into_root_schema_for::(), + Self::ContractIdPreimageType => gen.into_root_schema_for::(), + Self::ContractIdPreimage => gen.into_root_schema_for::(), + Self::ContractIdPreimageFromAddress => { + gen.into_root_schema_for::() + } + Self::CreateContractArgs => gen.into_root_schema_for::(), + Self::InvokeContractArgs => gen.into_root_schema_for::(), + Self::HostFunction => gen.into_root_schema_for::(), + Self::SorobanAuthorizedFunctionType => { + gen.into_root_schema_for::() + } + Self::SorobanAuthorizedFunction => { + gen.into_root_schema_for::() + } + Self::SorobanAuthorizedInvocation => { + gen.into_root_schema_for::() + } + Self::SorobanAddressCredentials => { + gen.into_root_schema_for::() + } + Self::SorobanCredentialsType => gen.into_root_schema_for::(), + Self::SorobanCredentials => gen.into_root_schema_for::(), + Self::SorobanAuthorizationEntry => { + gen.into_root_schema_for::() + } + Self::InvokeHostFunctionOp => gen.into_root_schema_for::(), + Self::ExtendFootprintTtlOp => gen.into_root_schema_for::(), + Self::RestoreFootprintOp => gen.into_root_schema_for::(), + Self::Operation => gen.into_root_schema_for::(), + Self::OperationBody => gen.into_root_schema_for::(), + Self::HashIdPreimage => gen.into_root_schema_for::(), + Self::HashIdPreimageOperationId => { + gen.into_root_schema_for::() + } + Self::HashIdPreimageRevokeId => gen.into_root_schema_for::(), + Self::HashIdPreimageContractId => { + gen.into_root_schema_for::() + } + Self::HashIdPreimageSorobanAuthorization => { + gen.into_root_schema_for::() + } + Self::MemoType => gen.into_root_schema_for::(), + Self::Memo => gen.into_root_schema_for::(), + Self::TimeBounds => gen.into_root_schema_for::(), + Self::LedgerBounds => gen.into_root_schema_for::(), + Self::PreconditionsV2 => gen.into_root_schema_for::(), + Self::PreconditionType => gen.into_root_schema_for::(), + Self::Preconditions => gen.into_root_schema_for::(), + Self::LedgerFootprint => gen.into_root_schema_for::(), + Self::SorobanResources => gen.into_root_schema_for::(), + Self::SorobanTransactionData => gen.into_root_schema_for::(), + Self::TransactionV0 => gen.into_root_schema_for::(), + Self::TransactionV0Ext => gen.into_root_schema_for::(), + Self::TransactionV0Envelope => gen.into_root_schema_for::(), + Self::Transaction => gen.into_root_schema_for::(), + Self::TransactionExt => gen.into_root_schema_for::(), + Self::TransactionV1Envelope => gen.into_root_schema_for::(), + Self::FeeBumpTransaction => gen.into_root_schema_for::(), + Self::FeeBumpTransactionInnerTx => { + gen.into_root_schema_for::() + } + Self::FeeBumpTransactionExt => gen.into_root_schema_for::(), + Self::FeeBumpTransactionEnvelope => { + gen.into_root_schema_for::() + } + Self::TransactionEnvelope => gen.into_root_schema_for::(), + Self::TransactionSignaturePayload => { + gen.into_root_schema_for::() + } + Self::TransactionSignaturePayloadTaggedTransaction => { + gen.into_root_schema_for::() + } + Self::ClaimAtomType => gen.into_root_schema_for::(), + Self::ClaimOfferAtomV0 => gen.into_root_schema_for::(), + Self::ClaimOfferAtom => gen.into_root_schema_for::(), + Self::ClaimLiquidityAtom => gen.into_root_schema_for::(), + Self::ClaimAtom => gen.into_root_schema_for::(), + Self::CreateAccountResultCode => gen.into_root_schema_for::(), + Self::CreateAccountResult => gen.into_root_schema_for::(), + Self::PaymentResultCode => gen.into_root_schema_for::(), + Self::PaymentResult => gen.into_root_schema_for::(), + Self::PathPaymentStrictReceiveResultCode => { + gen.into_root_schema_for::() + } + Self::SimplePaymentResult => gen.into_root_schema_for::(), + Self::PathPaymentStrictReceiveResult => { + gen.into_root_schema_for::() + } + Self::PathPaymentStrictReceiveResultSuccess => { + gen.into_root_schema_for::() + } + Self::PathPaymentStrictSendResultCode => { + gen.into_root_schema_for::() + } + Self::PathPaymentStrictSendResult => { + gen.into_root_schema_for::() + } + Self::PathPaymentStrictSendResultSuccess => { + gen.into_root_schema_for::() + } + Self::ManageSellOfferResultCode => { + gen.into_root_schema_for::() + } + Self::ManageOfferEffect => gen.into_root_schema_for::(), + Self::ManageOfferSuccessResult => { + gen.into_root_schema_for::() + } + Self::ManageOfferSuccessResultOffer => { + gen.into_root_schema_for::() + } + Self::ManageSellOfferResult => gen.into_root_schema_for::(), + Self::ManageBuyOfferResultCode => { + gen.into_root_schema_for::() + } + Self::ManageBuyOfferResult => gen.into_root_schema_for::(), + Self::SetOptionsResultCode => gen.into_root_schema_for::(), + Self::SetOptionsResult => gen.into_root_schema_for::(), + Self::ChangeTrustResultCode => gen.into_root_schema_for::(), + Self::ChangeTrustResult => gen.into_root_schema_for::(), + Self::AllowTrustResultCode => gen.into_root_schema_for::(), + Self::AllowTrustResult => gen.into_root_schema_for::(), + Self::AccountMergeResultCode => gen.into_root_schema_for::(), + Self::AccountMergeResult => gen.into_root_schema_for::(), + Self::InflationResultCode => gen.into_root_schema_for::(), + Self::InflationPayout => gen.into_root_schema_for::(), + Self::InflationResult => gen.into_root_schema_for::(), + Self::ManageDataResultCode => gen.into_root_schema_for::(), + Self::ManageDataResult => gen.into_root_schema_for::(), + Self::BumpSequenceResultCode => gen.into_root_schema_for::(), + Self::BumpSequenceResult => gen.into_root_schema_for::(), + Self::CreateClaimableBalanceResultCode => { + gen.into_root_schema_for::() + } + Self::CreateClaimableBalanceResult => { + gen.into_root_schema_for::() + } + Self::ClaimClaimableBalanceResultCode => { + gen.into_root_schema_for::() + } + Self::ClaimClaimableBalanceResult => { + gen.into_root_schema_for::() + } + Self::BeginSponsoringFutureReservesResultCode => { + gen.into_root_schema_for::() + } + Self::BeginSponsoringFutureReservesResult => { + gen.into_root_schema_for::() + } + Self::EndSponsoringFutureReservesResultCode => { + gen.into_root_schema_for::() + } + Self::EndSponsoringFutureReservesResult => { + gen.into_root_schema_for::() + } + Self::RevokeSponsorshipResultCode => { + gen.into_root_schema_for::() + } + Self::RevokeSponsorshipResult => gen.into_root_schema_for::(), + Self::ClawbackResultCode => gen.into_root_schema_for::(), + Self::ClawbackResult => gen.into_root_schema_for::(), + Self::ClawbackClaimableBalanceResultCode => { + gen.into_root_schema_for::() + } + Self::ClawbackClaimableBalanceResult => { + gen.into_root_schema_for::() + } + Self::SetTrustLineFlagsResultCode => { + gen.into_root_schema_for::() + } + Self::SetTrustLineFlagsResult => gen.into_root_schema_for::(), + Self::LiquidityPoolDepositResultCode => { + gen.into_root_schema_for::() + } + Self::LiquidityPoolDepositResult => { + gen.into_root_schema_for::() + } + Self::LiquidityPoolWithdrawResultCode => { + gen.into_root_schema_for::() + } + Self::LiquidityPoolWithdrawResult => { + gen.into_root_schema_for::() + } + Self::InvokeHostFunctionResultCode => { + gen.into_root_schema_for::() + } + Self::InvokeHostFunctionResult => { + gen.into_root_schema_for::() + } + Self::ExtendFootprintTtlResultCode => { + gen.into_root_schema_for::() + } + Self::ExtendFootprintTtlResult => { + gen.into_root_schema_for::() + } + Self::RestoreFootprintResultCode => { + gen.into_root_schema_for::() + } + Self::RestoreFootprintResult => gen.into_root_schema_for::(), + Self::OperationResultCode => gen.into_root_schema_for::(), + Self::OperationResult => gen.into_root_schema_for::(), + Self::OperationResultTr => gen.into_root_schema_for::(), + Self::TransactionResultCode => gen.into_root_schema_for::(), + Self::InnerTransactionResult => gen.into_root_schema_for::(), + Self::InnerTransactionResultResult => { + gen.into_root_schema_for::() + } + Self::InnerTransactionResultExt => { + gen.into_root_schema_for::() + } + Self::InnerTransactionResultPair => { + gen.into_root_schema_for::() + } + Self::TransactionResult => gen.into_root_schema_for::(), + Self::TransactionResultResult => gen.into_root_schema_for::(), + Self::TransactionResultExt => gen.into_root_schema_for::(), + Self::Hash => gen.into_root_schema_for::(), + Self::Uint256 => gen.into_root_schema_for::(), + Self::Uint32 => gen.into_root_schema_for::(), + Self::Int32 => gen.into_root_schema_for::(), + Self::Uint64 => gen.into_root_schema_for::(), + Self::Int64 => gen.into_root_schema_for::(), + Self::TimePoint => gen.into_root_schema_for::(), + Self::Duration => gen.into_root_schema_for::(), + Self::ExtensionPoint => gen.into_root_schema_for::(), + Self::CryptoKeyType => gen.into_root_schema_for::(), + Self::PublicKeyType => gen.into_root_schema_for::(), + Self::SignerKeyType => gen.into_root_schema_for::(), + Self::PublicKey => gen.into_root_schema_for::(), + Self::SignerKey => gen.into_root_schema_for::(), + Self::SignerKeyEd25519SignedPayload => { + gen.into_root_schema_for::() + } + Self::Signature => gen.into_root_schema_for::(), + Self::SignatureHint => gen.into_root_schema_for::(), + Self::NodeId => gen.into_root_schema_for::(), + Self::AccountId => gen.into_root_schema_for::(), + Self::Curve25519Secret => gen.into_root_schema_for::(), + Self::Curve25519Public => gen.into_root_schema_for::(), + Self::HmacSha256Key => gen.into_root_schema_for::(), + Self::HmacSha256Mac => gen.into_root_schema_for::(), + } + } } impl Name for TypeVariant { @@ -45047,6 +46294,7 @@ impl core::str::FromStr for TypeVariant { serde(rename_all = "snake_case"), serde(untagged) )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub enum Type { Value(Box), ScpBallot(Box), diff --git a/src/curr/jsonschema.rs b/src/curr/jsonschema.rs new file mode 100644 index 00000000..b70c3035 --- /dev/null +++ b/src/curr/jsonschema.rs @@ -0,0 +1,29 @@ +#![cfg(feature = "schemars")] +use schemars::{gen::SchemaGenerator, schema::Schema, JsonSchema}; + +macro_rules! impl_json_schema_string { + ($type:ident) => { + impl JsonSchema for super::$type { + fn schema_name() -> String { + stringify!($type).to_string() + } + + fn json_schema(gen: &mut SchemaGenerator) -> Schema { + String::json_schema(gen) + } + } + }; +} + +impl_json_schema_string!(PublicKey); +impl_json_schema_string!(AccountId); +impl_json_schema_string!(MuxedAccount); +impl_json_schema_string!(MuxedAccountMed25519); +impl_json_schema_string!(SignerKey); +impl_json_schema_string!(SignerKeyEd25519SignedPayload); +impl_json_schema_string!(NodeId); +impl_json_schema_string!(ScAddress); +impl_json_schema_string!(AssetCode); +impl_json_schema_string!(AssetCode4); +impl_json_schema_string!(AssetCode12); +impl_json_schema_string!(ClaimableBalanceId); diff --git a/src/curr/mod.rs b/src/curr/mod.rs index 288c1e2e..ec2f1e37 100644 --- a/src/curr/mod.rs +++ b/src/curr/mod.rs @@ -1,6 +1,7 @@ mod generated; pub use generated::*; +mod jsonschema; mod str; mod scval_conversions; diff --git a/src/next/generated.rs b/src/next/generated.rs index 75ae9973..2a6cdd3b 100644 --- a/src/next/generated.rs +++ b/src/next/generated.rs @@ -956,6 +956,32 @@ impl Default for VecM { } } +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for VecM { + fn schema_name() -> String { + format!("VecM<{}, {}>", T::schema_name(), MAX) + } + + fn is_referenceable() -> bool { + false + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let schema = Vec::::json_schema(gen); + if let schemars::schema::Schema::Object(mut schema) = schema { + if let Some(array) = schema.array.clone() { + schema.array = Some(Box::new(schemars::schema::ArrayValidation { + max_items: Some(MAX), + ..*array + })); + } + schema.into() + } else { + schema + } + } +} + impl VecM { pub const MAX_LEN: usize = { MAX as usize }; @@ -1391,6 +1417,40 @@ impl Deref for BytesM { } } +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for BytesM { + fn schema_name() -> String { + format!("BytesM<{MAX}>") + } + + fn is_referenceable() -> bool { + false + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let schema = String::json_schema(gen); + if let schemars::schema::Schema::Object(mut schema) = schema { + schema.extensions.insert( + "contentEncoding".to_owned(), + serde_json::Value::String("hex".to_string()), + ); + schema.extensions.insert( + "contentMediaType".to_owned(), + serde_json::Value::String("application/binary".to_string()), + ); + let string = *schema.string.unwrap_or_default().clone(); + schema.string = Some(Box::new(schemars::schema::StringValidation { + max_length: MAX.checked_mul(2).map(Some).unwrap_or_default(), + min_length: None, + ..string + })); + schema.into() + } else { + schema + } + } +} + impl Default for BytesM { fn default() -> Self { Self(Vec::default()) @@ -1779,6 +1839,27 @@ impl Default for StringM { } } +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for StringM { + fn schema_name() -> String { + format!("StringM<{MAX}>") + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let schema = String::json_schema(gen); + if let schemars::schema::Schema::Object(mut schema) = schema { + let string = *schema.string.unwrap_or_default().clone(); + schema.string = Some(Box::new(schemars::schema::StringValidation { + max_length: Some(MAX), + ..string + })); + schema.into() + } else { + schema + } + } +} + impl StringM { pub const MAX_LEN: usize = { MAX as usize }; @@ -2095,6 +2176,17 @@ pub struct Frame(pub T) where T: ReadXdr; +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for Frame { + fn schema_name() -> String { + format!("Frame<{}>", T::schema_name()) + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + T::json_schema(gen) + } +} + impl ReadXdr for Frame where T: ReadXdr, @@ -2758,6 +2850,7 @@ mod test { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct Value(pub BytesM); @@ -2866,6 +2959,7 @@ impl AsRef<[u8]> for Value { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpBallot { pub counter: u32, pub value: Value, @@ -2914,6 +3008,7 @@ impl WriteXdr for ScpBallot { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScpStatementType { Prepare = 0, @@ -3030,6 +3125,7 @@ impl WriteXdr for ScpStatementType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpNomination { pub quorum_set_hash: Hash, pub votes: VecM, @@ -3082,6 +3178,7 @@ impl WriteXdr for ScpNomination { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpStatementPrepare { pub quorum_set_hash: Hash, pub ballot: ScpBallot, @@ -3142,6 +3239,7 @@ impl WriteXdr for ScpStatementPrepare { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpStatementConfirm { pub ballot: ScpBallot, pub n_prepared: u32, @@ -3197,6 +3295,7 @@ impl WriteXdr for ScpStatementConfirm { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpStatementExternalize { pub commit: ScpBallot, pub n_h: u32, @@ -3272,6 +3371,7 @@ impl WriteXdr for ScpStatementExternalize { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScpStatementPledges { Prepare(ScpStatementPrepare), @@ -3426,6 +3526,7 @@ impl WriteXdr for ScpStatementPledges { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpStatement { pub node_id: NodeId, pub slot_index: u64, @@ -3474,6 +3575,7 @@ impl WriteXdr for ScpStatement { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpEnvelope { pub statement: ScpStatement, pub signature: Signature, @@ -3520,6 +3622,7 @@ impl WriteXdr for ScpEnvelope { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpQuorumSet { pub threshold: u32, pub validators: VecM, @@ -3568,6 +3671,7 @@ impl WriteXdr for ScpQuorumSet { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigSettingContractExecutionLanesV0 { pub ledger_max_tx_count: u32, } @@ -3618,6 +3722,7 @@ impl WriteXdr for ConfigSettingContractExecutionLanesV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigSettingContractComputeV0 { pub ledger_max_instructions: i64, pub tx_max_instructions: i64, @@ -3699,6 +3804,7 @@ impl WriteXdr for ConfigSettingContractComputeV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigSettingContractLedgerCostV0 { pub ledger_max_read_ledger_entries: u32, pub ledger_max_read_bytes: u32, @@ -3782,6 +3888,7 @@ impl WriteXdr for ConfigSettingContractLedgerCostV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigSettingContractHistoricalDataV0 { pub fee_historical1_kb: i64, } @@ -3826,6 +3933,7 @@ impl WriteXdr for ConfigSettingContractHistoricalDataV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigSettingContractEventsV0 { pub tx_max_contract_events_size_bytes: u32, pub fee_contract_events1_kb: i64, @@ -3876,6 +3984,7 @@ impl WriteXdr for ConfigSettingContractEventsV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigSettingContractBandwidthV0 { pub ledger_max_txs_size_bytes: u32, pub tx_max_size_bytes: u32, @@ -4021,6 +4130,7 @@ impl WriteXdr for ConfigSettingContractBandwidthV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ContractCostType { WasmInsnExec = 0, @@ -4348,6 +4458,7 @@ impl WriteXdr for ContractCostType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractCostParamEntry { pub ext: ExtensionPoint, pub const_term: i64, @@ -4415,6 +4526,7 @@ impl WriteXdr for ContractCostParamEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct StateArchivalSettings { pub max_entry_ttl: u32, pub min_temporary_ttl: u32, @@ -4484,6 +4596,7 @@ impl WriteXdr for StateArchivalSettings { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct EvictionIterator { pub bucket_list_level: u32, pub is_curr_bucket: bool, @@ -4537,6 +4650,7 @@ pub const CONTRACT_COST_COUNT_LIMIT: u64 = 1024; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct ContractCostParams(pub VecM); @@ -4658,6 +4772,7 @@ impl AsRef<[ContractCostParamEntry]> for ContractCostParams { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ConfigSettingId { ContractMaxSizeBytes = 0, @@ -4855,6 +4970,7 @@ impl WriteXdr for ConfigSettingId { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ConfigSettingEntry { ContractMaxSizeBytes(u32), @@ -5081,6 +5197,7 @@ impl WriteXdr for ConfigSettingEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScEnvMetaKind { ScEnvMetaKindInterfaceVersion = 0, @@ -5183,6 +5300,7 @@ impl WriteXdr for ScEnvMetaKind { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScEnvMetaEntry { ScEnvMetaKindInterfaceVersion(u64), @@ -5284,6 +5402,7 @@ impl WriteXdr for ScEnvMetaEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScMetaV0 { pub key: StringM, pub val: StringM, @@ -5329,6 +5448,7 @@ impl WriteXdr for ScMetaV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScMetaKind { ScMetaV0 = 0, @@ -5431,6 +5551,7 @@ impl WriteXdr for ScMetaKind { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScMetaEntry { ScMetaV0(ScMetaV0), @@ -5568,6 +5689,7 @@ pub const SC_SPEC_DOC_LIMIT: u64 = 1024; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScSpecType { Val = 0, @@ -5792,6 +5914,7 @@ impl WriteXdr for ScSpecType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecTypeOption { pub value_type: Box, } @@ -5834,6 +5957,7 @@ impl WriteXdr for ScSpecTypeOption { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecTypeResult { pub ok_type: Box, pub error_type: Box, @@ -5878,6 +6002,7 @@ impl WriteXdr for ScSpecTypeResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecTypeVec { pub element_type: Box, } @@ -5920,6 +6045,7 @@ impl WriteXdr for ScSpecTypeVec { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecTypeMap { pub key_type: Box, pub value_type: Box, @@ -5964,6 +6090,7 @@ impl WriteXdr for ScSpecTypeMap { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecTypeTuple { pub value_types: VecM, } @@ -6005,6 +6132,7 @@ impl WriteXdr for ScSpecTypeTuple { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecTypeBytesN { pub n: u32, } @@ -6046,6 +6174,7 @@ impl WriteXdr for ScSpecTypeBytesN { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecTypeUdt { pub name: StringM<60>, } @@ -6120,6 +6249,7 @@ impl WriteXdr for ScSpecTypeUdt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScSpecTypeDef { Val, @@ -6392,6 +6522,7 @@ impl WriteXdr for ScSpecTypeDef { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtStructFieldV0 { pub doc: StringM<1024>, pub name: StringM<30>, @@ -6442,6 +6573,7 @@ impl WriteXdr for ScSpecUdtStructFieldV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtStructV0 { pub doc: StringM<1024>, pub lib: StringM<80>, @@ -6493,6 +6625,7 @@ impl WriteXdr for ScSpecUdtStructV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtUnionCaseVoidV0 { pub doc: StringM<1024>, pub name: StringM<60>, @@ -6539,6 +6672,7 @@ impl WriteXdr for ScSpecUdtUnionCaseVoidV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtUnionCaseTupleV0 { pub doc: StringM<1024>, pub name: StringM<60>, @@ -6588,6 +6722,7 @@ impl WriteXdr for ScSpecUdtUnionCaseTupleV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScSpecUdtUnionCaseV0Kind { VoidV0 = 0, @@ -6698,6 +6833,7 @@ impl WriteXdr for ScSpecUdtUnionCaseV0Kind { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScSpecUdtUnionCaseV0 { VoidV0(ScSpecUdtUnionCaseVoidV0), @@ -6811,6 +6947,7 @@ impl WriteXdr for ScSpecUdtUnionCaseV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtUnionV0 { pub doc: StringM<1024>, pub lib: StringM<80>, @@ -6863,6 +7000,7 @@ impl WriteXdr for ScSpecUdtUnionV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtEnumCaseV0 { pub doc: StringM<1024>, pub name: StringM<60>, @@ -6913,6 +7051,7 @@ impl WriteXdr for ScSpecUdtEnumCaseV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtEnumV0 { pub doc: StringM<1024>, pub lib: StringM<80>, @@ -6965,6 +7104,7 @@ impl WriteXdr for ScSpecUdtEnumV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtErrorEnumCaseV0 { pub doc: StringM<1024>, pub name: StringM<60>, @@ -7015,6 +7155,7 @@ impl WriteXdr for ScSpecUdtErrorEnumCaseV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecUdtErrorEnumV0 { pub doc: StringM<1024>, pub lib: StringM<80>, @@ -7067,6 +7208,7 @@ impl WriteXdr for ScSpecUdtErrorEnumV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecFunctionInputV0 { pub doc: StringM<1024>, pub name: StringM<30>, @@ -7117,6 +7259,7 @@ impl WriteXdr for ScSpecFunctionInputV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScSpecFunctionV0 { pub doc: StringM<1024>, pub name: ScSymbol, @@ -7172,6 +7315,7 @@ impl WriteXdr for ScSpecFunctionV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScSpecEntryKind { FunctionV0 = 0, @@ -7306,6 +7450,7 @@ impl WriteXdr for ScSpecEntryKind { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScSpecEntry { FunctionV0(ScSpecFunctionV0), @@ -7489,6 +7634,7 @@ impl WriteXdr for ScSpecEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScValType { Bool = 0, @@ -7708,6 +7854,7 @@ impl WriteXdr for ScValType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScErrorType { Contract = 0, @@ -7859,6 +8006,7 @@ impl WriteXdr for ScErrorType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScErrorCode { ArithDomain = 0, @@ -8020,6 +8168,7 @@ impl WriteXdr for ScErrorCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScError { Contract(u32), @@ -8177,6 +8326,7 @@ impl WriteXdr for ScError { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct UInt128Parts { pub hi: u64, pub lo: u64, @@ -8221,6 +8371,7 @@ impl WriteXdr for UInt128Parts { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Int128Parts { pub hi: i64, pub lo: u64, @@ -8267,6 +8418,7 @@ impl WriteXdr for Int128Parts { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct UInt256Parts { pub hi_hi: u64, pub hi_lo: u64, @@ -8319,6 +8471,7 @@ impl WriteXdr for UInt256Parts { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Int256Parts { pub hi_hi: i64, pub hi_lo: u64, @@ -8371,6 +8524,7 @@ impl WriteXdr for Int256Parts { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ContractExecutableType { Wasm = 0, @@ -8481,6 +8635,7 @@ impl WriteXdr for ContractExecutableType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ContractExecutable { Wasm(Hash), @@ -8589,6 +8744,7 @@ impl WriteXdr for ContractExecutable { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ScAddressType { Account = 0, @@ -8804,6 +8960,7 @@ pub const SCSYMBOL_LIMIT: u64 = 32; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct ScVec(pub VecM); @@ -8909,6 +9066,7 @@ impl AsRef<[ScVal]> for ScVec { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct ScMap(pub VecM); @@ -9014,6 +9172,7 @@ impl AsRef<[ScMapEntry]> for ScMap { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct ScBytes(pub BytesM); @@ -9119,6 +9278,7 @@ impl AsRef<[u8]> for ScBytes { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct ScString(pub StringM); @@ -9224,6 +9384,7 @@ impl AsRef<[u8]> for ScString { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct ScSymbol(pub StringM<32>); @@ -9330,6 +9491,7 @@ impl AsRef<[u8]> for ScSymbol { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScNonceKey { pub nonce: i64, } @@ -9371,6 +9533,7 @@ impl WriteXdr for ScNonceKey { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScContractInstance { pub executable: ContractExecutable, pub storage: Option, @@ -9473,6 +9636,7 @@ impl WriteXdr for ScContractInstance { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScVal { Bool(bool), @@ -9725,6 +9889,7 @@ impl WriteXdr for ScVal { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScMapEntry { pub key: ScVal, pub val: ScVal, @@ -9773,6 +9938,7 @@ impl WriteXdr for ScMapEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum StoredTransactionSet { V0(TransactionSet), @@ -9878,6 +10044,7 @@ impl WriteXdr for StoredTransactionSet { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct StoredDebugTransactionSet { pub tx_set: StoredTransactionSet, pub ledger_seq: u32, @@ -9927,6 +10094,7 @@ impl WriteXdr for StoredDebugTransactionSet { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PersistedScpStateV0 { pub scp_envelopes: VecM, pub quorum_sets: VecM, @@ -9976,6 +10144,7 @@ impl WriteXdr for PersistedScpStateV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PersistedScpStateV1 { pub scp_envelopes: VecM, pub quorum_sets: VecM, @@ -10024,6 +10193,7 @@ impl WriteXdr for PersistedScpStateV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum PersistedScpState { V0(PersistedScpStateV0), @@ -10153,6 +10323,39 @@ impl core::str::FromStr for Thresholds { hex::decode(s).map_err(|_| Error::InvalidHex)?.try_into() } } +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for Thresholds { + fn schema_name() -> String { + "Thresholds".to_string() + } + + fn is_referenceable() -> bool { + false + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let schema = String::json_schema(gen); + if let schemars::schema::Schema::Object(mut schema) = schema { + schema.extensions.insert( + "contentEncoding".to_owned(), + serde_json::Value::String("hex".to_string()), + ); + schema.extensions.insert( + "contentMediaType".to_owned(), + serde_json::Value::String("application/binary".to_string()), + ); + let string = *schema.string.unwrap_or_default().clone(); + schema.string = Some(Box::new(schemars::schema::StringValidation { + max_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), + ..string + })); + schema.into() + } else { + schema + } + } +} impl From for [u8; 4] { #[must_use] fn from(x: Thresholds) -> Self { @@ -10243,6 +10446,7 @@ impl AsRef<[u8]> for Thresholds { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct String32(pub StringM<32>); @@ -10348,6 +10552,7 @@ impl AsRef<[u8]> for String32 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct String64(pub StringM<64>); @@ -10452,6 +10657,7 @@ impl AsRef<[u8]> for String64 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct SequenceNumber(pub i64); @@ -10508,6 +10714,7 @@ impl WriteXdr for SequenceNumber { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct DataValue(pub BytesM<64>); @@ -10612,6 +10819,7 @@ impl AsRef<[u8]> for DataValue { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct PoolId(pub Hash); @@ -10876,6 +11084,7 @@ impl AsRef<[u8]> for AssetCode12 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum AssetType { Native = 0, @@ -11101,6 +11310,7 @@ impl WriteXdr for AssetCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AlphaNum4 { pub asset_code: AssetCode4, pub issuer: AccountId, @@ -11146,6 +11356,7 @@ impl WriteXdr for AlphaNum4 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AlphaNum12 { pub asset_code: AssetCode12, pub issuer: AccountId, @@ -11200,6 +11411,7 @@ impl WriteXdr for AlphaNum12 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum Asset { Native, @@ -11313,6 +11525,7 @@ impl WriteXdr for Asset { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Price { pub n: i32, pub d: i32, @@ -11358,6 +11571,7 @@ impl WriteXdr for Price { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Liabilities { pub buying: i64, pub selling: i64, @@ -11406,6 +11620,7 @@ impl WriteXdr for Liabilities { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ThresholdIndexes { MasterWeight = 0, @@ -11530,6 +11745,7 @@ impl WriteXdr for ThresholdIndexes { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum LedgerEntryType { Account = 0, @@ -11680,6 +11896,7 @@ impl WriteXdr for LedgerEntryType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Signer { pub key: SignerKey, pub weight: u32, @@ -11738,6 +11955,7 @@ impl WriteXdr for Signer { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum AccountFlags { RequiredFlag = 1, @@ -11878,6 +12096,7 @@ pub const MAX_SIGNERS: u64 = 20; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct SponsorshipDescriptor(pub Option); @@ -11944,6 +12163,7 @@ impl WriteXdr for SponsorshipDescriptor { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AccountEntryExtensionV3 { pub ext: ExtensionPoint, pub seq_ledger: u32, @@ -11995,6 +12215,7 @@ impl WriteXdr for AccountEntryExtensionV3 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum AccountEntryExtensionV2Ext { V0, @@ -12109,6 +12330,7 @@ impl WriteXdr for AccountEntryExtensionV2Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AccountEntryExtensionV2 { pub num_sponsored: u32, pub num_sponsoring: u32, @@ -12163,6 +12385,7 @@ impl WriteXdr for AccountEntryExtensionV2 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum AccountEntryExtensionV1Ext { V0, @@ -12275,6 +12498,7 @@ impl WriteXdr for AccountEntryExtensionV1Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AccountEntryExtensionV1 { pub liabilities: Liabilities, pub ext: AccountEntryExtensionV1Ext, @@ -12323,6 +12547,7 @@ impl WriteXdr for AccountEntryExtensionV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum AccountEntryExt { V0, @@ -12450,6 +12675,7 @@ impl WriteXdr for AccountEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AccountEntry { pub account_id: AccountId, pub balance: i64, @@ -12526,6 +12752,7 @@ impl WriteXdr for AccountEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum TrustLineFlags { AuthorizedFlag = 1, @@ -12665,6 +12892,7 @@ pub const MASK_TRUSTLINE_FLAGS_V17: u64 = 7; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum LiquidityPoolType { LiquidityPoolConstantProduct = 0, @@ -12778,6 +13006,7 @@ impl WriteXdr for LiquidityPoolType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TrustLineAsset { Native, @@ -12899,6 +13128,7 @@ impl WriteXdr for TrustLineAsset { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TrustLineEntryExtensionV2Ext { V0, @@ -13004,6 +13234,7 @@ impl WriteXdr for TrustLineEntryExtensionV2Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TrustLineEntryExtensionV2 { pub liquidity_pool_use_count: i32, pub ext: TrustLineEntryExtensionV2Ext, @@ -13052,6 +13283,7 @@ impl WriteXdr for TrustLineEntryExtensionV2 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TrustLineEntryV1Ext { V0, @@ -13164,6 +13396,7 @@ impl WriteXdr for TrustLineEntryV1Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TrustLineEntryV1 { pub liabilities: Liabilities, pub ext: TrustLineEntryV1Ext, @@ -13224,6 +13457,7 @@ impl WriteXdr for TrustLineEntryV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TrustLineEntryExt { V0, @@ -13355,6 +13589,7 @@ impl WriteXdr for TrustLineEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TrustLineEntry { pub account_id: AccountId, pub asset: TrustLineAsset, @@ -13414,6 +13649,7 @@ impl WriteXdr for TrustLineEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum OfferEntryFlags { PassiveFlag = 1, @@ -13524,6 +13760,7 @@ pub const MASK_OFFERENTRY_FLAGS: u64 = 1; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum OfferEntryExt { V0, @@ -13642,6 +13879,7 @@ impl WriteXdr for OfferEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct OfferEntry { pub seller_id: AccountId, pub offer_id: i64, @@ -13706,6 +13944,7 @@ impl WriteXdr for OfferEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum DataEntryExt { V0, @@ -13814,6 +14053,7 @@ impl WriteXdr for DataEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct DataEntry { pub account_id: AccountId, pub data_name: String64, @@ -13870,6 +14110,7 @@ impl WriteXdr for DataEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClaimPredicateType { Unconditional = 0, @@ -14012,6 +14253,7 @@ impl WriteXdr for ClaimPredicateType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ClaimPredicate { Unconditional, @@ -14154,6 +14396,7 @@ impl WriteXdr for ClaimPredicate { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClaimantType { ClaimantTypeV0 = 0, @@ -14255,6 +14498,7 @@ impl WriteXdr for ClaimantType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClaimantV0 { pub destination: AccountId, pub predicate: ClaimPredicate, @@ -14305,6 +14549,7 @@ impl WriteXdr for ClaimantV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum Claimant { ClaimantTypeV0(ClaimantV0), @@ -14404,6 +14649,7 @@ impl WriteXdr for Claimant { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClaimableBalanceIdType { ClaimableBalanceIdTypeV0 = 0, @@ -14610,6 +14856,7 @@ impl WriteXdr for ClaimableBalanceId { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClaimableBalanceFlags { ClaimableBalanceClawbackEnabledFlag = 1, @@ -14721,6 +14968,7 @@ pub const MASK_CLAIMABLE_BALANCE_FLAGS: u64 = 0x1; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ClaimableBalanceEntryExtensionV1Ext { V0, @@ -14826,6 +15074,7 @@ impl WriteXdr for ClaimableBalanceEntryExtensionV1Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClaimableBalanceEntryExtensionV1 { pub ext: ClaimableBalanceEntryExtensionV1Ext, pub flags: u32, @@ -14874,6 +15123,7 @@ impl WriteXdr for ClaimableBalanceEntryExtensionV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ClaimableBalanceEntryExt { V0, @@ -14997,6 +15247,7 @@ impl WriteXdr for ClaimableBalanceEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClaimableBalanceEntry { pub balance_id: ClaimableBalanceId, pub claimants: VecM, @@ -15052,6 +15303,7 @@ impl WriteXdr for ClaimableBalanceEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LiquidityPoolConstantProductParameters { pub asset_a: Asset, pub asset_b: Asset, @@ -15105,6 +15357,7 @@ impl WriteXdr for LiquidityPoolConstantProductParameters { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LiquidityPoolEntryConstantProduct { pub params: LiquidityPoolConstantProductParameters, pub reserve_a: i64, @@ -15169,6 +15422,7 @@ impl WriteXdr for LiquidityPoolEntryConstantProduct { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LiquidityPoolEntryBody { LiquidityPoolConstantProduct(LiquidityPoolEntryConstantProduct), @@ -15289,6 +15543,7 @@ impl WriteXdr for LiquidityPoolEntryBody { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LiquidityPoolEntry { pub liquidity_pool_id: PoolId, pub body: LiquidityPoolEntryBody, @@ -15334,6 +15589,7 @@ impl WriteXdr for LiquidityPoolEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ContractDataDurability { Temporary = 0, @@ -15444,6 +15700,7 @@ impl WriteXdr for ContractDataDurability { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractDataEntry { pub ext: ExtensionPoint, pub contract: ScAddress, @@ -15506,6 +15763,7 @@ impl WriteXdr for ContractDataEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractCodeCostInputs { pub ext: ExtensionPoint, pub n_instructions: u32, @@ -15578,6 +15836,7 @@ impl WriteXdr for ContractCodeCostInputs { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractCodeEntryV1 { pub ext: ExtensionPoint, pub cost_inputs: ContractCodeCostInputs, @@ -15630,6 +15889,7 @@ impl WriteXdr for ContractCodeEntryV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ContractCodeEntryExt { V0, @@ -15745,6 +16005,7 @@ impl WriteXdr for ContractCodeEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractCodeEntry { pub ext: ContractCodeEntryExt, pub hash: Hash, @@ -15793,6 +16054,7 @@ impl WriteXdr for ContractCodeEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TtlEntry { pub key_hash: Hash, pub live_until_ledger_seq: u32, @@ -15839,6 +16101,7 @@ impl WriteXdr for TtlEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerEntryExtensionV1Ext { V0, @@ -15944,6 +16207,7 @@ impl WriteXdr for LedgerEntryExtensionV1Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerEntryExtensionV1 { pub sponsoring_id: SponsorshipDescriptor, pub ext: LedgerEntryExtensionV1Ext, @@ -16008,6 +16272,7 @@ impl WriteXdr for LedgerEntryExtensionV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerEntryData { Account(AccountEntry), @@ -16187,6 +16452,7 @@ impl WriteXdr for LedgerEntryData { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerEntryExt { V0, @@ -16325,6 +16591,7 @@ impl WriteXdr for LedgerEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerEntry { pub last_modified_ledger_seq: u32, pub data: LedgerEntryData, @@ -16372,6 +16639,7 @@ impl WriteXdr for LedgerEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyAccount { pub account_id: AccountId, } @@ -16414,6 +16682,7 @@ impl WriteXdr for LedgerKeyAccount { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyTrustLine { pub account_id: AccountId, pub asset: TrustLineAsset, @@ -16459,6 +16728,7 @@ impl WriteXdr for LedgerKeyTrustLine { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyOffer { pub seller_id: AccountId, pub offer_id: i64, @@ -16504,6 +16774,7 @@ impl WriteXdr for LedgerKeyOffer { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyData { pub account_id: AccountId, pub data_name: String64, @@ -16548,6 +16819,7 @@ impl WriteXdr for LedgerKeyData { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyClaimableBalance { pub balance_id: ClaimableBalanceId, } @@ -16589,6 +16861,7 @@ impl WriteXdr for LedgerKeyClaimableBalance { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyLiquidityPool { pub liquidity_pool_id: PoolId, } @@ -16632,6 +16905,7 @@ impl WriteXdr for LedgerKeyLiquidityPool { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyContractData { pub contract: ScAddress, pub key: ScVal, @@ -16679,6 +16953,7 @@ impl WriteXdr for LedgerKeyContractData { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyContractCode { pub hash: Hash, } @@ -16720,6 +16995,7 @@ impl WriteXdr for LedgerKeyContractCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyConfigSetting { pub config_setting_id: ConfigSettingId, } @@ -16762,6 +17038,7 @@ impl WriteXdr for LedgerKeyConfigSetting { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerKeyTtl { pub key_hash: Hash, } @@ -16864,6 +17141,7 @@ impl WriteXdr for LedgerKeyTtl { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerKey { Account(LedgerKeyAccount), @@ -17049,6 +17327,7 @@ impl WriteXdr for LedgerKey { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum EnvelopeType { TxV0 = 0, @@ -17196,6 +17475,7 @@ impl WriteXdr for EnvelopeType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct UpgradeType(pub BytesM<128>); @@ -17305,6 +17585,7 @@ impl AsRef<[u8]> for UpgradeType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum StellarValueType { Basic = 0, @@ -17409,6 +17690,7 @@ impl WriteXdr for StellarValueType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerCloseValueSignature { pub node_id: NodeId, pub signature: Signature, @@ -17457,6 +17739,7 @@ impl WriteXdr for LedgerCloseValueSignature { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum StellarValueExt { Basic, @@ -17578,6 +17861,7 @@ impl WriteXdr for StellarValueExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct StellarValue { pub tx_set_hash: Hash, pub close_time: TimePoint, @@ -17639,6 +17923,7 @@ pub const MASK_LEDGER_HEADER_FLAGS: u64 = 0x7; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum LedgerHeaderFlags { TradingFlag = 1, @@ -17751,6 +18036,7 @@ impl WriteXdr for LedgerHeaderFlags { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerHeaderExtensionV1Ext { V0, @@ -17856,6 +18142,7 @@ impl WriteXdr for LedgerHeaderExtensionV1Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerHeaderExtensionV1 { pub flags: u32, pub ext: LedgerHeaderExtensionV1Ext, @@ -17904,6 +18191,7 @@ impl WriteXdr for LedgerHeaderExtensionV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerHeaderExt { V0, @@ -18042,6 +18330,7 @@ impl WriteXdr for LedgerHeaderExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerHeader { pub ledger_version: u32, pub previous_ledger_hash: Hash, @@ -18132,6 +18421,7 @@ impl WriteXdr for LedgerHeader { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum LedgerUpgradeType { Version = 1, @@ -18266,6 +18556,7 @@ impl WriteXdr for LedgerUpgradeType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigUpgradeSetKey { pub contract_id: Hash, pub content_hash: Hash, @@ -18327,6 +18618,7 @@ impl WriteXdr for ConfigUpgradeSetKey { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerUpgrade { Version(u32), @@ -18472,6 +18764,7 @@ impl WriteXdr for LedgerUpgrade { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ConfigUpgradeSet { pub updated_entry: VecM, } @@ -18519,6 +18812,7 @@ impl WriteXdr for ConfigUpgradeSet { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum BucketEntryType { Metaentry = -1, @@ -18636,6 +18930,7 @@ impl WriteXdr for BucketEntryType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum BucketMetadataExt { V0, @@ -18743,6 +19038,7 @@ impl WriteXdr for BucketMetadataExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct BucketMetadata { pub ledger_version: u32, pub ext: BucketMetadataExt, @@ -18795,6 +19091,7 @@ impl WriteXdr for BucketMetadata { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum BucketEntry { Liveentry(LedgerEntry), @@ -18917,6 +19214,7 @@ impl WriteXdr for BucketEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum TxSetComponentType { TxsetCompTxsMaybeDiscountedFee = 0, @@ -19019,6 +19317,7 @@ impl WriteXdr for TxSetComponentType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TxSetComponentTxsMaybeDiscountedFee { pub base_fee: Option, pub txs: VecM, @@ -19069,6 +19368,7 @@ impl WriteXdr for TxSetComponentTxsMaybeDiscountedFee { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TxSetComponent { TxsetCompTxsMaybeDiscountedFee(TxSetComponentTxsMaybeDiscountedFee), @@ -19176,6 +19476,7 @@ impl WriteXdr for TxSetComponent { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionPhase { V0(VecM), @@ -19275,6 +19576,7 @@ impl WriteXdr for TransactionPhase { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionSet { pub previous_ledger_hash: Hash, pub txs: VecM, @@ -19320,6 +19622,7 @@ impl WriteXdr for TransactionSet { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionSetV1 { pub previous_ledger_hash: Hash, pub phases: VecM, @@ -19367,6 +19670,7 @@ impl WriteXdr for TransactionSetV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum GeneralizedTransactionSet { V1(TransactionSetV1), @@ -19466,6 +19770,7 @@ impl WriteXdr for GeneralizedTransactionSet { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionResultPair { pub transaction_hash: Hash, pub result: TransactionResult, @@ -19510,6 +19815,7 @@ impl WriteXdr for TransactionResultPair { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionResultSet { pub results: VecM, } @@ -19555,6 +19861,7 @@ impl WriteXdr for TransactionResultSet { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionHistoryEntryExt { V0, @@ -19669,6 +19976,7 @@ impl WriteXdr for TransactionHistoryEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionHistoryEntry { pub ledger_seq: u32, pub tx_set: TransactionSet, @@ -19718,6 +20026,7 @@ impl WriteXdr for TransactionHistoryEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionHistoryResultEntryExt { V0, @@ -19825,6 +20134,7 @@ impl WriteXdr for TransactionHistoryResultEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionHistoryResultEntry { pub ledger_seq: u32, pub tx_result_set: TransactionResultSet, @@ -19874,6 +20184,7 @@ impl WriteXdr for TransactionHistoryResultEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerHeaderHistoryEntryExt { V0, @@ -19981,6 +20292,7 @@ impl WriteXdr for LedgerHeaderHistoryEntryExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerHeaderHistoryEntry { pub hash: Hash, pub header: LedgerHeader, @@ -20029,6 +20341,7 @@ impl WriteXdr for LedgerHeaderHistoryEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerScpMessages { pub ledger_seq: u32, pub messages: VecM, @@ -20074,6 +20387,7 @@ impl WriteXdr for LedgerScpMessages { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ScpHistoryEntryV0 { pub quorum_sets: VecM, pub ledger_messages: LedgerScpMessages, @@ -20120,6 +20434,7 @@ impl WriteXdr for ScpHistoryEntryV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ScpHistoryEntry { V0(ScpHistoryEntryV0), @@ -20222,6 +20537,7 @@ impl WriteXdr for ScpHistoryEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum LedgerEntryChangeType { Created = 0, @@ -20344,6 +20660,7 @@ impl WriteXdr for LedgerEntryChangeType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerEntryChange { Created(LedgerEntry), @@ -20460,6 +20777,7 @@ impl WriteXdr for LedgerEntryChange { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct LedgerEntryChanges(pub VecM); @@ -20567,6 +20885,7 @@ impl AsRef<[LedgerEntryChange]> for LedgerEntryChanges { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct OperationMeta { pub changes: LedgerEntryChanges, } @@ -20609,6 +20928,7 @@ impl WriteXdr for OperationMeta { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionMetaV1 { pub tx_changes: LedgerEntryChanges, pub operations: VecM, @@ -20657,6 +20977,7 @@ impl WriteXdr for TransactionMetaV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionMetaV2 { pub tx_changes_before: LedgerEntryChanges, pub operations: VecM, @@ -20707,6 +21028,7 @@ impl WriteXdr for TransactionMetaV2 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ContractEventType { System = 0, @@ -20818,6 +21140,7 @@ impl WriteXdr for ContractEventType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractEventV0 { pub topics: VecM, pub data: ScVal, @@ -20868,6 +21191,7 @@ impl WriteXdr for ContractEventV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ContractEventBody { V0(ContractEventV0), @@ -20982,6 +21306,7 @@ impl WriteXdr for ContractEventBody { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractEvent { pub ext: ExtensionPoint, pub contract_id: Option, @@ -21033,6 +21358,7 @@ impl WriteXdr for ContractEvent { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct DiagnosticEvent { pub in_successful_contract_call: bool, pub event: ContractEvent, @@ -21106,6 +21432,7 @@ impl WriteXdr for DiagnosticEvent { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanTransactionMetaExtV1 { pub ext: ExtensionPoint, pub total_non_refundable_resource_fee_charged: i64, @@ -21161,6 +21488,7 @@ impl WriteXdr for SorobanTransactionMetaExtV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum SorobanTransactionMetaExt { V0, @@ -21273,6 +21601,7 @@ impl WriteXdr for SorobanTransactionMetaExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanTransactionMeta { pub ext: SorobanTransactionMetaExt, pub events: VecM, @@ -21331,6 +21660,7 @@ impl WriteXdr for SorobanTransactionMeta { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionMetaV3 { pub ext: ExtensionPoint, pub tx_changes_before: LedgerEntryChanges, @@ -21385,6 +21715,7 @@ impl WriteXdr for TransactionMetaV3 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct InvokeHostFunctionSuccessPreImage { pub return_value: ScVal, pub events: VecM, @@ -21437,6 +21768,7 @@ impl WriteXdr for InvokeHostFunctionSuccessPreImage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionMeta { V0(VecM), @@ -21552,6 +21884,7 @@ impl WriteXdr for TransactionMeta { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionResultMeta { pub result: TransactionResultPair, pub fee_processing: LedgerEntryChanges, @@ -21600,6 +21933,7 @@ impl WriteXdr for TransactionResultMeta { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct UpgradeEntryMeta { pub upgrade: LedgerUpgrade, pub changes: LedgerEntryChanges, @@ -21657,6 +21991,7 @@ impl WriteXdr for UpgradeEntryMeta { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerCloseMetaV0 { pub ledger_header: LedgerHeaderHistoryEntry, pub tx_set: TransactionSet, @@ -21711,6 +22046,7 @@ impl WriteXdr for LedgerCloseMetaV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerCloseMetaExtV1 { pub ext: ExtensionPoint, pub soroban_fee_write1_kb: i64, @@ -21759,6 +22095,7 @@ impl WriteXdr for LedgerCloseMetaExtV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerCloseMetaExt { V0, @@ -21888,6 +22225,7 @@ impl WriteXdr for LedgerCloseMetaExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerCloseMetaV1 { pub ext: LedgerCloseMetaExt, pub ledger_header: LedgerHeaderHistoryEntry, @@ -21957,6 +22295,7 @@ impl WriteXdr for LedgerCloseMetaV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LedgerCloseMeta { V0(LedgerCloseMetaV0), @@ -22065,6 +22404,7 @@ impl WriteXdr for LedgerCloseMeta { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ErrorCode { Misc = 0, @@ -22184,6 +22524,7 @@ impl WriteXdr for ErrorCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SError { pub code: ErrorCode, pub msg: StringM<100>, @@ -22228,6 +22569,7 @@ impl WriteXdr for SError { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SendMore { pub num_messages: u32, } @@ -22270,6 +22612,7 @@ impl WriteXdr for SendMore { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SendMoreExtended { pub num_messages: u32, pub num_bytes: u32, @@ -22316,6 +22659,7 @@ impl WriteXdr for SendMoreExtended { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AuthCert { pub pubkey: Curve25519Public, pub expiration: u64, @@ -22371,6 +22715,7 @@ impl WriteXdr for AuthCert { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Hello { pub ledger_version: u32, pub overlay_version: u32, @@ -22444,6 +22789,7 @@ pub const AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED: u64 = 200; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Auth { pub flags: i32, } @@ -22487,6 +22833,7 @@ impl WriteXdr for Auth { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum IpAddrType { IPv4 = 0, @@ -22594,6 +22941,7 @@ impl WriteXdr for IpAddrType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum PeerAddressIp { IPv4([u8; 4]), @@ -22706,6 +23054,7 @@ impl WriteXdr for PeerAddressIp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PeerAddress { pub ip: PeerAddressIp, pub port: u32, @@ -22783,6 +23132,7 @@ impl WriteXdr for PeerAddress { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum MessageType { ErrorMsg = 0, @@ -22983,6 +23333,7 @@ impl WriteXdr for MessageType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct DontHave { pub type_: MessageType, pub req_hash: Uint256, @@ -23028,6 +23379,7 @@ impl WriteXdr for DontHave { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum SurveyMessageCommandType { SurveyTopology = 0, @@ -23130,6 +23482,7 @@ impl WriteXdr for SurveyMessageCommandType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum SurveyMessageResponseType { V0 = 0, @@ -23238,6 +23591,7 @@ impl WriteXdr for SurveyMessageResponseType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SurveyRequestMessage { pub surveyor_peer_id: NodeId, pub surveyed_peer_id: NodeId, @@ -23292,6 +23646,7 @@ impl WriteXdr for SurveyRequestMessage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SignedSurveyRequestMessage { pub request_signature: Signature, pub request: SurveyRequestMessage, @@ -23334,6 +23689,7 @@ impl WriteXdr for SignedSurveyRequestMessage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct EncryptedBody(pub BytesM<64000>); @@ -23445,6 +23801,7 @@ impl AsRef<[u8]> for EncryptedBody { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SurveyResponseMessage { pub surveyor_peer_id: NodeId, pub surveyed_peer_id: NodeId, @@ -23499,6 +23856,7 @@ impl WriteXdr for SurveyResponseMessage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SignedSurveyResponseMessage { pub response_signature: Signature, pub response: SurveyResponseMessage, @@ -23559,6 +23917,7 @@ impl WriteXdr for SignedSurveyResponseMessage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PeerStats { pub id: NodeId, pub version_str: StringM<100>, @@ -23640,6 +23999,7 @@ impl WriteXdr for PeerStats { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct PeerStatList(pub VecM); @@ -23751,6 +24111,7 @@ impl AsRef<[PeerStats]> for PeerStatList { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TopologyResponseBodyV0 { pub inbound_peers: PeerStatList, pub outbound_peers: PeerStatList, @@ -23808,6 +24169,7 @@ impl WriteXdr for TopologyResponseBodyV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TopologyResponseBodyV1 { pub inbound_peers: PeerStatList, pub outbound_peers: PeerStatList, @@ -23868,6 +24230,7 @@ impl WriteXdr for TopologyResponseBodyV1 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum SurveyResponseBody { V0(TopologyResponseBodyV0), @@ -23979,6 +24342,7 @@ pub const TX_ADVERT_VECTOR_MAX_SIZE: u64 = 1000; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct TxAdvertVector(pub VecM); @@ -24086,6 +24450,7 @@ impl AsRef<[Hash]> for TxAdvertVector { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct FloodAdvert { pub tx_hashes: TxAdvertVector, } @@ -24133,6 +24498,7 @@ pub const TX_DEMAND_VECTOR_MAX_SIZE: u64 = 1000; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct TxDemandVector(pub VecM); @@ -24240,6 +24606,7 @@ impl AsRef<[Hash]> for TxDemandVector { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct FloodDemand { pub tx_hashes: TxDemandVector, } @@ -24328,6 +24695,7 @@ impl WriteXdr for FloodDemand { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum StellarMessage { ErrorMsg(SError), @@ -24573,6 +24941,7 @@ impl WriteXdr for StellarMessage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AuthenticatedMessageV0 { pub sequence: u64, pub message: StellarMessage, @@ -24627,6 +24996,7 @@ impl WriteXdr for AuthenticatedMessageV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum AuthenticatedMessage { V0(AuthenticatedMessageV0), @@ -24735,6 +25105,7 @@ pub const MAX_OPS_PER_TX: u64 = 100; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LiquidityPoolParameters { LiquidityPoolConstantProduct(LiquidityPoolConstantProductParameters), @@ -24996,6 +25367,7 @@ impl WriteXdr for MuxedAccount { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct DecoratedSignature { pub hint: SignatureHint, pub signature: Signature, @@ -25067,6 +25439,7 @@ impl WriteXdr for DecoratedSignature { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum OperationType { CreateAccount = 0, @@ -25302,6 +25675,7 @@ impl WriteXdr for OperationType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct CreateAccountOp { pub destination: AccountId, pub starting_balance: i64, @@ -25348,6 +25722,7 @@ impl WriteXdr for CreateAccountOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PaymentOp { pub destination: MuxedAccount, pub asset: Asset, @@ -25404,6 +25779,7 @@ impl WriteXdr for PaymentOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PathPaymentStrictReceiveOp { pub send_asset: Asset, pub send_max: i64, @@ -25469,6 +25845,7 @@ impl WriteXdr for PathPaymentStrictReceiveOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PathPaymentStrictSendOp { pub send_asset: Asset, pub send_amount: i64, @@ -25531,6 +25908,7 @@ impl WriteXdr for PathPaymentStrictSendOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ManageSellOfferOp { pub selling: Asset, pub buying: Asset, @@ -25591,6 +25969,7 @@ impl WriteXdr for ManageSellOfferOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ManageBuyOfferOp { pub selling: Asset, pub buying: Asset, @@ -25647,6 +26026,7 @@ impl WriteXdr for ManageBuyOfferOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct CreatePassiveSellOfferOp { pub selling: Asset, pub buying: Asset, @@ -25712,6 +26092,7 @@ impl WriteXdr for CreatePassiveSellOfferOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SetOptionsOp { pub inflation_dest: Option, pub clear_flags: Option, @@ -25790,6 +26171,7 @@ impl WriteXdr for SetOptionsOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ChangeTrustAsset { Native, @@ -25912,6 +26294,7 @@ impl WriteXdr for ChangeTrustAsset { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ChangeTrustOp { pub line: ChangeTrustAsset, pub limit: i64, @@ -25960,6 +26343,7 @@ impl WriteXdr for ChangeTrustOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct AllowTrustOp { pub trustor: AccountId, pub asset: AssetCode, @@ -26008,6 +26392,7 @@ impl WriteXdr for AllowTrustOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ManageDataOp { pub data_name: String64, pub data_value: Option, @@ -26052,6 +26437,7 @@ impl WriteXdr for ManageDataOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct BumpSequenceOp { pub bump_to: SequenceNumber, } @@ -26095,6 +26481,7 @@ impl WriteXdr for BumpSequenceOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct CreateClaimableBalanceOp { pub asset: Asset, pub amount: i64, @@ -26142,6 +26529,7 @@ impl WriteXdr for CreateClaimableBalanceOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClaimClaimableBalanceOp { pub balance_id: ClaimableBalanceId, } @@ -26183,6 +26571,7 @@ impl WriteXdr for ClaimClaimableBalanceOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct BeginSponsoringFutureReservesOp { pub sponsored_id: AccountId, } @@ -26226,6 +26615,7 @@ impl WriteXdr for BeginSponsoringFutureReservesOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum RevokeSponsorshipType { LedgerEntry = 0, @@ -26333,6 +26723,7 @@ impl WriteXdr for RevokeSponsorshipType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct RevokeSponsorshipOpSigner { pub account_id: AccountId, pub signer_key: SignerKey, @@ -26385,6 +26776,7 @@ impl WriteXdr for RevokeSponsorshipOpSigner { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum RevokeSponsorshipOp { LedgerEntry(LedgerKey), @@ -26495,6 +26887,7 @@ impl WriteXdr for RevokeSponsorshipOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClawbackOp { pub asset: Asset, pub from: MuxedAccount, @@ -26542,6 +26935,7 @@ impl WriteXdr for ClawbackOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClawbackClaimableBalanceOp { pub balance_id: ClaimableBalanceId, } @@ -26587,6 +26981,7 @@ impl WriteXdr for ClawbackClaimableBalanceOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SetTrustLineFlagsOp { pub trustor: AccountId, pub asset: Asset, @@ -26649,6 +27044,7 @@ pub const LIQUIDITY_POOL_FEE_V18: u64 = 30; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LiquidityPoolDepositOp { pub liquidity_pool_id: PoolId, pub max_amount_a: i64, @@ -26705,6 +27101,7 @@ impl WriteXdr for LiquidityPoolDepositOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LiquidityPoolWithdrawOp { pub liquidity_pool_id: PoolId, pub amount: i64, @@ -26758,6 +27155,7 @@ impl WriteXdr for LiquidityPoolWithdrawOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum HostFunctionType { InvokeContract = 0, @@ -26871,6 +27269,7 @@ impl WriteXdr for HostFunctionType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ContractIdPreimageType { Address = 0, @@ -26978,6 +27377,7 @@ impl WriteXdr for ContractIdPreimageType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ContractIdPreimageFromAddress { pub address: ScAddress, pub salt: Uint256, @@ -27030,6 +27430,7 @@ impl WriteXdr for ContractIdPreimageFromAddress { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ContractIdPreimage { Address(ContractIdPreimageFromAddress), @@ -27139,6 +27540,7 @@ impl WriteXdr for ContractIdPreimage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct CreateContractArgs { pub contract_id_preimage: ContractIdPreimage, pub executable: ContractExecutable, @@ -27184,6 +27586,7 @@ impl WriteXdr for CreateContractArgs { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct InvokeContractArgs { pub contract_address: ScAddress, pub function_name: ScSymbol, @@ -27237,6 +27640,7 @@ impl WriteXdr for InvokeContractArgs { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum HostFunction { InvokeContract(InvokeContractArgs), @@ -27358,6 +27762,7 @@ impl WriteXdr for HostFunction { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum SorobanAuthorizedFunctionType { ContractFn = 0, @@ -27468,6 +27873,7 @@ impl WriteXdr for SorobanAuthorizedFunctionType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum SorobanAuthorizedFunction { ContractFn(InvokeContractArgs), @@ -27580,6 +27986,7 @@ impl WriteXdr for SorobanAuthorizedFunction { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanAuthorizedInvocation { pub function: SorobanAuthorizedFunction, pub sub_invocations: VecM, @@ -27627,6 +28034,7 @@ impl WriteXdr for SorobanAuthorizedInvocation { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanAddressCredentials { pub address: ScAddress, pub nonce: i64, @@ -27679,6 +28087,7 @@ impl WriteXdr for SorobanAddressCredentials { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum SorobanCredentialsType { SourceAccount = 0, @@ -27789,6 +28198,7 @@ impl WriteXdr for SorobanCredentialsType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum SorobanCredentials { SourceAccount, @@ -27898,6 +28308,7 @@ impl WriteXdr for SorobanCredentials { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanAuthorizationEntry { pub credentials: SorobanCredentials, pub root_invocation: SorobanAuthorizedInvocation, @@ -27945,6 +28356,7 @@ impl WriteXdr for SorobanAuthorizationEntry { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct InvokeHostFunctionOp { pub host_function: HostFunction, pub auth: VecM, @@ -27990,6 +28402,7 @@ impl WriteXdr for InvokeHostFunctionOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ExtendFootprintTtlOp { pub ext: ExtensionPoint, pub extend_to: u32, @@ -28034,6 +28447,7 @@ impl WriteXdr for ExtendFootprintTtlOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct RestoreFootprintOp { pub ext: ExtensionPoint, } @@ -28129,6 +28543,7 @@ impl WriteXdr for RestoreFootprintOp { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum OperationBody { CreateAccount(CreateAccountOp), @@ -28509,6 +28924,7 @@ impl WriteXdr for OperationBody { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Operation { pub source_account: Option, pub body: OperationBody, @@ -28555,6 +28971,7 @@ impl WriteXdr for Operation { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct HashIdPreimageOperationId { pub source_account: AccountId, pub seq_num: SequenceNumber, @@ -28606,6 +29023,7 @@ impl WriteXdr for HashIdPreimageOperationId { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct HashIdPreimageRevokeId { pub source_account: AccountId, pub seq_num: SequenceNumber, @@ -28660,6 +29078,7 @@ impl WriteXdr for HashIdPreimageRevokeId { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct HashIdPreimageContractId { pub network_id: Hash, pub contract_id_preimage: ContractIdPreimage, @@ -28707,6 +29126,7 @@ impl WriteXdr for HashIdPreimageContractId { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct HashIdPreimageSorobanAuthorization { pub network_id: Hash, pub nonce: i64, @@ -28787,6 +29207,7 @@ impl WriteXdr for HashIdPreimageSorobanAuthorization { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum HashIdPreimage { OpId(HashIdPreimageOperationId), @@ -28921,6 +29342,7 @@ impl WriteXdr for HashIdPreimage { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum MemoType { None = 0, @@ -29049,6 +29471,7 @@ impl WriteXdr for MemoType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum Memo { None, @@ -29174,6 +29597,7 @@ impl WriteXdr for Memo { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TimeBounds { pub min_time: TimePoint, pub max_time: TimePoint, @@ -29219,6 +29643,7 @@ impl WriteXdr for TimeBounds { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerBounds { pub min_ledger: u32, pub max_ledger: u32, @@ -29291,6 +29716,7 @@ impl WriteXdr for LedgerBounds { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PreconditionsV2 { pub time_bounds: Option, pub ledger_bounds: Option, @@ -29350,6 +29776,7 @@ impl WriteXdr for PreconditionsV2 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum PreconditionType { None = 0, @@ -29466,6 +29893,7 @@ impl WriteXdr for PreconditionType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum Preconditions { None, @@ -29579,6 +30007,7 @@ impl WriteXdr for Preconditions { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct LedgerFootprint { pub read_only: VecM, pub read_write: VecM, @@ -29631,6 +30060,7 @@ impl WriteXdr for LedgerFootprint { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanResources { pub footprint: LedgerFootprint, pub instructions: u32, @@ -29692,6 +30122,7 @@ impl WriteXdr for SorobanResources { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanTransactionData { pub ext: ExtensionPoint, pub resources: SorobanResources, @@ -29741,6 +30172,7 @@ impl WriteXdr for SorobanTransactionData { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionV0Ext { V0, @@ -29850,6 +30282,7 @@ impl WriteXdr for TransactionV0Ext { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionV0 { pub source_account_ed25519: Uint256, pub fee: u32, @@ -29912,6 +30345,7 @@ impl WriteXdr for TransactionV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionV0Envelope { pub tx: TransactionV0, pub signatures: VecM, @@ -29960,6 +30394,7 @@ impl WriteXdr for TransactionV0Envelope { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionExt { V0, @@ -30087,6 +30522,7 @@ impl WriteXdr for TransactionExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Transaction { pub source_account: MuxedAccount, pub fee: u32, @@ -30149,6 +30585,7 @@ impl WriteXdr for Transaction { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionV1Envelope { pub tx: Transaction, pub signatures: VecM, @@ -30195,6 +30632,7 @@ impl WriteXdr for TransactionV1Envelope { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum FeeBumpTransactionInnerTx { Tx(TransactionV1Envelope), @@ -30295,6 +30733,7 @@ impl WriteXdr for FeeBumpTransactionInnerTx { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum FeeBumpTransactionExt { V0, @@ -30406,6 +30845,7 @@ impl WriteXdr for FeeBumpTransactionExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct FeeBumpTransaction { pub fee_source: MuxedAccount, pub fee: i64, @@ -30459,6 +30899,7 @@ impl WriteXdr for FeeBumpTransaction { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct FeeBumpTransactionEnvelope { pub tx: FeeBumpTransaction, pub signatures: VecM, @@ -30509,6 +30950,7 @@ impl WriteXdr for FeeBumpTransactionEnvelope { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionEnvelope { TxV0(TransactionV0Envelope), @@ -30628,6 +31070,7 @@ impl WriteXdr for TransactionEnvelope { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionSignaturePayloadTaggedTransaction { Tx(Transaction), @@ -30740,6 +31183,7 @@ impl WriteXdr for TransactionSignaturePayloadTaggedTransaction { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionSignaturePayload { pub network_id: Hash, pub tagged_transaction: TransactionSignaturePayloadTaggedTransaction, @@ -30787,6 +31231,7 @@ impl WriteXdr for TransactionSignaturePayload { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClaimAtomType { V0 = 0, @@ -30907,6 +31352,7 @@ impl WriteXdr for ClaimAtomType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClaimOfferAtomV0 { pub seller_ed25519: Uint256, pub offer_id: i64, @@ -30973,6 +31419,7 @@ impl WriteXdr for ClaimOfferAtomV0 { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClaimOfferAtom { pub seller_id: AccountId, pub offer_id: i64, @@ -31037,6 +31484,7 @@ impl WriteXdr for ClaimOfferAtom { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ClaimLiquidityAtom { pub liquidity_pool_id: PoolId, pub asset_sold: Asset, @@ -31096,6 +31544,7 @@ impl WriteXdr for ClaimLiquidityAtom { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ClaimAtom { V0(ClaimOfferAtomV0), @@ -31219,6 +31668,7 @@ impl WriteXdr for ClaimAtom { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum CreateAccountResultCode { Success = 0, @@ -31350,6 +31800,7 @@ impl WriteXdr for CreateAccountResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum CreateAccountResult { Success, @@ -31493,6 +31944,7 @@ impl WriteXdr for CreateAccountResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum PaymentResultCode { Success = 0, @@ -31654,6 +32106,7 @@ impl WriteXdr for PaymentResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum PaymentResult { Success, @@ -31844,6 +32297,7 @@ impl WriteXdr for PaymentResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum PathPaymentStrictReceiveResultCode { Success = 0, @@ -32010,6 +32464,7 @@ impl WriteXdr for PathPaymentStrictReceiveResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SimplePaymentResult { pub destination: AccountId, pub asset: Asset, @@ -32058,6 +32513,7 @@ impl WriteXdr for SimplePaymentResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PathPaymentStrictReceiveResultSuccess { pub offers: VecM, pub last: SimplePaymentResult, @@ -32124,6 +32580,7 @@ impl WriteXdr for PathPaymentStrictReceiveResultSuccess { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum PathPaymentStrictReceiveResult { Success(PathPaymentStrictReceiveResultSuccess), @@ -32337,6 +32794,7 @@ impl WriteXdr for PathPaymentStrictReceiveResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum PathPaymentStrictSendResultCode { Success = 0, @@ -32502,6 +32960,7 @@ impl WriteXdr for PathPaymentStrictSendResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct PathPaymentStrictSendResultSuccess { pub offers: VecM, pub last: SimplePaymentResult, @@ -32567,6 +33026,7 @@ impl WriteXdr for PathPaymentStrictSendResultSuccess { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum PathPaymentStrictSendResult { Success(PathPaymentStrictSendResultSuccess), @@ -32779,6 +33239,7 @@ impl WriteXdr for PathPaymentStrictSendResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ManageSellOfferResultCode { Success = 0, @@ -32946,6 +33407,7 @@ impl WriteXdr for ManageSellOfferResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ManageOfferEffect { Created = 0, @@ -33061,6 +33523,7 @@ impl WriteXdr for ManageOfferEffect { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ManageOfferSuccessResultOffer { Created(OfferEntry), @@ -33184,6 +33647,7 @@ impl WriteXdr for ManageOfferSuccessResultOffer { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct ManageOfferSuccessResult { pub offers_claimed: VecM, pub offer: ManageOfferSuccessResultOffer, @@ -33243,6 +33707,7 @@ impl WriteXdr for ManageOfferSuccessResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ManageSellOfferResult { Success(ManageOfferSuccessResult), @@ -33452,6 +33917,7 @@ impl WriteXdr for ManageSellOfferResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ManageBuyOfferResultCode { Success = 0, @@ -33631,6 +34097,7 @@ impl WriteXdr for ManageBuyOfferResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ManageBuyOfferResult { Success(ManageOfferSuccessResult), @@ -33833,6 +34300,7 @@ impl WriteXdr for ManageBuyOfferResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum SetOptionsResultCode { Success = 0, @@ -34000,6 +34468,7 @@ impl WriteXdr for SetOptionsResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum SetOptionsResult { Success, @@ -34187,6 +34656,7 @@ impl WriteXdr for SetOptionsResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ChangeTrustResultCode { Success = 0, @@ -34342,6 +34812,7 @@ impl WriteXdr for ChangeTrustResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ChangeTrustResult { Success, @@ -34513,6 +34984,7 @@ impl WriteXdr for ChangeTrustResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum AllowTrustResultCode { Success = 0, @@ -34656,6 +35128,7 @@ impl WriteXdr for AllowTrustResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum AllowTrustResult { Success, @@ -34811,6 +35284,7 @@ impl WriteXdr for AllowTrustResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum AccountMergeResultCode { Success = 0, @@ -34960,6 +35434,7 @@ impl WriteXdr for AccountMergeResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum AccountMergeResult { Success(i64), @@ -35115,6 +35590,7 @@ impl WriteXdr for AccountMergeResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum InflationResultCode { Success = 0, @@ -35220,6 +35696,7 @@ impl WriteXdr for InflationResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct InflationPayout { pub destination: AccountId, pub amount: i64, @@ -35268,6 +35745,7 @@ impl WriteXdr for InflationPayout { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum InflationResult { Success(VecM), @@ -35383,6 +35861,7 @@ impl WriteXdr for InflationResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ManageDataResultCode { Success = 0, @@ -35514,6 +35993,7 @@ impl WriteXdr for ManageDataResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ManageDataResult { Success, @@ -35648,6 +36128,7 @@ impl WriteXdr for ManageDataResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum BumpSequenceResultCode { Success = 0, @@ -35758,6 +36239,7 @@ impl WriteXdr for BumpSequenceResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum BumpSequenceResult { Success, @@ -35870,6 +36352,7 @@ impl WriteXdr for BumpSequenceResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum CreateClaimableBalanceResultCode { Success = 0, @@ -36008,6 +36491,7 @@ impl WriteXdr for CreateClaimableBalanceResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum CreateClaimableBalanceResult { Success(ClaimableBalanceId), @@ -36154,6 +36638,7 @@ impl WriteXdr for CreateClaimableBalanceResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClaimClaimableBalanceResultCode { Success = 0, @@ -36291,6 +36776,7 @@ impl WriteXdr for ClaimClaimableBalanceResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ClaimClaimableBalanceResult { Success, @@ -36436,6 +36922,7 @@ impl WriteXdr for ClaimClaimableBalanceResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum BeginSponsoringFutureReservesResultCode { Success = 0, @@ -36558,6 +37045,7 @@ impl WriteXdr for BeginSponsoringFutureReservesResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum BeginSponsoringFutureReservesResult { Success, @@ -36683,6 +37171,7 @@ impl WriteXdr for BeginSponsoringFutureReservesResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum EndSponsoringFutureReservesResultCode { Success = 0, @@ -36794,6 +37283,7 @@ impl WriteXdr for EndSponsoringFutureReservesResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum EndSponsoringFutureReservesResult { Success, @@ -36910,6 +37400,7 @@ impl WriteXdr for EndSponsoringFutureReservesResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum RevokeSponsorshipResultCode { Success = 0, @@ -37047,6 +37538,7 @@ impl WriteXdr for RevokeSponsorshipResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum RevokeSponsorshipResult { Success, @@ -37193,6 +37685,7 @@ impl WriteXdr for RevokeSponsorshipResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClawbackResultCode { Success = 0, @@ -37324,6 +37817,7 @@ impl WriteXdr for ClawbackResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ClawbackResult { Success, @@ -37461,6 +37955,7 @@ impl WriteXdr for ClawbackResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ClawbackClaimableBalanceResultCode { Success = 0, @@ -37583,6 +38078,7 @@ impl WriteXdr for ClawbackClaimableBalanceResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ClawbackClaimableBalanceResult { Success, @@ -37713,6 +38209,7 @@ impl WriteXdr for ClawbackClaimableBalanceResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum SetTrustLineFlagsResultCode { Success = 0, @@ -37850,6 +38347,7 @@ impl WriteXdr for SetTrustLineFlagsResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum SetTrustLineFlagsResult { Success, @@ -38003,6 +38501,7 @@ impl WriteXdr for SetTrustLineFlagsResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum LiquidityPoolDepositResultCode { Success = 0, @@ -38152,6 +38651,7 @@ impl WriteXdr for LiquidityPoolDepositResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LiquidityPoolDepositResult { Success, @@ -38316,6 +38816,7 @@ impl WriteXdr for LiquidityPoolDepositResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum LiquidityPoolWithdrawResultCode { Success = 0, @@ -38453,6 +38954,7 @@ impl WriteXdr for LiquidityPoolWithdrawResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum LiquidityPoolWithdrawResult { Success, @@ -38600,6 +39102,7 @@ impl WriteXdr for LiquidityPoolWithdrawResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum InvokeHostFunctionResultCode { Success = 0, @@ -38737,6 +39240,7 @@ impl WriteXdr for InvokeHostFunctionResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum InvokeHostFunctionResult { Success(Hash), @@ -38886,6 +39390,7 @@ impl WriteXdr for InvokeHostFunctionResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum ExtendFootprintTtlResultCode { Success = 0, @@ -39011,6 +39516,7 @@ impl WriteXdr for ExtendFootprintTtlResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ExtendFootprintTtlResult { Success, @@ -39146,6 +39652,7 @@ impl WriteXdr for ExtendFootprintTtlResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum RestoreFootprintResultCode { Success = 0, @@ -39271,6 +39778,7 @@ impl WriteXdr for RestoreFootprintResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum RestoreFootprintResult { Success, @@ -39407,6 +39915,7 @@ impl WriteXdr for RestoreFootprintResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum OperationResultCode { OpInner = 0, @@ -39595,6 +40104,7 @@ impl WriteXdr for OperationResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum OperationResultTr { CreateAccount(CreateAccountResult), @@ -39983,6 +40493,7 @@ impl WriteXdr for OperationResultTr { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum OperationResult { OpInner(OperationResultTr), @@ -40150,6 +40661,7 @@ impl WriteXdr for OperationResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum TransactionResultCode { TxFeeBumpInnerSuccess = 1, @@ -40365,6 +40877,7 @@ impl WriteXdr for TransactionResultCode { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum InnerTransactionResultResult { TxSuccess(VecM), @@ -40585,6 +41098,7 @@ impl WriteXdr for InnerTransactionResultResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum InnerTransactionResultExt { V0, @@ -40718,6 +41232,7 @@ impl WriteXdr for InnerTransactionResultExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct InnerTransactionResult { pub fee_charged: i64, pub result: InnerTransactionResultResult, @@ -40766,6 +41281,7 @@ impl WriteXdr for InnerTransactionResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct InnerTransactionResultPair { pub transaction_hash: Hash, pub result: InnerTransactionResult, @@ -40833,6 +41349,7 @@ impl WriteXdr for InnerTransactionResultPair { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionResultResult { TxFeeBumpInnerSuccess(InnerTransactionResultPair), @@ -41071,6 +41588,7 @@ impl WriteXdr for TransactionResultResult { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum TransactionResultExt { V0, @@ -41205,6 +41723,7 @@ impl WriteXdr for TransactionResultExt { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct TransactionResult { pub fee_charged: i64, pub result: TransactionResultResult, @@ -41278,6 +41797,39 @@ impl core::str::FromStr for Hash { hex::decode(s).map_err(|_| Error::InvalidHex)?.try_into() } } +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for Hash { + fn schema_name() -> String { + "Hash".to_string() + } + + fn is_referenceable() -> bool { + false + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let schema = String::json_schema(gen); + if let schemars::schema::Schema::Object(mut schema) = schema { + schema.extensions.insert( + "contentEncoding".to_owned(), + serde_json::Value::String("hex".to_string()), + ); + schema.extensions.insert( + "contentMediaType".to_owned(), + serde_json::Value::String("application/binary".to_string()), + ); + let string = *schema.string.unwrap_or_default().clone(); + schema.string = Some(Box::new(schemars::schema::StringValidation { + max_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), + ..string + })); + schema.into() + } else { + schema + } + } +} impl From for [u8; 32] { #[must_use] fn from(x: Hash) -> Self { @@ -41396,6 +41948,39 @@ impl core::str::FromStr for Uint256 { hex::decode(s).map_err(|_| Error::InvalidHex)?.try_into() } } +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for Uint256 { + fn schema_name() -> String { + "Uint256".to_string() + } + + fn is_referenceable() -> bool { + false + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let schema = String::json_schema(gen); + if let schemars::schema::Schema::Object(mut schema) = schema { + schema.extensions.insert( + "contentEncoding".to_owned(), + serde_json::Value::String("hex".to_string()), + ); + schema.extensions.insert( + "contentMediaType".to_owned(), + serde_json::Value::String("application/binary".to_string()), + ); + let string = *schema.string.unwrap_or_default().clone(); + schema.string = Some(Box::new(schemars::schema::StringValidation { + max_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 32_u32.checked_mul(2).map(Some).unwrap_or_default(), + ..string + })); + schema.into() + } else { + schema + } + } +} impl From for [u8; 32] { #[must_use] fn from(x: Uint256) -> Self { @@ -41517,6 +42102,7 @@ pub type Int64 = i64; derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct TimePoint(pub u64); @@ -41572,6 +42158,7 @@ impl WriteXdr for TimePoint { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct Duration(pub u64); @@ -41632,6 +42219,7 @@ impl WriteXdr for Duration { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] pub enum ExtensionPoint { V0, @@ -41737,6 +42325,7 @@ impl WriteXdr for ExtensionPoint { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum CryptoKeyType { Ed25519 = 0, @@ -41862,6 +42451,7 @@ impl WriteXdr for CryptoKeyType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum PublicKeyType { PublicKeyTypeEd25519 = 0, @@ -41966,6 +42556,7 @@ impl WriteXdr for PublicKeyType { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] pub enum SignerKeyType { Ed25519 = 0, @@ -42362,6 +42953,7 @@ impl WriteXdr for SignerKey { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[derive(Debug)] pub struct Signature(pub BytesM<64>); @@ -42495,6 +43087,39 @@ impl core::str::FromStr for SignatureHint { hex::decode(s).map_err(|_| Error::InvalidHex)?.try_into() } } +#[cfg(feature = "schemars")] +impl schemars::JsonSchema for SignatureHint { + fn schema_name() -> String { + "SignatureHint".to_string() + } + + fn is_referenceable() -> bool { + false + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let schema = String::json_schema(gen); + if let schemars::schema::Schema::Object(mut schema) = schema { + schema.extensions.insert( + "contentEncoding".to_owned(), + serde_json::Value::String("hex".to_string()), + ); + schema.extensions.insert( + "contentMediaType".to_owned(), + serde_json::Value::String("application/binary".to_string()), + ); + let string = *schema.string.unwrap_or_default().clone(); + schema.string = Some(Box::new(schemars::schema::StringValidation { + max_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), + min_length: 4_u32.checked_mul(2).map(Some).unwrap_or_default(), + ..string + })); + schema.into() + } else { + schema + } + } +} impl From for [u8; 4] { #[must_use] fn from(x: SignatureHint) -> Self { @@ -42695,6 +43320,7 @@ impl WriteXdr for AccountId { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Curve25519Secret { pub key: [u8; 32], } @@ -42736,6 +43362,7 @@ impl WriteXdr for Curve25519Secret { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Curve25519Public { pub key: [u8; 32], } @@ -42777,6 +43404,7 @@ impl WriteXdr for Curve25519Public { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct HmacSha256Key { pub key: [u8; 32], } @@ -42818,6 +43446,7 @@ impl WriteXdr for HmacSha256Key { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct HmacSha256Mac { pub mac: [u8; 32], } @@ -42849,6 +43478,7 @@ impl WriteXdr for HmacSha256Mac { derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub enum TypeVariant { Value, ScpBallot, @@ -44576,6 +45206,623 @@ impl TypeVariant { pub const fn variants() -> [TypeVariant; 425] { Self::VARIANTS } + + #[cfg(feature = "schemars")] + #[must_use] + #[allow(clippy::too_many_lines)] + pub fn json_schema(&self, gen: schemars::gen::SchemaGenerator) -> schemars::schema::RootSchema { + match self { + Self::Value => gen.into_root_schema_for::(), + Self::ScpBallot => gen.into_root_schema_for::(), + Self::ScpStatementType => gen.into_root_schema_for::(), + Self::ScpNomination => gen.into_root_schema_for::(), + Self::ScpStatement => gen.into_root_schema_for::(), + Self::ScpStatementPledges => gen.into_root_schema_for::(), + Self::ScpStatementPrepare => gen.into_root_schema_for::(), + Self::ScpStatementConfirm => gen.into_root_schema_for::(), + Self::ScpStatementExternalize => gen.into_root_schema_for::(), + Self::ScpEnvelope => gen.into_root_schema_for::(), + Self::ScpQuorumSet => gen.into_root_schema_for::(), + Self::ConfigSettingContractExecutionLanesV0 => { + gen.into_root_schema_for::() + } + Self::ConfigSettingContractComputeV0 => { + gen.into_root_schema_for::() + } + Self::ConfigSettingContractLedgerCostV0 => { + gen.into_root_schema_for::() + } + Self::ConfigSettingContractHistoricalDataV0 => { + gen.into_root_schema_for::() + } + Self::ConfigSettingContractEventsV0 => { + gen.into_root_schema_for::() + } + Self::ConfigSettingContractBandwidthV0 => { + gen.into_root_schema_for::() + } + Self::ContractCostType => gen.into_root_schema_for::(), + Self::ContractCostParamEntry => gen.into_root_schema_for::(), + Self::StateArchivalSettings => gen.into_root_schema_for::(), + Self::EvictionIterator => gen.into_root_schema_for::(), + Self::ContractCostParams => gen.into_root_schema_for::(), + Self::ConfigSettingId => gen.into_root_schema_for::(), + Self::ConfigSettingEntry => gen.into_root_schema_for::(), + Self::ScEnvMetaKind => gen.into_root_schema_for::(), + Self::ScEnvMetaEntry => gen.into_root_schema_for::(), + Self::ScMetaV0 => gen.into_root_schema_for::(), + Self::ScMetaKind => gen.into_root_schema_for::(), + Self::ScMetaEntry => gen.into_root_schema_for::(), + Self::ScSpecType => gen.into_root_schema_for::(), + Self::ScSpecTypeOption => gen.into_root_schema_for::(), + Self::ScSpecTypeResult => gen.into_root_schema_for::(), + Self::ScSpecTypeVec => gen.into_root_schema_for::(), + Self::ScSpecTypeMap => gen.into_root_schema_for::(), + Self::ScSpecTypeTuple => gen.into_root_schema_for::(), + Self::ScSpecTypeBytesN => gen.into_root_schema_for::(), + Self::ScSpecTypeUdt => gen.into_root_schema_for::(), + Self::ScSpecTypeDef => gen.into_root_schema_for::(), + Self::ScSpecUdtStructFieldV0 => gen.into_root_schema_for::(), + Self::ScSpecUdtStructV0 => gen.into_root_schema_for::(), + Self::ScSpecUdtUnionCaseVoidV0 => { + gen.into_root_schema_for::() + } + Self::ScSpecUdtUnionCaseTupleV0 => { + gen.into_root_schema_for::() + } + Self::ScSpecUdtUnionCaseV0Kind => { + gen.into_root_schema_for::() + } + Self::ScSpecUdtUnionCaseV0 => gen.into_root_schema_for::(), + Self::ScSpecUdtUnionV0 => gen.into_root_schema_for::(), + Self::ScSpecUdtEnumCaseV0 => gen.into_root_schema_for::(), + Self::ScSpecUdtEnumV0 => gen.into_root_schema_for::(), + Self::ScSpecUdtErrorEnumCaseV0 => { + gen.into_root_schema_for::() + } + Self::ScSpecUdtErrorEnumV0 => gen.into_root_schema_for::(), + Self::ScSpecFunctionInputV0 => gen.into_root_schema_for::(), + Self::ScSpecFunctionV0 => gen.into_root_schema_for::(), + Self::ScSpecEntryKind => gen.into_root_schema_for::(), + Self::ScSpecEntry => gen.into_root_schema_for::(), + Self::ScValType => gen.into_root_schema_for::(), + Self::ScErrorType => gen.into_root_schema_for::(), + Self::ScErrorCode => gen.into_root_schema_for::(), + Self::ScError => gen.into_root_schema_for::(), + Self::UInt128Parts => gen.into_root_schema_for::(), + Self::Int128Parts => gen.into_root_schema_for::(), + Self::UInt256Parts => gen.into_root_schema_for::(), + Self::Int256Parts => gen.into_root_schema_for::(), + Self::ContractExecutableType => gen.into_root_schema_for::(), + Self::ContractExecutable => gen.into_root_schema_for::(), + Self::ScAddressType => gen.into_root_schema_for::(), + Self::ScAddress => gen.into_root_schema_for::(), + Self::ScVec => gen.into_root_schema_for::(), + Self::ScMap => gen.into_root_schema_for::(), + Self::ScBytes => gen.into_root_schema_for::(), + Self::ScString => gen.into_root_schema_for::(), + Self::ScSymbol => gen.into_root_schema_for::(), + Self::ScNonceKey => gen.into_root_schema_for::(), + Self::ScContractInstance => gen.into_root_schema_for::(), + Self::ScVal => gen.into_root_schema_for::(), + Self::ScMapEntry => gen.into_root_schema_for::(), + Self::StoredTransactionSet => gen.into_root_schema_for::(), + Self::StoredDebugTransactionSet => { + gen.into_root_schema_for::() + } + Self::PersistedScpStateV0 => gen.into_root_schema_for::(), + Self::PersistedScpStateV1 => gen.into_root_schema_for::(), + Self::PersistedScpState => gen.into_root_schema_for::(), + Self::Thresholds => gen.into_root_schema_for::(), + Self::String32 => gen.into_root_schema_for::(), + Self::String64 => gen.into_root_schema_for::(), + Self::SequenceNumber => gen.into_root_schema_for::(), + Self::DataValue => gen.into_root_schema_for::(), + Self::PoolId => gen.into_root_schema_for::(), + Self::AssetCode4 => gen.into_root_schema_for::(), + Self::AssetCode12 => gen.into_root_schema_for::(), + Self::AssetType => gen.into_root_schema_for::(), + Self::AssetCode => gen.into_root_schema_for::(), + Self::AlphaNum4 => gen.into_root_schema_for::(), + Self::AlphaNum12 => gen.into_root_schema_for::(), + Self::Asset => gen.into_root_schema_for::(), + Self::Price => gen.into_root_schema_for::(), + Self::Liabilities => gen.into_root_schema_for::(), + Self::ThresholdIndexes => gen.into_root_schema_for::(), + Self::LedgerEntryType => gen.into_root_schema_for::(), + Self::Signer => gen.into_root_schema_for::(), + Self::AccountFlags => gen.into_root_schema_for::(), + Self::SponsorshipDescriptor => gen.into_root_schema_for::(), + Self::AccountEntryExtensionV3 => gen.into_root_schema_for::(), + Self::AccountEntryExtensionV2 => gen.into_root_schema_for::(), + Self::AccountEntryExtensionV2Ext => { + gen.into_root_schema_for::() + } + Self::AccountEntryExtensionV1 => gen.into_root_schema_for::(), + Self::AccountEntryExtensionV1Ext => { + gen.into_root_schema_for::() + } + Self::AccountEntry => gen.into_root_schema_for::(), + Self::AccountEntryExt => gen.into_root_schema_for::(), + Self::TrustLineFlags => gen.into_root_schema_for::(), + Self::LiquidityPoolType => gen.into_root_schema_for::(), + Self::TrustLineAsset => gen.into_root_schema_for::(), + Self::TrustLineEntryExtensionV2 => { + gen.into_root_schema_for::() + } + Self::TrustLineEntryExtensionV2Ext => { + gen.into_root_schema_for::() + } + Self::TrustLineEntry => gen.into_root_schema_for::(), + Self::TrustLineEntryExt => gen.into_root_schema_for::(), + Self::TrustLineEntryV1 => gen.into_root_schema_for::(), + Self::TrustLineEntryV1Ext => gen.into_root_schema_for::(), + Self::OfferEntryFlags => gen.into_root_schema_for::(), + Self::OfferEntry => gen.into_root_schema_for::(), + Self::OfferEntryExt => gen.into_root_schema_for::(), + Self::DataEntry => gen.into_root_schema_for::(), + Self::DataEntryExt => gen.into_root_schema_for::(), + Self::ClaimPredicateType => gen.into_root_schema_for::(), + Self::ClaimPredicate => gen.into_root_schema_for::(), + Self::ClaimantType => gen.into_root_schema_for::(), + Self::Claimant => gen.into_root_schema_for::(), + Self::ClaimantV0 => gen.into_root_schema_for::(), + Self::ClaimableBalanceIdType => gen.into_root_schema_for::(), + Self::ClaimableBalanceId => gen.into_root_schema_for::(), + Self::ClaimableBalanceFlags => gen.into_root_schema_for::(), + Self::ClaimableBalanceEntryExtensionV1 => { + gen.into_root_schema_for::() + } + Self::ClaimableBalanceEntryExtensionV1Ext => { + gen.into_root_schema_for::() + } + Self::ClaimableBalanceEntry => gen.into_root_schema_for::(), + Self::ClaimableBalanceEntryExt => { + gen.into_root_schema_for::() + } + Self::LiquidityPoolConstantProductParameters => { + gen.into_root_schema_for::() + } + Self::LiquidityPoolEntry => gen.into_root_schema_for::(), + Self::LiquidityPoolEntryBody => gen.into_root_schema_for::(), + Self::LiquidityPoolEntryConstantProduct => { + gen.into_root_schema_for::() + } + Self::ContractDataDurability => gen.into_root_schema_for::(), + Self::ContractDataEntry => gen.into_root_schema_for::(), + Self::ContractCodeCostInputs => gen.into_root_schema_for::(), + Self::ContractCodeEntry => gen.into_root_schema_for::(), + Self::ContractCodeEntryExt => gen.into_root_schema_for::(), + Self::ContractCodeEntryV1 => gen.into_root_schema_for::(), + Self::TtlEntry => gen.into_root_schema_for::(), + Self::LedgerEntryExtensionV1 => gen.into_root_schema_for::(), + Self::LedgerEntryExtensionV1Ext => { + gen.into_root_schema_for::() + } + Self::LedgerEntry => gen.into_root_schema_for::(), + Self::LedgerEntryData => gen.into_root_schema_for::(), + Self::LedgerEntryExt => gen.into_root_schema_for::(), + Self::LedgerKey => gen.into_root_schema_for::(), + Self::LedgerKeyAccount => gen.into_root_schema_for::(), + Self::LedgerKeyTrustLine => gen.into_root_schema_for::(), + Self::LedgerKeyOffer => gen.into_root_schema_for::(), + Self::LedgerKeyData => gen.into_root_schema_for::(), + Self::LedgerKeyClaimableBalance => { + gen.into_root_schema_for::() + } + Self::LedgerKeyLiquidityPool => gen.into_root_schema_for::(), + Self::LedgerKeyContractData => gen.into_root_schema_for::(), + Self::LedgerKeyContractCode => gen.into_root_schema_for::(), + Self::LedgerKeyConfigSetting => gen.into_root_schema_for::(), + Self::LedgerKeyTtl => gen.into_root_schema_for::(), + Self::EnvelopeType => gen.into_root_schema_for::(), + Self::UpgradeType => gen.into_root_schema_for::(), + Self::StellarValueType => gen.into_root_schema_for::(), + Self::LedgerCloseValueSignature => { + gen.into_root_schema_for::() + } + Self::StellarValue => gen.into_root_schema_for::(), + Self::StellarValueExt => gen.into_root_schema_for::(), + Self::LedgerHeaderFlags => gen.into_root_schema_for::(), + Self::LedgerHeaderExtensionV1 => gen.into_root_schema_for::(), + Self::LedgerHeaderExtensionV1Ext => { + gen.into_root_schema_for::() + } + Self::LedgerHeader => gen.into_root_schema_for::(), + Self::LedgerHeaderExt => gen.into_root_schema_for::(), + Self::LedgerUpgradeType => gen.into_root_schema_for::(), + Self::ConfigUpgradeSetKey => gen.into_root_schema_for::(), + Self::LedgerUpgrade => gen.into_root_schema_for::(), + Self::ConfigUpgradeSet => gen.into_root_schema_for::(), + Self::BucketEntryType => gen.into_root_schema_for::(), + Self::BucketMetadata => gen.into_root_schema_for::(), + Self::BucketMetadataExt => gen.into_root_schema_for::(), + Self::BucketEntry => gen.into_root_schema_for::(), + Self::TxSetComponentType => gen.into_root_schema_for::(), + Self::TxSetComponent => gen.into_root_schema_for::(), + Self::TxSetComponentTxsMaybeDiscountedFee => { + gen.into_root_schema_for::() + } + Self::TransactionPhase => gen.into_root_schema_for::(), + Self::TransactionSet => gen.into_root_schema_for::(), + Self::TransactionSetV1 => gen.into_root_schema_for::(), + Self::GeneralizedTransactionSet => { + gen.into_root_schema_for::() + } + Self::TransactionResultPair => gen.into_root_schema_for::(), + Self::TransactionResultSet => gen.into_root_schema_for::(), + Self::TransactionHistoryEntry => gen.into_root_schema_for::(), + Self::TransactionHistoryEntryExt => { + gen.into_root_schema_for::() + } + Self::TransactionHistoryResultEntry => { + gen.into_root_schema_for::() + } + Self::TransactionHistoryResultEntryExt => { + gen.into_root_schema_for::() + } + Self::LedgerHeaderHistoryEntry => { + gen.into_root_schema_for::() + } + Self::LedgerHeaderHistoryEntryExt => { + gen.into_root_schema_for::() + } + Self::LedgerScpMessages => gen.into_root_schema_for::(), + Self::ScpHistoryEntryV0 => gen.into_root_schema_for::(), + Self::ScpHistoryEntry => gen.into_root_schema_for::(), + Self::LedgerEntryChangeType => gen.into_root_schema_for::(), + Self::LedgerEntryChange => gen.into_root_schema_for::(), + Self::LedgerEntryChanges => gen.into_root_schema_for::(), + Self::OperationMeta => gen.into_root_schema_for::(), + Self::TransactionMetaV1 => gen.into_root_schema_for::(), + Self::TransactionMetaV2 => gen.into_root_schema_for::(), + Self::ContractEventType => gen.into_root_schema_for::(), + Self::ContractEvent => gen.into_root_schema_for::(), + Self::ContractEventBody => gen.into_root_schema_for::(), + Self::ContractEventV0 => gen.into_root_schema_for::(), + Self::DiagnosticEvent => gen.into_root_schema_for::(), + Self::SorobanTransactionMetaExtV1 => { + gen.into_root_schema_for::() + } + Self::SorobanTransactionMetaExt => { + gen.into_root_schema_for::() + } + Self::SorobanTransactionMeta => gen.into_root_schema_for::(), + Self::TransactionMetaV3 => gen.into_root_schema_for::(), + Self::InvokeHostFunctionSuccessPreImage => { + gen.into_root_schema_for::() + } + Self::TransactionMeta => gen.into_root_schema_for::(), + Self::TransactionResultMeta => gen.into_root_schema_for::(), + Self::UpgradeEntryMeta => gen.into_root_schema_for::(), + Self::LedgerCloseMetaV0 => gen.into_root_schema_for::(), + Self::LedgerCloseMetaExtV1 => gen.into_root_schema_for::(), + Self::LedgerCloseMetaExt => gen.into_root_schema_for::(), + Self::LedgerCloseMetaV1 => gen.into_root_schema_for::(), + Self::LedgerCloseMeta => gen.into_root_schema_for::(), + Self::ErrorCode => gen.into_root_schema_for::(), + Self::SError => gen.into_root_schema_for::(), + Self::SendMore => gen.into_root_schema_for::(), + Self::SendMoreExtended => gen.into_root_schema_for::(), + Self::AuthCert => gen.into_root_schema_for::(), + Self::Hello => gen.into_root_schema_for::(), + Self::Auth => gen.into_root_schema_for::(), + Self::IpAddrType => gen.into_root_schema_for::(), + Self::PeerAddress => gen.into_root_schema_for::(), + Self::PeerAddressIp => gen.into_root_schema_for::(), + Self::MessageType => gen.into_root_schema_for::(), + Self::DontHave => gen.into_root_schema_for::(), + Self::SurveyMessageCommandType => { + gen.into_root_schema_for::() + } + Self::SurveyMessageResponseType => { + gen.into_root_schema_for::() + } + Self::SurveyRequestMessage => gen.into_root_schema_for::(), + Self::SignedSurveyRequestMessage => { + gen.into_root_schema_for::() + } + Self::EncryptedBody => gen.into_root_schema_for::(), + Self::SurveyResponseMessage => gen.into_root_schema_for::(), + Self::SignedSurveyResponseMessage => { + gen.into_root_schema_for::() + } + Self::PeerStats => gen.into_root_schema_for::(), + Self::PeerStatList => gen.into_root_schema_for::(), + Self::TopologyResponseBodyV0 => gen.into_root_schema_for::(), + Self::TopologyResponseBodyV1 => gen.into_root_schema_for::(), + Self::SurveyResponseBody => gen.into_root_schema_for::(), + Self::TxAdvertVector => gen.into_root_schema_for::(), + Self::FloodAdvert => gen.into_root_schema_for::(), + Self::TxDemandVector => gen.into_root_schema_for::(), + Self::FloodDemand => gen.into_root_schema_for::(), + Self::StellarMessage => gen.into_root_schema_for::(), + Self::AuthenticatedMessage => gen.into_root_schema_for::(), + Self::AuthenticatedMessageV0 => gen.into_root_schema_for::(), + Self::LiquidityPoolParameters => gen.into_root_schema_for::(), + Self::MuxedAccount => gen.into_root_schema_for::(), + Self::MuxedAccountMed25519 => gen.into_root_schema_for::(), + Self::DecoratedSignature => gen.into_root_schema_for::(), + Self::OperationType => gen.into_root_schema_for::(), + Self::CreateAccountOp => gen.into_root_schema_for::(), + Self::PaymentOp => gen.into_root_schema_for::(), + Self::PathPaymentStrictReceiveOp => { + gen.into_root_schema_for::() + } + Self::PathPaymentStrictSendOp => gen.into_root_schema_for::(), + Self::ManageSellOfferOp => gen.into_root_schema_for::(), + Self::ManageBuyOfferOp => gen.into_root_schema_for::(), + Self::CreatePassiveSellOfferOp => { + gen.into_root_schema_for::() + } + Self::SetOptionsOp => gen.into_root_schema_for::(), + Self::ChangeTrustAsset => gen.into_root_schema_for::(), + Self::ChangeTrustOp => gen.into_root_schema_for::(), + Self::AllowTrustOp => gen.into_root_schema_for::(), + Self::ManageDataOp => gen.into_root_schema_for::(), + Self::BumpSequenceOp => gen.into_root_schema_for::(), + Self::CreateClaimableBalanceOp => { + gen.into_root_schema_for::() + } + Self::ClaimClaimableBalanceOp => gen.into_root_schema_for::(), + Self::BeginSponsoringFutureReservesOp => { + gen.into_root_schema_for::() + } + Self::RevokeSponsorshipType => gen.into_root_schema_for::(), + Self::RevokeSponsorshipOp => gen.into_root_schema_for::(), + Self::RevokeSponsorshipOpSigner => { + gen.into_root_schema_for::() + } + Self::ClawbackOp => gen.into_root_schema_for::(), + Self::ClawbackClaimableBalanceOp => { + gen.into_root_schema_for::() + } + Self::SetTrustLineFlagsOp => gen.into_root_schema_for::(), + Self::LiquidityPoolDepositOp => gen.into_root_schema_for::(), + Self::LiquidityPoolWithdrawOp => gen.into_root_schema_for::(), + Self::HostFunctionType => gen.into_root_schema_for::(), + Self::ContractIdPreimageType => gen.into_root_schema_for::(), + Self::ContractIdPreimage => gen.into_root_schema_for::(), + Self::ContractIdPreimageFromAddress => { + gen.into_root_schema_for::() + } + Self::CreateContractArgs => gen.into_root_schema_for::(), + Self::InvokeContractArgs => gen.into_root_schema_for::(), + Self::HostFunction => gen.into_root_schema_for::(), + Self::SorobanAuthorizedFunctionType => { + gen.into_root_schema_for::() + } + Self::SorobanAuthorizedFunction => { + gen.into_root_schema_for::() + } + Self::SorobanAuthorizedInvocation => { + gen.into_root_schema_for::() + } + Self::SorobanAddressCredentials => { + gen.into_root_schema_for::() + } + Self::SorobanCredentialsType => gen.into_root_schema_for::(), + Self::SorobanCredentials => gen.into_root_schema_for::(), + Self::SorobanAuthorizationEntry => { + gen.into_root_schema_for::() + } + Self::InvokeHostFunctionOp => gen.into_root_schema_for::(), + Self::ExtendFootprintTtlOp => gen.into_root_schema_for::(), + Self::RestoreFootprintOp => gen.into_root_schema_for::(), + Self::Operation => gen.into_root_schema_for::(), + Self::OperationBody => gen.into_root_schema_for::(), + Self::HashIdPreimage => gen.into_root_schema_for::(), + Self::HashIdPreimageOperationId => { + gen.into_root_schema_for::() + } + Self::HashIdPreimageRevokeId => gen.into_root_schema_for::(), + Self::HashIdPreimageContractId => { + gen.into_root_schema_for::() + } + Self::HashIdPreimageSorobanAuthorization => { + gen.into_root_schema_for::() + } + Self::MemoType => gen.into_root_schema_for::(), + Self::Memo => gen.into_root_schema_for::(), + Self::TimeBounds => gen.into_root_schema_for::(), + Self::LedgerBounds => gen.into_root_schema_for::(), + Self::PreconditionsV2 => gen.into_root_schema_for::(), + Self::PreconditionType => gen.into_root_schema_for::(), + Self::Preconditions => gen.into_root_schema_for::(), + Self::LedgerFootprint => gen.into_root_schema_for::(), + Self::SorobanResources => gen.into_root_schema_for::(), + Self::SorobanTransactionData => gen.into_root_schema_for::(), + Self::TransactionV0 => gen.into_root_schema_for::(), + Self::TransactionV0Ext => gen.into_root_schema_for::(), + Self::TransactionV0Envelope => gen.into_root_schema_for::(), + Self::Transaction => gen.into_root_schema_for::(), + Self::TransactionExt => gen.into_root_schema_for::(), + Self::TransactionV1Envelope => gen.into_root_schema_for::(), + Self::FeeBumpTransaction => gen.into_root_schema_for::(), + Self::FeeBumpTransactionInnerTx => { + gen.into_root_schema_for::() + } + Self::FeeBumpTransactionExt => gen.into_root_schema_for::(), + Self::FeeBumpTransactionEnvelope => { + gen.into_root_schema_for::() + } + Self::TransactionEnvelope => gen.into_root_schema_for::(), + Self::TransactionSignaturePayload => { + gen.into_root_schema_for::() + } + Self::TransactionSignaturePayloadTaggedTransaction => { + gen.into_root_schema_for::() + } + Self::ClaimAtomType => gen.into_root_schema_for::(), + Self::ClaimOfferAtomV0 => gen.into_root_schema_for::(), + Self::ClaimOfferAtom => gen.into_root_schema_for::(), + Self::ClaimLiquidityAtom => gen.into_root_schema_for::(), + Self::ClaimAtom => gen.into_root_schema_for::(), + Self::CreateAccountResultCode => gen.into_root_schema_for::(), + Self::CreateAccountResult => gen.into_root_schema_for::(), + Self::PaymentResultCode => gen.into_root_schema_for::(), + Self::PaymentResult => gen.into_root_schema_for::(), + Self::PathPaymentStrictReceiveResultCode => { + gen.into_root_schema_for::() + } + Self::SimplePaymentResult => gen.into_root_schema_for::(), + Self::PathPaymentStrictReceiveResult => { + gen.into_root_schema_for::() + } + Self::PathPaymentStrictReceiveResultSuccess => { + gen.into_root_schema_for::() + } + Self::PathPaymentStrictSendResultCode => { + gen.into_root_schema_for::() + } + Self::PathPaymentStrictSendResult => { + gen.into_root_schema_for::() + } + Self::PathPaymentStrictSendResultSuccess => { + gen.into_root_schema_for::() + } + Self::ManageSellOfferResultCode => { + gen.into_root_schema_for::() + } + Self::ManageOfferEffect => gen.into_root_schema_for::(), + Self::ManageOfferSuccessResult => { + gen.into_root_schema_for::() + } + Self::ManageOfferSuccessResultOffer => { + gen.into_root_schema_for::() + } + Self::ManageSellOfferResult => gen.into_root_schema_for::(), + Self::ManageBuyOfferResultCode => { + gen.into_root_schema_for::() + } + Self::ManageBuyOfferResult => gen.into_root_schema_for::(), + Self::SetOptionsResultCode => gen.into_root_schema_for::(), + Self::SetOptionsResult => gen.into_root_schema_for::(), + Self::ChangeTrustResultCode => gen.into_root_schema_for::(), + Self::ChangeTrustResult => gen.into_root_schema_for::(), + Self::AllowTrustResultCode => gen.into_root_schema_for::(), + Self::AllowTrustResult => gen.into_root_schema_for::(), + Self::AccountMergeResultCode => gen.into_root_schema_for::(), + Self::AccountMergeResult => gen.into_root_schema_for::(), + Self::InflationResultCode => gen.into_root_schema_for::(), + Self::InflationPayout => gen.into_root_schema_for::(), + Self::InflationResult => gen.into_root_schema_for::(), + Self::ManageDataResultCode => gen.into_root_schema_for::(), + Self::ManageDataResult => gen.into_root_schema_for::(), + Self::BumpSequenceResultCode => gen.into_root_schema_for::(), + Self::BumpSequenceResult => gen.into_root_schema_for::(), + Self::CreateClaimableBalanceResultCode => { + gen.into_root_schema_for::() + } + Self::CreateClaimableBalanceResult => { + gen.into_root_schema_for::() + } + Self::ClaimClaimableBalanceResultCode => { + gen.into_root_schema_for::() + } + Self::ClaimClaimableBalanceResult => { + gen.into_root_schema_for::() + } + Self::BeginSponsoringFutureReservesResultCode => { + gen.into_root_schema_for::() + } + Self::BeginSponsoringFutureReservesResult => { + gen.into_root_schema_for::() + } + Self::EndSponsoringFutureReservesResultCode => { + gen.into_root_schema_for::() + } + Self::EndSponsoringFutureReservesResult => { + gen.into_root_schema_for::() + } + Self::RevokeSponsorshipResultCode => { + gen.into_root_schema_for::() + } + Self::RevokeSponsorshipResult => gen.into_root_schema_for::(), + Self::ClawbackResultCode => gen.into_root_schema_for::(), + Self::ClawbackResult => gen.into_root_schema_for::(), + Self::ClawbackClaimableBalanceResultCode => { + gen.into_root_schema_for::() + } + Self::ClawbackClaimableBalanceResult => { + gen.into_root_schema_for::() + } + Self::SetTrustLineFlagsResultCode => { + gen.into_root_schema_for::() + } + Self::SetTrustLineFlagsResult => gen.into_root_schema_for::(), + Self::LiquidityPoolDepositResultCode => { + gen.into_root_schema_for::() + } + Self::LiquidityPoolDepositResult => { + gen.into_root_schema_for::() + } + Self::LiquidityPoolWithdrawResultCode => { + gen.into_root_schema_for::() + } + Self::LiquidityPoolWithdrawResult => { + gen.into_root_schema_for::() + } + Self::InvokeHostFunctionResultCode => { + gen.into_root_schema_for::() + } + Self::InvokeHostFunctionResult => { + gen.into_root_schema_for::() + } + Self::ExtendFootprintTtlResultCode => { + gen.into_root_schema_for::() + } + Self::ExtendFootprintTtlResult => { + gen.into_root_schema_for::() + } + Self::RestoreFootprintResultCode => { + gen.into_root_schema_for::() + } + Self::RestoreFootprintResult => gen.into_root_schema_for::(), + Self::OperationResultCode => gen.into_root_schema_for::(), + Self::OperationResult => gen.into_root_schema_for::(), + Self::OperationResultTr => gen.into_root_schema_for::(), + Self::TransactionResultCode => gen.into_root_schema_for::(), + Self::InnerTransactionResult => gen.into_root_schema_for::(), + Self::InnerTransactionResultResult => { + gen.into_root_schema_for::() + } + Self::InnerTransactionResultExt => { + gen.into_root_schema_for::() + } + Self::InnerTransactionResultPair => { + gen.into_root_schema_for::() + } + Self::TransactionResult => gen.into_root_schema_for::(), + Self::TransactionResultResult => gen.into_root_schema_for::(), + Self::TransactionResultExt => gen.into_root_schema_for::(), + Self::Hash => gen.into_root_schema_for::(), + Self::Uint256 => gen.into_root_schema_for::(), + Self::Uint32 => gen.into_root_schema_for::(), + Self::Int32 => gen.into_root_schema_for::(), + Self::Uint64 => gen.into_root_schema_for::(), + Self::Int64 => gen.into_root_schema_for::(), + Self::TimePoint => gen.into_root_schema_for::(), + Self::Duration => gen.into_root_schema_for::(), + Self::ExtensionPoint => gen.into_root_schema_for::(), + Self::CryptoKeyType => gen.into_root_schema_for::(), + Self::PublicKeyType => gen.into_root_schema_for::(), + Self::SignerKeyType => gen.into_root_schema_for::(), + Self::PublicKey => gen.into_root_schema_for::(), + Self::SignerKey => gen.into_root_schema_for::(), + Self::SignerKeyEd25519SignedPayload => { + gen.into_root_schema_for::() + } + Self::Signature => gen.into_root_schema_for::(), + Self::SignatureHint => gen.into_root_schema_for::(), + Self::NodeId => gen.into_root_schema_for::(), + Self::AccountId => gen.into_root_schema_for::(), + Self::Curve25519Secret => gen.into_root_schema_for::(), + Self::Curve25519Public => gen.into_root_schema_for::(), + Self::HmacSha256Key => gen.into_root_schema_for::(), + Self::HmacSha256Mac => gen.into_root_schema_for::(), + } + } } impl Name for TypeVariant { @@ -45047,6 +46294,7 @@ impl core::str::FromStr for TypeVariant { serde(rename_all = "snake_case"), serde(untagged) )] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub enum Type { Value(Box), ScpBallot(Box), diff --git a/src/next/jsonschema.rs b/src/next/jsonschema.rs new file mode 100644 index 00000000..b70c3035 --- /dev/null +++ b/src/next/jsonschema.rs @@ -0,0 +1,29 @@ +#![cfg(feature = "schemars")] +use schemars::{gen::SchemaGenerator, schema::Schema, JsonSchema}; + +macro_rules! impl_json_schema_string { + ($type:ident) => { + impl JsonSchema for super::$type { + fn schema_name() -> String { + stringify!($type).to_string() + } + + fn json_schema(gen: &mut SchemaGenerator) -> Schema { + String::json_schema(gen) + } + } + }; +} + +impl_json_schema_string!(PublicKey); +impl_json_schema_string!(AccountId); +impl_json_schema_string!(MuxedAccount); +impl_json_schema_string!(MuxedAccountMed25519); +impl_json_schema_string!(SignerKey); +impl_json_schema_string!(SignerKeyEd25519SignedPayload); +impl_json_schema_string!(NodeId); +impl_json_schema_string!(ScAddress); +impl_json_schema_string!(AssetCode); +impl_json_schema_string!(AssetCode4); +impl_json_schema_string!(AssetCode12); +impl_json_schema_string!(ClaimableBalanceId); diff --git a/src/next/mod.rs b/src/next/mod.rs index 288c1e2e..ec2f1e37 100644 --- a/src/next/mod.rs +++ b/src/next/mod.rs @@ -1,6 +1,7 @@ mod generated; pub use generated::*; +mod jsonschema; mod str; mod scval_conversions; diff --git a/tests/serde_tx_schema.rs b/tests/serde_tx_schema.rs new file mode 100644 index 00000000..1c4a95fc --- /dev/null +++ b/tests/serde_tx_schema.rs @@ -0,0 +1,13 @@ +#![cfg(feature = "curr")] +#![cfg(all(feature = "schemars", feature = "serde", feature = "alloc"))] + +use stellar_xdr::curr as stellar_xdr; + +#[allow(clippy::too_many_lines)] +#[test] +fn test_serde_tx_schema() -> Result<(), Box> { + let schema = schemars::schema_for!(stellar_xdr::ScVal); + let s = serde_json::to_string_pretty(&schema)?; + println!("{s}"); + Ok(()) +}