From 21c1f173e0f3e6c905218603e560c16b69748fac Mon Sep 17 00:00:00 2001 From: nils-mathieu Date: Tue, 24 Oct 2023 21:27:49 +0200 Subject: [PATCH] feat(rpc/generator): allow renaming and replacing types --- .../generator/example-fixes.toml | 14 + .../generator/src/config.rs | 30 + .../generator/src/gen/general.rs | 38 +- .../src/gen/method_name_constants.rs | 23 +- .../generator/src/gen/method_param_types.rs | 31 +- .../generator/src/gen/method_result_types.rs | 30 +- .../generator/src/gen/type_aliases.rs | 7 +- .../generator/src/openrpc/parse.rs | 59 +- .../generator/src/openrpc/parsed.rs | 20 +- crates/starknet-types-rpc/generator/test.txt | 7855 ----------------- 10 files changed, 189 insertions(+), 7918 deletions(-) delete mode 100644 crates/starknet-types-rpc/generator/test.txt diff --git a/crates/starknet-types-rpc/generator/example-fixes.toml b/crates/starknet-types-rpc/generator/example-fixes.toml index fb703ca..10f7852 100644 --- a/crates/starknet-types-rpc/generator/example-fixes.toml +++ b/crates/starknet-types-rpc/generator/example-fixes.toml @@ -1 +1,15 @@ imports = ["stark_felt::Felt"] + +removed-symbols = [ + # Tagged Enums + "#/components/schemas/DECLARE_TXN_V0/DECLARE_TXN_V0/version", + "#/components/schemas/DECLARE_TXN_V1/DECLARE_TXN_V1/version", + "#/components/schemas/DECLARE_TXN_V2/DECLARE_TXN_V2/version", +] + +[tagged-enums] +"#/components/schemas/DECLARE_TXN" = "version" + +[renamed-symbols] +# Anonymous Structs +"#/components/schemas/BLOCK_BODY_WITH_TXS/transactions/ANONYMOUS/ANONYMOUS" = "TxnWithHash" diff --git a/crates/starknet-types-rpc/generator/src/config.rs b/crates/starknet-types-rpc/generator/src/config.rs index 911523d..f78c467 100644 --- a/crates/starknet-types-rpc/generator/src/config.rs +++ b/crates/starknet-types-rpc/generator/src/config.rs @@ -1,3 +1,5 @@ +use std::collections::{BTreeMap, BTreeSet}; + /// Configures the `method-name-constants` feature. #[derive(Debug, Clone, serde::Deserialize)] #[serde(deny_unknown_fields, rename_all = "kebab-case")] @@ -167,6 +169,34 @@ pub struct Fixes { /// A list of imports that should be added at the top of the generated file. #[serde(default)] pub imports: Vec, + /// A list of tagged enums that should be generated. + /// + /// # Examples + /// + /// ``` + /// #[derive(Serialize, Deserialize)] + /// #[serde(tag = "version")] + /// struct Foo { + /// #[serde(rename = "0x0")] + /// V0(A), + /// #[serde(rename = "0x1")] + /// V1(B), + /// } + /// ``` + /// + /// # Notes + /// + /// This does not remove the corresponding field in child structs. + pub tagged_enums: BTreeMap, + /// A list of symbols to remove. + /// + /// That may include types, consts, functions, fields, etc. Note that references to those + /// symbols will *not* be removed. Only the *definition* is removed. + pub removed_symbols: BTreeSet, + /// A list of symbols to rename. + /// + /// This is basically mandatory for anonymous types. + pub renamed_symbols: BTreeMap, } /// Defines function that return the default value of some config fields. diff --git a/crates/starknet-types-rpc/generator/src/gen/general.rs b/crates/starknet-types-rpc/generator/src/gen/general.rs index e583154..a80ca99 100644 --- a/crates/starknet-types-rpc/generator/src/gen/general.rs +++ b/crates/starknet-types-rpc/generator/src/gen/general.rs @@ -8,18 +8,18 @@ use super::Generator; /// declared in the provided document. pub fn generate(gen: &mut Generator) -> io::Result<()> { for ty in &gen.spec.types { + if gen.fixes.removed_symbols.contains(&ty.path) { + continue; + } + + let name = gen.fixes.renamed_symbols.get(&ty.path).unwrap_or(&ty.name); + match &ty.kind { TypeKind::Struct(fields) => { - generate_struct(gen, &ty.path, &ty.name, ty.documentation.as_deref(), fields)?; + generate_struct(gen, &ty.path, name, ty.documentation.as_deref(), fields)?; } TypeKind::Enum(variants) => { - generate_enum( - gen, - &ty.path, - &ty.name, - ty.documentation.as_deref(), - variants, - )?; + generate_enum(gen, &ty.path, name, ty.documentation.as_deref(), variants)?; } _ => (), } @@ -57,6 +57,10 @@ fn generate_struct( } writeln!(gen, "pub struct {name} {{")?; for field in fields { + if gen.fixes.removed_symbols.contains(&field.path) { + continue; + } + if gen.config.print_debug_path { writeln!(gen, " // {}", field.path)?; } @@ -64,7 +68,9 @@ fn generate_struct( writeln!(gen, " #[doc = r#\"{}\"#]", doc)?; } - let ident = if &field.name == "type" { + let ident = if let Some(name) = gen.fixes.renamed_symbols.get(&field.path) { + name + } else if field.name == "type" { "ty" } else { &field.name @@ -120,8 +126,16 @@ fn generate_enum( } writeln!(gen, ")]")?; } + let tag = gen.fixes.tagged_enums.get(path); + if let Some(tag) = tag { + writeln!(gen, "#[serde(tag = \"{}\")]", tag)?; + } writeln!(gen, "pub enum {name} {{")?; for variant in variants { + if gen.fixes.removed_symbols.contains(&variant.path) { + continue; + } + if gen.config.print_debug_path { writeln!(gen, " // {}", variant.path)?; } @@ -129,7 +143,11 @@ fn generate_enum( writeln!(gen, " #[doc = r#\"{}\"#]", doc)?; } - let ident = &variant.name; + let ident = gen + .fixes + .renamed_symbols + .get(&variant.path) + .unwrap_or(&variant.name); write!(gen, " {ident}")?; diff --git a/crates/starknet-types-rpc/generator/src/gen/method_name_constants.rs b/crates/starknet-types-rpc/generator/src/gen/method_name_constants.rs index 77b87af..d7f4069 100644 --- a/crates/starknet-types-rpc/generator/src/gen/method_name_constants.rs +++ b/crates/starknet-types-rpc/generator/src/gen/method_name_constants.rs @@ -11,15 +11,26 @@ pub fn generate(gen: &mut Generator) -> io::Result<()> { }; for method in &gen.spec.methods { - let ident = config - .strip_prefix - .as_ref() - .and_then(|prefix| method.name.strip_prefix(prefix)) - .unwrap_or(&method.name) - .to_case(Case::ScreamingSnake); + if gen.fixes.removed_symbols.contains(&method.path) { + continue; + } + + let ident = if let Some(renamed) = gen.fixes.renamed_symbols.get(&method.path) { + renamed.clone() + } else { + config + .strip_prefix + .as_ref() + .and_then(|prefix| method.name.strip_prefix(prefix)) + .unwrap_or(&method.name) + .to_case(Case::ScreamingSnake) + }; let name = method.name.as_str(); + if gen.config.print_debug_path { + writeln!(gen, "// {}", method.path)?; + } writeln!(gen, "#[doc = r#\"`{name}`\"#]")?; if let Some(flag) = &config.feature_flag { writeln!(gen, "#[cfg(feature = \"{flag}\")]")?; diff --git a/crates/starknet-types-rpc/generator/src/gen/method_param_types.rs b/crates/starknet-types-rpc/generator/src/gen/method_param_types.rs index 7038680..c5cf02a 100644 --- a/crates/starknet-types-rpc/generator/src/gen/method_param_types.rs +++ b/crates/starknet-types-rpc/generator/src/gen/method_param_types.rs @@ -11,16 +11,33 @@ pub fn generate(gen: &mut crate::gen::Generator) -> io::Result<()> { }; for method in &gen.spec.methods { - let mut ident = config - .strip_prefix - .as_ref() - .and_then(|prefix| method.name.strip_prefix(prefix)) - .unwrap_or(&method.name) - .to_case(Case::Pascal); - ident.push_str("Params"); + if gen + .fixes + .removed_symbols + .contains(&format!("{}/params", method.path)) + { + continue; + } + + let ident = if let Some(renamed) = gen.fixes.renamed_symbols.get(&method.path) { + renamed.clone() + } else { + let mut ident = config + .strip_prefix + .as_ref() + .and_then(|prefix| method.name.strip_prefix(prefix)) + .unwrap_or(&method.name) + .to_case(Case::Pascal); + ident.push_str("Params"); + + ident + }; let name = method.name.as_str(); + if gen.config.print_debug_path { + writeln!(gen, "// {}/params", method.path)?; + } writeln!( gen, "#[doc = r#\"The parameters of the `{name}` method.\"#]" diff --git a/crates/starknet-types-rpc/generator/src/gen/method_result_types.rs b/crates/starknet-types-rpc/generator/src/gen/method_result_types.rs index a7d73bb..5b9b0fe 100644 --- a/crates/starknet-types-rpc/generator/src/gen/method_result_types.rs +++ b/crates/starknet-types-rpc/generator/src/gen/method_result_types.rs @@ -13,16 +13,32 @@ pub fn generate(gen: &mut Generator) -> io::Result<()> { }; for method in &gen.spec.methods { - let mut ident = config - .strip_prefix - .as_ref() - .and_then(|prefix| method.name.strip_prefix(prefix)) - .unwrap_or(&method.name) - .to_case(Case::Pascal); - ident.push_str("Result"); + if gen + .fixes + .removed_symbols + .contains(&format!("{}/result", method.path)) + { + continue; + } + + let ident = if let Some(renamed) = gen.fixes.renamed_symbols.get(&method.path) { + renamed.clone() + } else { + let mut ident = config + .strip_prefix + .as_ref() + .and_then(|prefix| method.name.strip_prefix(prefix)) + .unwrap_or(&method.name) + .to_case(Case::Pascal); + ident.push_str("Result"); + ident + }; let name = method.name.as_str(); + if gen.config.print_debug_path { + writeln!(gen, "// {}/result", method.path)?; + } writeln!(gen, "#[doc = r#\"The result of the `{name}` method.\"#]")?; if let Some(flag) = &config.feature_flag { writeln!(gen, "#[cfg(feature = \"{flag}\")]")?; diff --git a/crates/starknet-types-rpc/generator/src/gen/type_aliases.rs b/crates/starknet-types-rpc/generator/src/gen/type_aliases.rs index c3bb899..8c25d74 100644 --- a/crates/starknet-types-rpc/generator/src/gen/type_aliases.rs +++ b/crates/starknet-types-rpc/generator/src/gen/type_aliases.rs @@ -17,7 +17,12 @@ pub fn generate(gen: &mut Generator) -> io::Result<()> { _ => continue, }; - let ident = &ty.name; + let ident = if let Some(renamed) = gen.fixes.renamed_symbols.get(&ty.path) { + renamed + } else { + &ty.name + }; + let ref_ident = reference.ident; if gen.config.print_debug_path { diff --git a/crates/starknet-types-rpc/generator/src/openrpc/parse.rs b/crates/starknet-types-rpc/generator/src/openrpc/parse.rs index 3fff293..0c8d8a5 100644 --- a/crates/starknet-types-rpc/generator/src/openrpc/parse.rs +++ b/crates/starknet-types-rpc/generator/src/openrpc/parse.rs @@ -72,7 +72,7 @@ pub fn parse_openrpc(openrpc: model::OpenRpc) -> Document { types = components .schemas .into_iter() - .map(|(name, ty)| parse_type(&mut ctx, name, ty)) + .map(|(name, ty)| parse_type(&mut ctx, &name, ty)) .collect(); ctx.pop_level(); @@ -165,8 +165,12 @@ fn parse_parameter(ctx: &mut ParsingContext, item: model::ContentDescriptor) -> /// Computes the name of a parameter from its [`model::Schema`]. fn parse_type_ref(ctx: &mut ParsingContext, schema: model::Schema) -> TypeRef { - let ty = parse_type(ctx, "ANONYMOUS".into(), schema); + let ty = parse_type(ctx, "ANONYMOUS", schema); + create_ref_for_existing_def(ctx, ty) +} +/// Creates a reference to an existing type definition. +fn create_ref_for_existing_def(ctx: &mut ParsingContext, ty: TypeDefinition) -> TypeRef { // If the parsed type is a newtype, we can just return the type directly to // avoid creating one newtype per type reference. if let TypeKind::Newtype(inner) = ty.kind { @@ -180,8 +184,8 @@ fn parse_type_ref(ctx: &mut ParsingContext, schema: model::Schema) -> TypeRef { } /// Parses a [`model::Schema`] into a [`TypeKind`]. -fn parse_type(ctx: &mut ParsingContext, name: String, schema: model::Schema) -> TypeDefinition { - ctx.push_level(&name); +fn parse_type(ctx: &mut ParsingContext, name: &str, schema: model::Schema) -> TypeDefinition { + ctx.push_level(name); let kind = if let Some(path) = schema.reference { TypeKind::Newtype(TypeRef::Reference(path)) @@ -201,11 +205,18 @@ fn parse_type(ctx: &mut ParsingContext, name: String, schema: model::Schema) -> } } else if let Some(s) = schema.complex { match s { - model::ComplexSchema::OneOf(c) => TypeKind::Enum(parse_enum_variants(ctx, c)), - model::ComplexSchema::AllOf(c) => TypeKind::Struct(parse_flatten_struct(ctx, true, &c)), - model::ComplexSchema::AnyOf(c) => { - TypeKind::Struct(parse_flatten_struct(ctx, false, &c)) - } + model::ComplexSchema::OneOf(c) => match &*c { + [val] => parse_type(ctx, name.clone(), val.clone()).kind, + _ => TypeKind::Enum(parse_enum_variants(ctx, c)), + }, + model::ComplexSchema::AllOf(c) => match &*c { + [val] => parse_type(ctx, name.clone(), val.clone()).kind, + _ => TypeKind::Struct(parse_flatten_struct(ctx, true, &c)), + }, + model::ComplexSchema::AnyOf(c) => match &*c { + [val] => parse_type(ctx, name.clone(), val.clone()).kind, + _ => TypeKind::Struct(parse_flatten_struct(ctx, false, &c)), + }, } } else { TypeKind::Newtype(TypeRef::Broken(ctx.current_level().into())) @@ -289,34 +300,40 @@ fn parse_flatten_struct( ) -> Vec { parts .iter() - .map(|s| { + .flat_map(|s| { ctx.push_level(&s.title.as_deref().unwrap_or("unknown").to_case(Case::Snake)); let path = ctx.current_level().into(); let name = if let Some(title) = &s.title { - title.to_case(Case::Snake) + title } else if let Some(reference) = &s.reference { - reference - .rsplit('/') - .next() - .unwrap_or(reference) - .to_case(Case::Snake) + reference.rsplit('/').next().unwrap_or(reference) } else { - "unknown".into() + "unknown" }; - let ty = parse_type_ref(ctx, s.clone()); + let ty = parse_type(ctx, name, s.clone()); + + // If the provided type is a struct, we can just move all the fields + // here since we're flattening the struct. + if let TypeKind::Struct(fields) = ty.kind { + ctx.pop_level(); + return fields; + } + + // If it's not possible, we have to create a ref. + let ty = create_ref_for_existing_def(ctx, ty); ctx.pop_level(); - StructField { + vec![StructField { path, - name, + name: name.to_case(Case::Snake), documentation: s.description.clone(), ty, required, flatten: true, - } + }] }) .collect() } diff --git a/crates/starknet-types-rpc/generator/src/openrpc/parsed.rs b/crates/starknet-types-rpc/generator/src/openrpc/parsed.rs index aaa67b1..9633da7 100644 --- a/crates/starknet-types-rpc/generator/src/openrpc/parsed.rs +++ b/crates/starknet-types-rpc/generator/src/openrpc/parsed.rs @@ -55,7 +55,7 @@ pub struct TypeInfo { impl TypeInfo { /// Creates a new type info instance. - pub fn of(r: &TypeRef, types: &[TypeDefinition], config: &Config, _fixes: &Fixes) -> Self { + pub fn of(r: &TypeRef, types: &[TypeDefinition], config: &Config, fixes: &Fixes) -> Self { match r { TypeRef::Reference(path) => { let ty = types @@ -63,17 +63,15 @@ impl TypeInfo { .find(|x| &x.path == path) .expect("Reference to unknown type. This is a bug in the generator."); - let to_merge = match &ty.kind { - TypeKind::Newtype(r) => Self::of(r, types, config, _fixes), - _ => Self { - ident: String::new(), - attributes: vec![], - }, + let ident = if let Some(replaced) = fixes.renamed_symbols.get(path) { + replaced.to_owned() + } else { + ty.name.clone() }; Self { - ident: ty.name.clone(), - attributes: to_merge.attributes, + ident, + attributes: vec![], } } TypeRef::Boolean => Self { @@ -98,9 +96,9 @@ impl TypeInfo { }, TypeRef::Array(inner) => { let name = if config.use_boxed_slices { - format!("Vec<{}>", Self::of(inner, types, config, _fixes).ident) + format!("Vec<{}>", Self::of(inner, types, config, fixes).ident) } else { - format!("Box<[{}]>", Self::of(inner, types, config, _fixes).ident) + format!("Box<[{}]>", Self::of(inner, types, config, fixes).ident) }; Self { diff --git a/crates/starknet-types-rpc/generator/test.txt b/crates/starknet-types-rpc/generator/test.txt deleted file mode 100644 index f97eeae..0000000 --- a/crates/starknet-types-rpc/generator/test.txt +++ /dev/null @@ -1,7855 +0,0 @@ -OpenRpc { - openrpc: "1.0.0-rc1", - info: Info { - title: "StarkNet Node API", - version: "0.5.0", - }, - methods: Some( - [ - Method { - name: "starknet_specVersion", - summary: Some( - "Returns the version of the Starknet JSON-RPC specification being used", - ), - description: None, - params: [], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "JSON-RPC spec version", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: None, - }, - Method { - name: "starknet_getBlockWithTxHashes", - summary: Some( - "Get block information with transaction hashes given the block id", - ), - description: None, - params: [ - ContentDescriptor { - name: "block_id", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Block id", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Starknet get block hash with tx hashes result", - ), - description: None, - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Block with transaction hashes", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_WITH_TX_HASHES", - ), - }, - Schema { - title: Some( - "Pending block with transaction hashes", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/PENDING_BLOCK_WITH_TX_HASHES", - ), - }, - ], - ), - ), - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/BLOCK_NOT_FOUND", - }, - ], - ), - }, - Method { - name: "starknet_getBlockWithTxs", - summary: Some( - "Get block information with full transactions given the block id", - ), - description: None, - params: [ - ContentDescriptor { - name: "block_id", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Block id", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Starknet get block with txs result", - ), - description: None, - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Block with transactions", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_WITH_TXS", - ), - }, - Schema { - title: Some( - "Pending block with transactions", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/PENDING_BLOCK_WITH_TXS", - ), - }, - ], - ), - ), - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/BLOCK_NOT_FOUND", - }, - ], - ), - }, - Method { - name: "starknet_getStateUpdate", - summary: Some( - "Get the information about the result of executing the requested block", - ), - description: None, - params: [ - ContentDescriptor { - name: "block_id", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Block id", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Starknet get state update result", - ), - description: None, - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "State update", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/STATE_UPDATE", - ), - }, - Schema { - title: Some( - "Pending state update", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/PENDING_STATE_UPDATE", - ), - }, - ], - ), - ), - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/BLOCK_NOT_FOUND", - }, - ], - ), - }, - Method { - name: "starknet_getStorageAt", - summary: Some( - "Get the value of the storage at the given address and key", - ), - description: None, - params: [ - ContentDescriptor { - name: "contract_address", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Address", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - deprecated: false, - }, - ContentDescriptor { - name: "key", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Storage key", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/STORAGE_KEY", - ), - }, - deprecated: false, - }, - ContentDescriptor { - name: "block_id", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Block id", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Field element", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/CONTRACT_NOT_FOUND", - }, - ErrorRef { - reference: "#/components/errors/BLOCK_NOT_FOUND", - }, - ], - ), - }, - Method { - name: "starknet_getTransactionStatus", - summary: Some( - "Gets the transaction status (possibly reflecting that the tx is still in the mempool, or dropped from it)", - ), - description: None, - params: [ - ContentDescriptor { - name: "transaction_hash", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Transaction hash", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_HASH", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Transaction status", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "execution_status": Schema { - title: Some( - "execution status", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_EXECUTION_STATUS", - ), - }, - "finality_status": Schema { - title: Some( - "finality status", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_STATUS", - ), - }, - }, - required: [ - "finality_status", - ], - }, - ), - ), - complex: None, - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/TXN_HASH_NOT_FOUND", - }, - ], - ), - }, - Method { - name: "starknet_getTransactionByHash", - summary: Some( - "Get the details and status of a submitted transaction", - ), - description: None, - params: [ - ContentDescriptor { - name: "transaction_hash", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Transaction hash", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_HASH", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Transaction", - ), - description: None, - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN", - ), - }, - Schema { - title: None, - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "transaction_hash": Schema { - title: Some( - "transaction hash", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_HASH", - ), - }, - }, - required: [ - "transaction_hash", - ], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/TXN_HASH_NOT_FOUND", - }, - ], - ), - }, - Method { - name: "starknet_getTransactionByBlockIdAndIndex", - summary: Some( - "Get the details of a transaction by a given block id and index", - ), - description: Some( - "Get the details of the transaction given by the identified block and index in that block. If no transaction is found, null is returned.", - ), - params: [ - ContentDescriptor { - name: "block_id", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Block id", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - deprecated: false, - }, - ContentDescriptor { - name: "index", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Index", - ), - description: None, - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "transactionResult", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Transaction", - ), - description: None, - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN", - ), - }, - Schema { - title: None, - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "transaction_hash": Schema { - title: Some( - "transaction hash", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_HASH", - ), - }, - }, - required: [ - "transaction_hash", - ], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/BLOCK_NOT_FOUND", - }, - ErrorRef { - reference: "#/components/errors/INVALID_TXN_INDEX", - }, - ], - ), - }, - Method { - name: "starknet_getTransactionReceipt", - summary: Some( - "Get the transaction receipt by the transaction hash", - ), - description: None, - params: [ - ContentDescriptor { - name: "transaction_hash", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Transaction hash", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_HASH", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: None, - description: None, - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Transaction receipt", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_RECEIPT", - ), - }, - Schema { - title: Some( - "Pending transaction receipt", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/PENDING_TXN_RECEIPT", - ), - }, - ], - ), - ), - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/TXN_HASH_NOT_FOUND", - }, - ], - ), - }, - Method { - name: "starknet_getClass", - summary: Some( - "Get the contract class definition in the given block associated with the given hash", - ), - description: None, - params: [ - ContentDescriptor { - name: "block_id", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Block id", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - deprecated: false, - }, - ContentDescriptor { - name: "class_hash", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Field element", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Starknet get class result", - ), - description: None, - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Deprecated contract class", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DEPRECATED_CONTRACT_CLASS", - ), - }, - Schema { - title: Some( - "Contract class", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/CONTRACT_CLASS", - ), - }, - ], - ), - ), - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/BLOCK_NOT_FOUND", - }, - ErrorRef { - reference: "#/components/errors/CLASS_HASH_NOT_FOUND", - }, - ], - ), - }, - Method { - name: "starknet_getClassHashAt", - summary: Some( - "Get the contract class hash in the given block for the contract deployed at the given address", - ), - description: None, - params: [ - ContentDescriptor { - name: "block_id", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Block id", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - deprecated: false, - }, - ContentDescriptor { - name: "contract_address", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Address", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Field element", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/BLOCK_NOT_FOUND", - }, - ErrorRef { - reference: "#/components/errors/CONTRACT_NOT_FOUND", - }, - ], - ), - }, - Method { - name: "starknet_getClassAt", - summary: Some( - "Get the contract class definition in the given block at the given address", - ), - description: None, - params: [ - ContentDescriptor { - name: "block_id", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Block id", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - deprecated: false, - }, - ContentDescriptor { - name: "contract_address", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Address", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Starknet get class at result", - ), - description: None, - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Deprecated contract class", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DEPRECATED_CONTRACT_CLASS", - ), - }, - Schema { - title: Some( - "Contract class", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/CONTRACT_CLASS", - ), - }, - ], - ), - ), - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/BLOCK_NOT_FOUND", - }, - ErrorRef { - reference: "#/components/errors/CONTRACT_NOT_FOUND", - }, - ], - ), - }, - Method { - name: "starknet_getBlockTransactionCount", - summary: Some( - "Get the number of transactions in a block given a block id", - ), - description: Some( - "Returns the number of transactions in the designated block.", - ), - params: [ - ContentDescriptor { - name: "block_id", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Block id", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Block transaction count", - ), - description: None, - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/BLOCK_NOT_FOUND", - }, - ], - ), - }, - Method { - name: "starknet_call", - summary: Some( - "call a starknet function without creating a StarkNet transaction", - ), - description: Some( - "Calls a function in a contract and returns the return value. Using this call will not create a transaction; hence, will not change the state", - ), - params: [ - ContentDescriptor { - name: "request", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Function call", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FUNCTION_CALL", - ), - }, - deprecated: false, - }, - ContentDescriptor { - name: "block_id", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Block id", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Field element", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/CONTRACT_NOT_FOUND", - }, - ErrorRef { - reference: "#/components/errors/CONTRACT_ERROR", - }, - ErrorRef { - reference: "#/components/errors/BLOCK_NOT_FOUND", - }, - ], - ), - }, - Method { - name: "starknet_estimateFee", - summary: Some( - "estimate the fee for of StarkNet transactions", - ), - description: Some( - "estimates the resources required by transactions when applyed on a given state", - ), - params: [ - ContentDescriptor { - name: "request", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Transaction", - ), - description: Some( - "a sequence of transactions to estimate, running each transaction on the state resulting from applying all the previous ones", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BROADCASTED_TXN", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - deprecated: false, - }, - ContentDescriptor { - name: "block_id", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Block id", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Estimation", - ), - description: Some( - "a sequence of fee estimatione where the i'th estimate corresponds to the i'th transaction", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FEE_ESTIMATE", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/CONTRACT_NOT_FOUND", - }, - ErrorRef { - reference: "#/components/errors/CONTRACT_ERROR", - }, - ErrorRef { - reference: "#/components/errors/BLOCK_NOT_FOUND", - }, - ], - ), - }, - Method { - name: "starknet_estimateMessageFee", - summary: Some( - "estimate the L2 fee of a message sent on L1", - ), - description: Some( - "estimates the resources required by the l1_handler transaction induced by the message", - ), - params: [ - ContentDescriptor { - name: "message", - summary: None, - description: None, - required: true, - schema: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/MSG_FROM_L1", - ), - }, - deprecated: false, - }, - ContentDescriptor { - name: "block_id", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Block id", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FEE_ESTIMATE", - ), - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/CONTRACT_NOT_FOUND", - }, - ErrorRef { - reference: "#/components/errors/CONTRACT_ERROR", - }, - ErrorRef { - reference: "#/components/errors/BLOCK_NOT_FOUND", - }, - ], - ), - }, - Method { - name: "starknet_blockNumber", - summary: Some( - "Get the most recent accepted block number", - ), - description: None, - params: [], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Block number", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_NUMBER", - ), - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/NO_BLOCKS", - }, - ], - ), - }, - Method { - name: "starknet_blockHashAndNumber", - summary: Some( - "Get the most recent accepted block hash and number", - ), - description: None, - params: [], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Starknet block hash and number result", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "block_hash": Schema { - title: Some( - "Block hash", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_HASH", - ), - }, - "block_number": Schema { - title: Some( - "Block number", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_NUMBER", - ), - }, - }, - required: [ - "block_hash", - "block_number", - ], - }, - ), - ), - complex: None, - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/NO_BLOCKS", - }, - ], - ), - }, - Method { - name: "starknet_chainId", - summary: Some( - "Return the currently configured StarkNet chain id", - ), - description: None, - params: [], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Chain id", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/CHAIN_ID", - ), - }, - deprecated: false, - }, - ), - deprecated: false, - errors: None, - }, - Method { - name: "starknet_syncing", - summary: Some( - "Returns an object about the sync status, or false if the node is not synching", - ), - description: None, - params: [], - result: Some( - ContentDescriptor { - name: "syncing", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "SyncingStatus", - ), - description: None, - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "False", - ), - description: Some( - "only legal value is FALSE here", - ), - simple: Some( - Boolean, - ), - complex: None, - reference: None, - }, - Schema { - title: Some( - "Sync status", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/SYNC_STATUS", - ), - }, - ], - ), - ), - reference: None, - }, - deprecated: false, - }, - ), - deprecated: false, - errors: None, - }, - Method { - name: "starknet_getEvents", - summary: Some( - "Returns all events matching the given filter", - ), - description: Some( - "Returns all event objects matching the conditions in the provided filter", - ), - params: [ - ContentDescriptor { - name: "filter", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Events request", - ), - description: None, - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Event filter", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/EVENT_FILTER", - ), - }, - Schema { - title: Some( - "Result page request", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/RESULT_PAGE_REQUEST", - ), - }, - ], - ), - ), - reference: None, - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "events", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Events chunk", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/EVENTS_CHUNK", - ), - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/PAGE_SIZE_TOO_BIG", - }, - ErrorRef { - reference: "#/components/errors/INVALID_CONTINUATION_TOKEN", - }, - ErrorRef { - reference: "#/components/errors/BLOCK_NOT_FOUND", - }, - ErrorRef { - reference: "#/components/errors/TOO_MANY_KEYS_IN_FILTER", - }, - ], - ), - }, - Method { - name: "starknet_getNonce", - summary: Some( - "Get the nonce associated with the given address in the given block", - ), - description: None, - params: [ - ContentDescriptor { - name: "block_id", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Block id", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - deprecated: false, - }, - ContentDescriptor { - name: "contract_address", - summary: None, - description: None, - required: true, - schema: Schema { - title: Some( - "Address", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - deprecated: false, - }, - ], - result: Some( - ContentDescriptor { - name: "result", - summary: None, - description: None, - required: false, - schema: Schema { - title: Some( - "Field element", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - deprecated: false, - }, - ), - deprecated: false, - errors: Some( - [ - ErrorRef { - reference: "#/components/errors/BLOCK_NOT_FOUND", - }, - ErrorRef { - reference: "#/components/errors/CONTRACT_NOT_FOUND", - }, - ], - ), - }, - ], - ), - components: Some( - Components { - schemas: { - "ADDRESS": Schema { - title: Some( - "Address", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "BLOCK_BODY_WITH_TXS": Schema { - title: Some( - "Block body with transactions", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "transactions": Schema { - title: Some( - "Transactions", - ), - description: Some( - "The transactions in this block", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: Some( - "transactions in block", - ), - description: None, - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "transaction", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN", - ), - }, - Schema { - title: None, - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "transaction_hash": Schema { - title: Some( - "transaction hash", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_HASH", - ), - }, - }, - required: [ - "transaction_hash", - ], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "transactions", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "BLOCK_BODY_WITH_TX_HASHES": Schema { - title: Some( - "Block body with transaction hashes", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "transactions": Schema { - title: Some( - "Transaction hashes", - ), - description: Some( - "The hashes of the transactions included in this block", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: Some( - "The hash of a single transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_HASH", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "transactions", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "BLOCK_HASH": Schema { - title: Some( - "Block hash", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "BLOCK_HEADER": Schema { - title: Some( - "Block header", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "block_hash": Schema { - title: Some( - "Block hash", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_HASH", - ), - }, - "block_number": Schema { - title: Some( - "Block number", - ), - description: Some( - "The block number (its height)", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_NUMBER", - ), - }, - "l1_gas_price": Schema { - title: Some( - "L1 gas price", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/RESOURCE_PRICE", - ), - }, - "new_root": Schema { - title: Some( - "New root", - ), - description: Some( - "The new global state root", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "parent_hash": Schema { - title: Some( - "Parent hash", - ), - description: Some( - "The hash of this block's parent", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_HASH", - ), - }, - "sequencer_address": Schema { - title: Some( - "Sequencer address", - ), - description: Some( - "The StarkNet identity of the sequencer submitting this block", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "starknet_version": Schema { - title: Some( - "Starknet version", - ), - description: Some( - "Semver of the current Starknet protocol", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "timestamp": Schema { - title: Some( - "Timestamp", - ), - description: Some( - "The time in which the block was created, encoded in Unix time", - ), - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "block_hash", - "parent_hash", - "block_number", - "new_root", - "timestamp", - "sequencer_address", - "l1_gas_price", - "starknet_version", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "BLOCK_ID": Schema { - title: Some( - "Block id", - ), - description: Some( - "Block hash, number or tag", - ), - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Block hash", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "block_hash": Schema { - title: Some( - "Block hash", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_HASH", - ), - }, - }, - required: [ - "block_hash", - ], - }, - ), - ), - complex: None, - reference: None, - }, - Schema { - title: Some( - "Block number", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "block_number": Schema { - title: Some( - "Block number", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_NUMBER", - ), - }, - }, - required: [ - "block_number", - ], - }, - ), - ), - complex: None, - reference: None, - }, - Schema { - title: Some( - "Block tag", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_TAG", - ), - }, - ], - ), - ), - reference: None, - }, - "BLOCK_NUMBER": Schema { - title: Some( - "Block number", - ), - description: Some( - "The block's number (its height)", - ), - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - "BLOCK_STATUS": Schema { - title: Some( - "Block status", - ), - description: Some( - "The status of the block", - ), - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "PENDING", - "ACCEPTED_ON_L2", - "ACCEPTED_ON_L1", - "REJECTED", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "BLOCK_TAG": Schema { - title: Some( - "Block tag", - ), - description: Some( - "A tag specifying a dynamic reference to a block", - ), - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "latest", - "pending", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "BLOCK_WITH_TXS": Schema { - title: Some( - "Block with transactions", - ), - description: Some( - "The block object", - ), - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "block with txs", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "status": Schema { - title: Some( - "Status", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_STATUS", - ), - }, - }, - required: [ - "status", - ], - }, - ), - ), - complex: None, - reference: None, - }, - Schema { - title: Some( - "Block header", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_HEADER", - ), - }, - Schema { - title: Some( - "Block body with transactions", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_BODY_WITH_TXS", - ), - }, - ], - ), - ), - reference: None, - }, - "BLOCK_WITH_TX_HASHES": Schema { - title: Some( - "Block with transaction hashes", - ), - description: Some( - "The block object", - ), - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Block status", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "status": Schema { - title: Some( - "Status", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_STATUS", - ), - }, - }, - required: [ - "status", - ], - }, - ), - ), - complex: None, - reference: None, - }, - Schema { - title: Some( - "Block header", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_HEADER", - ), - }, - Schema { - title: Some( - "Block body with transaction hashes", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_BODY_WITH_TX_HASHES", - ), - }, - ], - ), - ), - reference: None, - }, - "BROADCASTED_DECLARE_TXN": Schema { - title: Some( - "Broadcasted declare transaction", - ), - description: None, - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Broadcasted declare transaction V1", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BROADCASTED_DECLARE_TXN_V1", - ), - }, - Schema { - title: Some( - "Broadcasted declare transaction V2", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BROADCASTED_DECLARE_TXN_V2", - ), - }, - ], - ), - ), - reference: None, - }, - "BROADCASTED_DECLARE_TXN_V1": Schema { - title: Some( - "Broadcasted declare contract transaction V1", - ), - description: None, - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Declare txn v1", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "contract_class": Schema { - title: Some( - "Contract class", - ), - description: Some( - "The class to be declared", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DEPRECATED_CONTRACT_CLASS", - ), - }, - "max_fee": Schema { - title: Some( - "Max fee", - ), - description: Some( - "The maximal fee that can be charged for including the transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "nonce": Schema { - title: Some( - "Nonce", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "sender_address": Schema { - title: Some( - "Sender address", - ), - description: Some( - "The address of the account contract sending the declaration transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - "signature": Schema { - title: Some( - "Signature", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/SIGNATURE", - ), - }, - "type": Schema { - title: Some( - "Declare", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "DECLARE", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "version": Schema { - title: Some( - "Version", - ), - description: Some( - "Version of the transaction scheme", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - }, - required: [ - "type", - "sender_address", - "max_fee", - "version", - "signature", - "nonce", - "contract_class", - ], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - "BROADCASTED_DECLARE_TXN_V2": Schema { - title: Some( - "Broadcasted declare Transaction V2", - ), - description: Some( - "Broadcasted declare Contract Transaction V2", - ), - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Declare txn v2", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "compiled_class_hash": Schema { - title: Some( - "Compiled class hash", - ), - description: Some( - "The hash of the Cairo assembly resulting from the Sierra compilation", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "contract_class": Schema { - title: Some( - "Contract class", - ), - description: Some( - "The class to be declared", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/CONTRACT_CLASS", - ), - }, - "max_fee": Schema { - title: Some( - "Max fee", - ), - description: Some( - "The maximal fee that can be charged for including the transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "nonce": Schema { - title: Some( - "Nonce", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "sender_address": Schema { - title: Some( - "Sender address", - ), - description: Some( - "The address of the account contract sending the declaration transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - "signature": Schema { - title: Some( - "Signature", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/SIGNATURE", - ), - }, - "type": Schema { - title: Some( - "Declare", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "DECLARE", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "version": Schema { - title: Some( - "Version", - ), - description: Some( - "Version of the transaction scheme", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - }, - required: [ - "type", - "sender_address", - "compiled_class_hash", - "max_fee", - "version", - "signature", - "nonce", - "contract_class", - ], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - "BROADCASTED_DEPLOY_ACCOUNT_TXN": Schema { - title: Some( - "Broadcasted deploy account transaction", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DEPLOY_ACCOUNT_TXN", - ), - }, - "BROADCASTED_INVOKE_TXN": Schema { - title: Some( - "Broadcasted invoke transaction", - ), - description: None, - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Broadcasted invoke transaction V0", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/INVOKE_TXN_V0", - ), - }, - Schema { - title: Some( - "Broadcasted invoke transaction V1", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/INVOKE_TXN_V1", - ), - }, - ], - ), - ), - reference: None, - }, - "BROADCASTED_TXN": Schema { - title: None, - description: None, - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BROADCASTED_INVOKE_TXN", - ), - }, - Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BROADCASTED_DECLARE_TXN", - ), - }, - Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BROADCASTED_DEPLOY_ACCOUNT_TXN", - ), - }, - ], - ), - ), - reference: None, - }, - "CHAIN_ID": Schema { - title: Some( - "Chain id", - ), - description: Some( - "StarkNet chain id, given in hex representation.", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "COMMON_RECEIPT_PROPERTIES": Schema { - title: Some( - "Common receipt properties", - ), - description: Some( - "Common properties for a transaction receipt", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "actual_fee": Schema { - title: Some( - "Actual fee", - ), - description: Some( - "The fee that was charged by the sequencer", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "block_hash": Schema { - title: Some( - "Block hash", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_HASH", - ), - }, - "block_number": Schema { - title: Some( - "Block number", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_NUMBER", - ), - }, - "events": Schema { - title: Some( - "Events", - ), - description: Some( - "The events emitted as part of this transaction", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/EVENT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "execution_resources": Schema { - title: Some( - "Execution resources", - ), - description: Some( - "The resources consumed by the transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/EXECUTION_RESOURCES", - ), - }, - "execution_status": Schema { - title: Some( - "Execution status", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_EXECUTION_STATUS", - ), - }, - "finality_status": Schema { - title: Some( - "Finality status", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_FINALITY_STATUS", - ), - }, - "messages_sent": Schema { - title: Some( - "Messages sent", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/MSG_TO_L1", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "revert_reason": Schema { - title: Some( - "Revert reason", - ), - description: Some( - "the revert reason for the failed execution", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "transaction_hash": Schema { - title: Some( - "Transaction hash", - ), - description: Some( - "The hash identifying the transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_HASH", - ), - }, - }, - required: [ - "transaction_hash", - "actual_fee", - "finality_status", - "execution_status", - "block_hash", - "block_number", - "messages_sent", - "events", - "execution_resources", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "CONTRACT_ABI": Schema { - title: Some( - "Contract ABI", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/CONTRACT_ABI_ENTRY", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "CONTRACT_ABI_ENTRY": Schema { - title: Some( - "Contract ABI entry", - ), - description: None, - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Function ABI entry", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FUNCTION_ABI_ENTRY", - ), - }, - Schema { - title: Some( - "Event ABI entry", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/EVENT_ABI_ENTRY", - ), - }, - Schema { - title: Some( - "Struct ABI entry", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/STRUCT_ABI_ENTRY", - ), - }, - ], - ), - ), - reference: None, - }, - "CONTRACT_CLASS": Schema { - title: Some( - "Contract class", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "abi": Schema { - title: Some( - "ABI", - ), - description: Some( - "The class ABI, as supplied by the user declaring the class", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "contract_class_version": Schema { - title: Some( - "Contract class version", - ), - description: Some( - "The version of the contract class object. Currently, the Starknet OS supports version 0.1.0", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "entry_points_by_type": Schema { - title: Some( - "Entry points by type", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "CONSTRUCTOR": Schema { - title: Some( - "Constructor", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/SIERRA_ENTRY_POINT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "EXTERNAL": Schema { - title: Some( - "External", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/SIERRA_ENTRY_POINT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "L1_HANDLER": Schema { - title: Some( - "L1 handler", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/SIERRA_ENTRY_POINT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "CONSTRUCTOR", - "EXTERNAL", - "L1_HANDLER", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "sierra_program": Schema { - title: Some( - "Sierra program", - ), - description: Some( - "The list of Sierra instructions of which the program consists", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "sierra_program", - "contract_class_version", - "entry_points_by_type", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "CONTRACT_STORAGE_DIFF_ITEM": Schema { - title: Some( - "Contract storage diff item", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "address": Schema { - title: Some( - "Address", - ), - description: Some( - "The contract address for which the storage changed", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "storage_entries": Schema { - title: Some( - "Storage entries", - ), - description: Some( - "The changes in the storage of the contract", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: Some( - "Storage diff item", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "key": Schema { - title: Some( - "Key", - ), - description: Some( - "The key of the changed value", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "value": Schema { - title: Some( - "Value", - ), - description: Some( - "The new value applied to the given address", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - required: [], - }, - ), - ), - complex: None, - reference: None, - }, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "address", - "storage_entries", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "DA_MODE": Schema { - title: Some( - "DA mode", - ), - description: Some( - "Specifies a storage domain in Starknet. Each domain has different gurantess regarding availability", - ), - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "L1", - "L2", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "DECLARE_TXN": Schema { - title: Some( - "Declare transaction", - ), - description: None, - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Declare transaction V0", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DECLARE_TXN_V0", - ), - }, - Schema { - title: Some( - "Declare transaction V1", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DECLARE_TXN_V1", - ), - }, - Schema { - title: Some( - "Declare transaction V2", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DECLARE_TXN_V2", - ), - }, - ], - ), - ), - reference: None, - }, - "DECLARE_TXN_RECEIPT": Schema { - title: Some( - "Declare Transaction Receipt", - ), - description: None, - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Declare txn receipt", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "type": Schema { - title: Some( - "Declare", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "DECLARE", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "type", - ], - }, - ), - ), - complex: None, - reference: None, - }, - Schema { - title: Some( - "Common receipt properties", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/COMMON_RECEIPT_PROPERTIES", - ), - }, - ], - ), - ), - reference: None, - }, - "DECLARE_TXN_V0": Schema { - title: Some( - "Declare Contract Transaction V0", - ), - description: Some( - "Declare Contract Transaction V0", - ), - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Declare txn v0", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "class_hash": Schema { - title: Some( - "Class hash", - ), - description: Some( - "The hash of the declared class", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "max_fee": Schema { - title: Some( - "Max fee", - ), - description: Some( - "The maximal fee that can be charged for including the transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "sender_address": Schema { - title: Some( - "Sender address", - ), - description: Some( - "The address of the account contract sending the declaration transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - "signature": Schema { - title: Some( - "Signature", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/SIGNATURE", - ), - }, - "type": Schema { - title: Some( - "Declare", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "DECLARE", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "version": Schema { - title: Some( - "Version", - ), - description: Some( - "Version of the transaction scheme", - ), - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "0x0", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "type", - "sender_address", - "max_fee", - "version", - "signature", - "class_hash", - ], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - "DECLARE_TXN_V1": Schema { - title: Some( - "Declare Contract Transaction V1", - ), - description: Some( - "Declare Contract Transaction V1", - ), - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Declare txn v1", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "class_hash": Schema { - title: Some( - "Class hash", - ), - description: Some( - "The hash of the declared class", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "max_fee": Schema { - title: Some( - "Max fee", - ), - description: Some( - "The maximal fee that can be charged for including the transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "nonce": Schema { - title: Some( - "Nonce", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "sender_address": Schema { - title: Some( - "Sender address", - ), - description: Some( - "The address of the account contract sending the declaration transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - "signature": Schema { - title: Some( - "Signature", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/SIGNATURE", - ), - }, - "type": Schema { - title: Some( - "Declare", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "DECLARE", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "version": Schema { - title: Some( - "Version", - ), - description: Some( - "Version of the transaction scheme", - ), - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "0x1", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "type", - "sender_address", - "max_fee", - "version", - "signature", - "nonce", - "class_hash", - ], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - "DECLARE_TXN_V2": Schema { - title: Some( - "Declare Transaction V2", - ), - description: Some( - "Declare Contract Transaction V2", - ), - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Declare txn v2", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "class_hash": Schema { - title: Some( - "Class hash", - ), - description: Some( - "The hash of the declared class", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "compiled_class_hash": Schema { - title: Some( - "Compiled class hash", - ), - description: Some( - "The hash of the Cairo assembly resulting from the Sierra compilation", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "max_fee": Schema { - title: Some( - "Max fee", - ), - description: Some( - "The maximal fee that can be charged for including the transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "nonce": Schema { - title: Some( - "Nonce", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "sender_address": Schema { - title: Some( - "Sender address", - ), - description: Some( - "The address of the account contract sending the declaration transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - "signature": Schema { - title: Some( - "Signature", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/SIGNATURE", - ), - }, - "type": Schema { - title: Some( - "Declare", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "DECLARE", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "version": Schema { - title: Some( - "Version", - ), - description: Some( - "Version of the transaction scheme", - ), - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "0x2", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "type", - "sender_address", - "compiled_class_hash", - "max_fee", - "version", - "signature", - "nonce", - "class_hash", - ], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - "DEPLOYED_CONTRACT_ITEM": Schema { - title: Some( - "Deployed contract item", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "address": Schema { - title: Some( - "Address", - ), - description: Some( - "The address of the contract", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "class_hash": Schema { - title: Some( - "Class hash", - ), - description: Some( - "The hash of the contract code", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - required: [ - "address", - "class_hash", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "DEPLOY_ACCOUNT_TXN": Schema { - title: Some( - "Deploy account transaction", - ), - description: Some( - "deploys a new account contract", - ), - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Deploy account V1", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DEPLOY_ACCOUNT_TXN_V1", - ), - }, - ], - ), - ), - reference: None, - }, - "DEPLOY_ACCOUNT_TXN_RECEIPT": Schema { - title: Some( - "Deploy Account Transaction Receipt", - ), - description: None, - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Common receipt properties", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/COMMON_RECEIPT_PROPERTIES", - ), - }, - Schema { - title: Some( - "DeployAccount txn receipt", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "contract_address": Schema { - title: Some( - "Contract address", - ), - description: Some( - "The address of the deployed contract", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "type": Schema { - title: Some( - "Deploy account", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "DEPLOY_ACCOUNT", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "type", - "contract_address", - ], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - "DEPLOY_ACCOUNT_TXN_V1": Schema { - title: Some( - "Deploy account transaction", - ), - description: Some( - "Deploys an account contract, charges fee from the pre-funded account addresses", - ), - simple: None, - complex: None, - reference: None, - }, - "DEPLOY_TXN": Schema { - title: Some( - "Deploy Contract Transaction", - ), - description: Some( - "The structure of a deploy transaction. Note that this transaction type is deprecated and will no longer be supported in future versions", - ), - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Deploy txn", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "class_hash": Schema { - title: Some( - "Class hash", - ), - description: Some( - "The hash of the deployed contract's class", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "constructor_calldata": Schema { - title: Some( - "Constructor calldata", - ), - description: Some( - "The parameters passed to the constructor", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "contract_address_salt": Schema { - title: Some( - "Contract address salt", - ), - description: Some( - "The salt for the address of the deployed contract", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "type": Schema { - title: Some( - "Deploy", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "DEPLOY", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "version": Schema { - title: Some( - "Version", - ), - description: Some( - "Version of the transaction scheme", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - }, - required: [ - "version", - "type", - "constructor_calldata", - "contract_address_salt", - "class_hash", - ], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - "DEPLOY_TXN_RECEIPT": Schema { - title: Some( - "Deploy Transaction Receipt", - ), - description: None, - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Common receipt properties", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/COMMON_RECEIPT_PROPERTIES", - ), - }, - Schema { - title: Some( - "Deploy txn receipt", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "contract_address": Schema { - title: Some( - "Contract address", - ), - description: Some( - "The address of the deployed contract", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "type": Schema { - title: Some( - "Deploy", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "DEPLOY", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "type", - "contract_address", - ], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - "DEPRECATED_CAIRO_ENTRY_POINT": Schema { - title: Some( - "Deprecated Cairo entry point", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "offset": Schema { - title: Some( - "Offset", - ), - description: Some( - "The offset of the entry point in the program", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - "selector": Schema { - title: Some( - "Selector", - ), - description: Some( - "A unique identifier of the entry point (function) in the program", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - required: [ - "offset", - "selector", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "DEPRECATED_CONTRACT_CLASS": Schema { - title: Some( - "Deprecated contract class", - ), - description: Some( - "The definition of a StarkNet contract class", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "abi": Schema { - title: Some( - "Contract ABI", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/CONTRACT_ABI", - ), - }, - "entry_points_by_type": Schema { - title: Some( - "Deprecated entry points by type", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "CONSTRUCTOR": Schema { - title: Some( - "Deprecated constructor", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DEPRECATED_CAIRO_ENTRY_POINT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "EXTERNAL": Schema { - title: Some( - "Deprecated external", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DEPRECATED_CAIRO_ENTRY_POINT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "L1_HANDLER": Schema { - title: Some( - "Deprecated L1 handler", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DEPRECATED_CAIRO_ENTRY_POINT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [], - }, - ), - ), - complex: None, - reference: None, - }, - "program": Schema { - title: Some( - "Program", - ), - description: Some( - "A base64 representation of the compressed program code", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "program", - "entry_points_by_type", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "EMITTED_EVENT": Schema { - title: Some( - "Emitted event", - ), - description: Some( - "Event information decorated with metadata on where it was emitted / An event emitted as a result of transaction execution", - ), - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Event", - ), - description: Some( - "The event information", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/EVENT", - ), - }, - Schema { - title: Some( - "Event context", - ), - description: Some( - "The event emission information", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "block_hash": Schema { - title: Some( - "Block hash", - ), - description: Some( - "The hash of the block in which the event was emitted", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_HASH", - ), - }, - "block_number": Schema { - title: Some( - "Block number", - ), - description: Some( - "The number of the block in which the event was emitted", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_NUMBER", - ), - }, - "transaction_hash": Schema { - title: Some( - "Transaction hash", - ), - description: Some( - "The transaction that emitted the event", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_HASH", - ), - }, - }, - required: [ - "transaction_hash", - ], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - "ETH_ADDRESS": Schema { - title: Some( - "Ethereum address", - ), - description: Some( - "an ethereum address represented as 40 hex digits", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "EVENT": Schema { - title: Some( - "Event", - ), - description: Some( - "A StarkNet event", - ), - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Event emitter", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "from_address": Schema { - title: Some( - "From address", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - }, - required: [ - "from_address", - ], - }, - ), - ), - complex: None, - reference: None, - }, - Schema { - title: Some( - "Event content", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/EVENT_CONTENT", - ), - }, - ], - ), - ), - reference: None, - }, - "EVENTS_CHUNK": Schema { - title: Some( - "Events chunk", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "continuation_token": Schema { - title: Some( - "Continuation token", - ), - description: Some( - "Use this token in a subsequent query to obtain the next page. Should not appear if there are no more pages.", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "events": Schema { - title: Some( - "Matching Events", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/EMITTED_EVENT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "events", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "EVENT_ABI_ENTRY": Schema { - title: Some( - "Event ABI entry", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "data": Schema { - title: Some( - "Typed parameter", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TYPED_PARAMETER", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "keys": Schema { - title: Some( - "Typed parameter", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TYPED_PARAMETER", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "name": Schema { - title: Some( - "Event name", - ), - description: Some( - "The event name", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "type": Schema { - title: Some( - "Event ABI type", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/EVENT_ABI_TYPE", - ), - }, - }, - required: [ - "type", - "name", - "keys", - "data", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "EVENT_ABI_TYPE": Schema { - title: Some( - "Event ABI type", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "event", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "EVENT_CONTENT": Schema { - title: Some( - "Event content", - ), - description: Some( - "The content of an event", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "data": Schema { - title: Some( - "Data", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "keys": Schema { - title: Some( - "Keys", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "keys", - "data", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "EVENT_FILTER": Schema { - title: Some( - "Event filter", - ), - description: Some( - "An event filter/query", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "address": Schema { - title: Some( - "from contract", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - "from_block": Schema { - title: Some( - "from block", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - "keys": Schema { - title: Some( - "Keys", - ), - description: Some( - "The values used to filter the events", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: Some( - "Keys", - ), - description: Some( - "Per key (by position), designate the possible values to be matched for events to be returned. Empty array designates 'any' value", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - }, - ), - ), - complex: None, - reference: None, - }, - "to_block": Schema { - title: Some( - "to block", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_ID", - ), - }, - }, - required: [], - }, - ), - ), - complex: None, - reference: None, - }, - "EXECUTION_RESOURCES": Schema { - title: Some( - "Execution resources", - ), - description: Some( - "The resources consumed by the transaction", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "bitwise_builtin_applications": Schema { - title: Some( - "BITWISE applications", - ), - description: Some( - "the number of BITWISE builtin instances", - ), - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - "ec_op_builtin_applications": Schema { - title: Some( - "EC_OP applications", - ), - description: Some( - "the number of EC_OP builtin instances", - ), - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - "ecdsa_builtin_applications": Schema { - title: Some( - "ECDSA applications", - ), - description: Some( - "the number of ECDSA builtin instances", - ), - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - "keccak_builtin_applications": Schema { - title: Some( - "Keccak applications", - ), - description: Some( - "The number of KECCAK builtin instances", - ), - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - "memory_holes": Schema { - title: Some( - "Memory holes", - ), - description: Some( - "The number of unused memory cells (each cell is roughly equivalent to a step)", - ), - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - "pedersen_builtin_applications": Schema { - title: Some( - "Pedersen applications", - ), - description: Some( - "The number of Pedersen builtin instances", - ), - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - "poseidon_builtin_applications": Schema { - title: Some( - "Poseidon applications", - ), - description: Some( - "The number of Poseidon builtin instances", - ), - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - "range_check_builtin_applications": Schema { - title: Some( - "Range check applications", - ), - description: Some( - "The number of RANGE_CHECK builtin instances", - ), - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - "steps": Schema { - title: Some( - "Steps", - ), - description: Some( - "The number of Cairo steps used", - ), - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "steps", - "range_check_builtin_applications", - "pedersen_builtin_applications", - "poseidon_builtin_applications", - "ec_op_builtin_applications", - "ecdsa_builtin_applications", - "bitwise_builtin_applications", - "keccak_builtin_applications", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "FEE_ESTIMATE": Schema { - title: Some( - "Fee estimation", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "gas_consumed": Schema { - title: Some( - "Gas consumed", - ), - description: Some( - "The Ethereum gas cost of the transaction (see https://docs.starknet.io/docs/Fees/fee-mechanism for more info)", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - "gas_price": Schema { - title: Some( - "Gas price", - ), - description: Some( - "The gas price (in gwei) that was used in the cost estimation", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - "overall_fee": Schema { - title: Some( - "Overall fee", - ), - description: Some( - "The estimated fee for the transaction (in gwei), product of gas_consumed and gas_price", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - }, - required: [ - "gas_consumed", - "gas_price", - "overall_fee", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "FELT": Schema { - title: Some( - "Field element", - ), - description: Some( - "A field element. represented by at most 63 hex digits", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "FUNCTION_ABI_ENTRY": Schema { - title: Some( - "Function ABI entry", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "inputs": Schema { - title: Some( - "Typed parameter", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TYPED_PARAMETER", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "name": Schema { - title: Some( - "Function name", - ), - description: Some( - "The function name", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "outputs": Schema { - title: Some( - "Typed parameter", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TYPED_PARAMETER", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "stateMutability": Schema { - title: Some( - "Function state mutability", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FUNCTION_STATE_MUTABILITY", - ), - }, - "type": Schema { - title: Some( - "Function ABI type", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FUNCTION_ABI_TYPE", - ), - }, - }, - required: [ - "type", - "name", - "inputs", - "outputs", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "FUNCTION_ABI_TYPE": Schema { - title: Some( - "Function ABI type", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "function", - "l1_handler", - "constructor", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "FUNCTION_CALL": Schema { - title: Some( - "Function call", - ), - description: Some( - "Function call information", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "calldata": Schema { - title: Some( - "Calldata", - ), - description: Some( - "The parameters passed to the function", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "contract_address": Schema { - title: Some( - "Contract address", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - "entry_point_selector": Schema { - title: Some( - "Entry point selector", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - required: [ - "contract_address", - "entry_point_selector", - "calldata", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "FUNCTION_STATE_MUTABILITY": Schema { - title: Some( - "Function state mutability type", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "view", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "INVOKE_TXN": Schema { - title: Some( - "Invoke transaction", - ), - description: Some( - "Initiate a transaction from an account", - ), - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Invoke transaction V0", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/INVOKE_TXN_V0", - ), - }, - Schema { - title: Some( - "Invoke transaction V1", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/INVOKE_TXN_V1", - ), - }, - ], - ), - ), - reference: None, - }, - "INVOKE_TXN_RECEIPT": Schema { - title: Some( - "Invoke Transaction Receipt", - ), - description: None, - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Type", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "type": Schema { - title: Some( - "Type", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "INVOKE", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "type", - ], - }, - ), - ), - complex: None, - reference: None, - }, - Schema { - title: Some( - "Common receipt properties", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/COMMON_RECEIPT_PROPERTIES", - ), - }, - ], - ), - ), - reference: None, - }, - "INVOKE_TXN_V0": Schema { - title: Some( - "Invoke transaction V0", - ), - description: Some( - "invokes a specific function in the desired contract (not necessarily an account)", - ), - simple: None, - complex: None, - reference: None, - }, - "INVOKE_TXN_V1": Schema { - title: Some( - "Invoke transaction V1", - ), - description: Some( - "initiates a transaction from a given account", - ), - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: None, - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "calldata": Schema { - title: Some( - "calldata", - ), - description: Some( - "The data expected by the account's `execute` function (in most usecases, this includes the called contract address and a function selector)", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "max_fee": Schema { - title: Some( - "Max fee", - ), - description: Some( - "The maximal fee that can be charged for including the transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "nonce": Schema { - title: Some( - "Nonce", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "sender_address": Schema { - title: Some( - "sender address", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - "signature": Schema { - title: Some( - "Signature", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/SIGNATURE", - ), - }, - "type": Schema { - title: Some( - "Type", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "INVOKE", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "version": Schema { - title: Some( - "Version", - ), - description: Some( - "Version of the transaction scheme", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - }, - required: [ - "type", - "sender_address", - "calldata", - "max_fee", - "version", - "signature", - "nonce", - ], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - "L1_HANDLER_TXN": Schema { - title: Some( - "L1 Handler transaction", - ), - description: None, - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "L1 handler transaction", - ), - description: Some( - "a call to an l1_handler on an L2 contract induced by a message from L1", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "nonce": Schema { - title: Some( - "Nonce", - ), - description: Some( - "The L1->L2 message nonce field of the SN Core L1 contract at the time the transaction was sent", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - "type": Schema { - title: Some( - "type", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "L1_HANDLER", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "version": Schema { - title: Some( - "Version", - ), - description: Some( - "Version of the transaction scheme", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - }, - required: [ - "version", - "type", - "nonce", - ], - }, - ), - ), - complex: None, - reference: None, - }, - Schema { - title: Some( - "Function call", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FUNCTION_CALL", - ), - }, - ], - ), - ), - reference: None, - }, - "L1_HANDLER_TXN_RECEIPT": Schema { - title: Some( - "L1 Handler Transaction Receipt", - ), - description: Some( - "receipt for l1 handler transaction", - ), - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Transaction type", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "message_hash": Schema { - title: Some( - "Message hash", - ), - description: Some( - "The message hash as it appears on the L1 core contract", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - "type": Schema { - title: Some( - "type", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "L1_HANDLER", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "type", - "message_hash", - ], - }, - ), - ), - complex: None, - reference: None, - }, - Schema { - title: Some( - "Common receipt properties", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/COMMON_RECEIPT_PROPERTIES", - ), - }, - ], - ), - ), - reference: None, - }, - "MSG_FROM_L1": Schema { - title: Some( - "Message from L1", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "entry_point_selector": Schema { - title: Some( - "Selector", - ), - description: Some( - "The selector of the l1_handler in invoke in the target contract", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "from_address": Schema { - title: None, - description: Some( - "The address of the L1 contract sending the message", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ETH_ADDRESS", - ), - }, - "payload": Schema { - title: Some( - "Payload", - ), - description: Some( - "The payload of the message", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "to_address": Schema { - title: Some( - "To address", - ), - description: Some( - "The target L2 address the message is sent to", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - }, - required: [ - "from_address", - "to_address", - "payload", - "entry_point_selector", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "MSG_TO_L1": Schema { - title: Some( - "Message to L1", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "from_address": Schema { - title: None, - description: Some( - "The address of the L2 contract sending the message", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "payload": Schema { - title: Some( - "Payload", - ), - description: Some( - "The payload of the message", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "to_address": Schema { - title: Some( - "To address", - ), - description: Some( - "The target L1 address the message is sent to", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - required: [ - "from_address", - "to_address", - "payload", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "NUM_AS_HEX": Schema { - title: Some( - "Number as hex", - ), - description: Some( - "An integer number in hex format (0x...)", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "PENDING_BLOCK_HEADER": Schema { - title: Some( - "Pending block header", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "l1_gas_price": Schema { - title: Some( - "L1 gas price", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/RESOURCE_PRICE", - ), - }, - "parent_hash": Schema { - title: Some( - "Parent hash", - ), - description: Some( - "The hash of this block's parent", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_HASH", - ), - }, - "sequencer_address": Schema { - title: Some( - "Sequencer address", - ), - description: Some( - "The StarkNet identity of the sequencer submitting this block", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "starknet_version": Schema { - title: Some( - "Starknet version", - ), - description: Some( - "Semver of the current Starknet protocol", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "timestamp": Schema { - title: Some( - "Timestamp", - ), - description: Some( - "The time in which the block was created, encoded in Unix time", - ), - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "parent_hash", - "timestamp", - "sequencer_address", - "l1_gas_price", - "starknet_version", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "PENDING_BLOCK_WITH_TXS": Schema { - title: Some( - "Pending block with transactions", - ), - description: Some( - "The dynamic block being constructed by the sequencer. Note that this object will be deprecated upon decentralization.", - ), - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Block body with transactions", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_BODY_WITH_TXS", - ), - }, - Schema { - title: Some( - "Pending block header", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/PENDING_BLOCK_HEADER", - ), - }, - ], - ), - ), - reference: None, - }, - "PENDING_BLOCK_WITH_TX_HASHES": Schema { - title: Some( - "Pending block with transaction hashes", - ), - description: Some( - "The dynamic block being constructed by the sequencer. Note that this object will be deprecated upon decentralization.", - ), - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Block body with transactions hashes", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_BODY_WITH_TX_HASHES", - ), - }, - Schema { - title: Some( - "Pending block header", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/PENDING_BLOCK_HEADER", - ), - }, - ], - ), - ), - reference: None, - }, - "PENDING_COMMON_RECEIPT_PROPERTIES": Schema { - title: Some( - "Pending common receipt properties", - ), - description: Some( - "Common properties for a pending transaction receipt", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "actual_fee": Schema { - title: Some( - "Actual fee", - ), - description: Some( - "The fee that was charged by the sequencer", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "events": Schema { - title: Some( - "Events", - ), - description: Some( - "The events emitted as part of this transaction", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/EVENT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "execution_resources": Schema { - title: Some( - "Execution resources", - ), - description: Some( - "The resources consumed by the transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/EXECUTION_RESOURCES", - ), - }, - "execution_status": Schema { - title: Some( - "Execution status", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_EXECUTION_STATUS", - ), - }, - "finality_status": Schema { - title: Some( - "Finality status", - ), - description: Some( - "The finality status of the transaction", - ), - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "ACCEPTED_ON_L2", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "messages_sent": Schema { - title: Some( - "Messages sent", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/MSG_TO_L1", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "revert_reason": Schema { - title: Some( - "Revert reason", - ), - description: Some( - "the revert reason for the failed execution", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "transaction_hash": Schema { - title: Some( - "Transaction hash", - ), - description: Some( - "The hash identifying the transaction", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_HASH", - ), - }, - "type": Schema { - title: Some( - "Transaction type", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TXN_TYPE", - ), - }, - }, - required: [ - "transaction_hash", - "actual_fee", - "type", - "messages_sent", - "events", - "finality_status", - "execution_status", - "execution_resources", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "PENDING_DECLARE_TXN_RECEIPT": Schema { - title: Some( - "Declare Transaction Receipt", - ), - description: None, - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Declare txn receipt", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "type": Schema { - title: Some( - "Declare", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "DECLARE", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "type", - ], - }, - ), - ), - complex: None, - reference: None, - }, - Schema { - title: Some( - "Common receipt properties", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/PENDING_COMMON_RECEIPT_PROPERTIES", - ), - }, - ], - ), - ), - reference: None, - }, - "PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT": Schema { - title: Some( - "Deploy Account Transaction Receipt", - ), - description: None, - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Common receipt properties", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/PENDING_COMMON_RECEIPT_PROPERTIES", - ), - }, - Schema { - title: Some( - "DeployAccount txn receipt", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "contract_address": Schema { - title: Some( - "Contract address", - ), - description: Some( - "The address of the deployed contract", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "type": Schema { - title: Some( - "Deploy account", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "DEPLOY_ACCOUNT", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "type", - "contract_address", - ], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - "PENDING_INVOKE_TXN_RECEIPT": Schema { - title: Some( - "Invoke Transaction Receipt", - ), - description: None, - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Type", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "type": Schema { - title: Some( - "Type", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "INVOKE", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "type", - ], - }, - ), - ), - complex: None, - reference: None, - }, - Schema { - title: Some( - "Common receipt properties", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/PENDING_COMMON_RECEIPT_PROPERTIES", - ), - }, - ], - ), - ), - reference: None, - }, - "PENDING_L1_HANDLER_TXN_RECEIPT": Schema { - title: Some( - "L1 Handler Transaction Receipt", - ), - description: Some( - "receipt for l1 handler transaction", - ), - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Transaction type", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "message_hash": Schema { - title: Some( - "Message hash", - ), - description: Some( - "The message hash as it appears on the L1 core contract", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - "type": Schema { - title: Some( - "type", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "L1_HANDLER", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "type", - "message_hash", - ], - }, - ), - ), - complex: None, - reference: None, - }, - Schema { - title: Some( - "Common receipt properties", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/PENDING_COMMON_RECEIPT_PROPERTIES", - ), - }, - ], - ), - ), - reference: None, - }, - "PENDING_STATE_UPDATE": Schema { - title: Some( - "Pending state update", - ), - description: Some( - "Pending state update", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "old_root": Schema { - title: Some( - "Old root", - ), - description: Some( - "The previous global state root", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "state_diff": Schema { - title: Some( - "State diff", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/STATE_DIFF", - ), - }, - }, - required: [ - "old_root", - "state_diff", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "PENDING_TXN_RECEIPT": Schema { - title: Some( - "Transaction Receipt", - ), - description: None, - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Pending Invoke transaction receipt", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/PENDING_INVOKE_TXN_RECEIPT", - ), - }, - Schema { - title: Some( - "Pending L1 handler transaction receipt", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/PENDING_L1_HANDLER_TXN_RECEIPT", - ), - }, - Schema { - title: Some( - "Pending Declare transaction receipt", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/PENDING_DECLARE_TXN_RECEIPT", - ), - }, - Schema { - title: Some( - "Pending Deploy account transaction receipt", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT", - ), - }, - ], - ), - ), - reference: None, - }, - "RESOURCE_LIMITS": Schema { - title: None, - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "max_amount": Schema { - title: Some( - "max amount", - ), - description: Some( - "the max amount of the resource that can be used in the tx", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - "max_price_per_unit": Schema { - title: Some( - "max price", - ), - description: Some( - "the max price per unit of this resource for this tx", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - }, - required: [ - "max_amount", - "max_price_per_unit", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "RESOURCE_PRICE": Schema { - title: None, - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "price_in_strk": Schema { - title: Some( - "price in strk", - ), - description: Some( - "the price of one unit of the given resource, denominated in strk", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - "price_in_wei": Schema { - title: Some( - "price in wei", - ), - description: Some( - "the price of one unit of the given resource, denominated in wei", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/NUM_AS_HEX", - ), - }, - }, - required: [ - "price_in_wei", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "RESULT_PAGE_REQUEST": Schema { - title: Some( - "Result page request", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "chunk_size": Schema { - title: Some( - "Chunk size", - ), - description: None, - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - "continuation_token": Schema { - title: Some( - "Continuation token", - ), - description: Some( - "The token returned from the previous query. If no token is provided the first page is returned.", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "chunk_size", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "SIERRA_ENTRY_POINT": Schema { - title: Some( - "Sierra entry point", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "function_idx": Schema { - title: Some( - "Function index", - ), - description: Some( - "The index of the function in the program", - ), - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - "selector": Schema { - title: Some( - "Selector", - ), - description: Some( - "A unique identifier of the entry point (function) in the program", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - required: [ - "selector", - "function_idx", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "SIGNATURE": Schema { - title: Some( - "Signature", - ), - description: Some( - "A transaction signature", - ), - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "STATE_DIFF": Schema { - title: None, - description: Some( - "The change in state applied in this block, given as a mapping of addresses to the new values and/or new contracts", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "declared_classes": Schema { - title: Some( - "Declared classes", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: Some( - "New classes", - ), - description: Some( - "The declared class hash and compiled class hash", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "class_hash": Schema { - title: Some( - "Class hash", - ), - description: Some( - "The hash of the declared class", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "compiled_class_hash": Schema { - title: Some( - "Compiled class hash", - ), - description: Some( - "The Cairo assembly hash corresponding to the declared class", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - required: [], - }, - ), - ), - complex: None, - reference: None, - }, - }, - ), - ), - complex: None, - reference: None, - }, - "deployed_contracts": Schema { - title: Some( - "Deployed contracts", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: Some( - "A new contract deployed as part of the state update", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DEPLOYED_CONTRACT_ITEM", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "deprecated_declared_classes": Schema { - title: Some( - "Deprecated declared classes", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: Some( - "The hash of the declared class", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "nonces": Schema { - title: Some( - "Nonces", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: Some( - "Nonce update", - ), - description: Some( - "The updated nonce per contract address", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "contract_address": Schema { - title: Some( - "Contract address", - ), - description: Some( - "The address of the contract", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - "nonce": Schema { - title: Some( - "Nonce", - ), - description: Some( - "The nonce for the given address at the end of the block", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - }, - required: [], - }, - ), - ), - complex: None, - reference: None, - }, - }, - ), - ), - complex: None, - reference: None, - }, - "replaced_classes": Schema { - title: Some( - "Replaced classes", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: Some( - "Replaced class", - ), - description: Some( - "The list of contracts whose class was replaced", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "class_hash": Schema { - title: Some( - "Class hash", - ), - description: Some( - "The new class hash", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "contract_address": Schema { - title: Some( - "Contract address", - ), - description: Some( - "The address of the contract whose class was replaced", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/ADDRESS", - ), - }, - }, - required: [], - }, - ), - ), - complex: None, - reference: None, - }, - }, - ), - ), - complex: None, - reference: None, - }, - "storage_diffs": Schema { - title: Some( - "Storage diffs", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: Some( - "The changes in the storage per contract address", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/CONTRACT_STORAGE_DIFF_ITEM", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "storage_diffs", - "deprecated_declared_classes", - "declared_classes", - "replaced_classes", - "deployed_contracts", - "nonces", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "STATE_UPDATE": Schema { - title: Some( - "State update", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "block_hash": Schema { - title: Some( - "Block hash", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_HASH", - ), - }, - "new_root": Schema { - title: Some( - "New root", - ), - description: Some( - "The new global state root", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "old_root": Schema { - title: Some( - "Old root", - ), - description: Some( - "The previous global state root", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "state_diff": Schema { - title: Some( - "State diff", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/STATE_DIFF", - ), - }, - }, - required: [ - "state_diff", - "block_hash", - "old_root", - "new_root", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "STORAGE_KEY": Schema { - title: Some( - "Storage key", - ), - description: Some( - "A storage key. Represented as up to 62 hex digits, 3 bits, and 5 leading zeroes.", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "STRUCT_ABI_ENTRY": Schema { - title: Some( - "Struct ABI entry", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "members": Schema { - title: Some( - "Members", - ), - description: None, - simple: Some( - Array( - ArrayConstraints { - items: Schema { - title: None, - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/STRUCT_MEMBER", - ), - }, - }, - ), - ), - complex: None, - reference: None, - }, - "name": Schema { - title: Some( - "Struct name", - ), - description: Some( - "The struct name", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "size": Schema { - title: Some( - "Size", - ), - description: None, - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - "type": Schema { - title: Some( - "Struct ABI type", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/STRUCT_ABI_TYPE", - ), - }, - }, - required: [ - "type", - "name", - "size", - "members", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "STRUCT_ABI_TYPE": Schema { - title: Some( - "Struct ABI type", - ), - description: None, - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "struct", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "STRUCT_MEMBER": Schema { - title: Some( - "Struct member", - ), - description: None, - simple: None, - complex: Some( - AllOf( - [ - Schema { - title: Some( - "Typed parameter", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/TYPED_PARAMETER", - ), - }, - Schema { - title: Some( - "Offset", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "offset": Schema { - title: Some( - "Offset", - ), - description: Some( - "offset of this property within the struct", - ), - simple: Some( - Integer( - IntegerConstraints, - ), - ), - complex: None, - reference: None, - }, - }, - required: [], - }, - ), - ), - complex: None, - reference: None, - }, - ], - ), - ), - reference: None, - }, - "SYNC_STATUS": Schema { - title: Some( - "Sync status", - ), - description: Some( - "An object describing the node synchronization status", - ), - simple: Some( - Object( - ObjectConstraints { - properties: { - "current_block_hash": Schema { - title: Some( - "Current block hash", - ), - description: Some( - "The hash of the current block being synchronized", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_HASH", - ), - }, - "current_block_num": Schema { - title: Some( - "Current block number", - ), - description: Some( - "The number (height) of the current block being synchronized", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_NUMBER", - ), - }, - "highest_block_hash": Schema { - title: Some( - "Highest block hash", - ), - description: Some( - "The hash of the estimated highest block to be synchronized", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_HASH", - ), - }, - "highest_block_num": Schema { - title: Some( - "Highest block number", - ), - description: Some( - "The number (height) of the estimated highest block to be synchronized", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_NUMBER", - ), - }, - "starting_block_hash": Schema { - title: Some( - "Starting block hash", - ), - description: Some( - "The hash of the block from which the sync started", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_HASH", - ), - }, - "starting_block_num": Schema { - title: Some( - "Starting block number", - ), - description: Some( - "The number (height) of the block from which the sync started", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/BLOCK_NUMBER", - ), - }, - }, - required: [ - "starting_block_hash", - "starting_block_num", - "current_block_hash", - "current_block_num", - "highest_block_hash", - "highest_block_num", - ], - }, - ), - ), - complex: None, - reference: None, - }, - "TXN": Schema { - title: Some( - "Transaction", - ), - description: Some( - "The transaction schema, as it appears inside a block", - ), - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Invoke transaction", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/INVOKE_TXN", - ), - }, - Schema { - title: Some( - "L1 handler transaction", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/L1_HANDLER_TXN", - ), - }, - Schema { - title: Some( - "Declare transaction", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DECLARE_TXN", - ), - }, - Schema { - title: Some( - "Deploy transaction", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DEPLOY_TXN", - ), - }, - Schema { - title: Some( - "Deploy account transaction", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DEPLOY_ACCOUNT_TXN", - ), - }, - ], - ), - ), - reference: None, - }, - "TXN_EXECUTION_STATUS": Schema { - title: Some( - "Execution status", - ), - description: Some( - "The execution status of the transaction", - ), - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "SUCCEEDED", - "REVERTED", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "TXN_FINALITY_STATUS": Schema { - title: Some( - "Finality status", - ), - description: Some( - "The finality status of the transaction", - ), - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "ACCEPTED_ON_L2", - "ACCEPTED_ON_L1", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "TXN_HASH": Schema { - title: Some( - "Transaction hash", - ), - description: Some( - "The transaction hash, as assigned in StarkNet", - ), - simple: None, - complex: None, - reference: Some( - "#/components/schemas/FELT", - ), - }, - "TXN_RECEIPT": Schema { - title: Some( - "Transaction Receipt", - ), - description: None, - simple: None, - complex: Some( - OneOf( - [ - Schema { - title: Some( - "Invoke transaction receipt", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/INVOKE_TXN_RECEIPT", - ), - }, - Schema { - title: Some( - "L1 handler transaction receipt", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/L1_HANDLER_TXN_RECEIPT", - ), - }, - Schema { - title: Some( - "Declare transaction receipt", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DECLARE_TXN_RECEIPT", - ), - }, - Schema { - title: Some( - "Deploy transaction receipt", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DEPLOY_TXN_RECEIPT", - ), - }, - Schema { - title: Some( - "Deploy account transaction receipt", - ), - description: None, - simple: None, - complex: None, - reference: Some( - "#/components/schemas/DEPLOY_ACCOUNT_TXN_RECEIPT", - ), - }, - ], - ), - ), - reference: None, - }, - "TXN_STATUS": Schema { - title: Some( - "Transaction status", - ), - description: Some( - "The finality status of the transaction, including the case the txn is still in the mempool or failed validation during the block construction phase", - ), - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "RECEIVED", - "REJECTED", - "ACCEPTED_ON_L2", - "ACCEPTED_ON_L1", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "TXN_TYPE": Schema { - title: Some( - "Transaction type", - ), - description: Some( - "The type of the transaction", - ), - simple: Some( - String( - StringConstraints { - enumeration: Some( - [ - "DECLARE", - "DEPLOY", - "DEPLOY_ACCOUNT", - "INVOKE", - "L1_HANDLER", - ], - ), - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "TYPED_PARAMETER": Schema { - title: Some( - "Typed parameter", - ), - description: None, - simple: Some( - Object( - ObjectConstraints { - properties: { - "name": Schema { - title: Some( - "Parameter name", - ), - description: Some( - "The parameter's name", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - "type": Schema { - title: Some( - "Parameter type", - ), - description: Some( - "The parameter's type", - ), - simple: Some( - String( - StringConstraints { - enumeration: None, - format: None, - }, - ), - ), - complex: None, - reference: None, - }, - }, - required: [ - "name", - "type", - ], - }, - ), - ), - complex: None, - reference: None, - }, - }, - errors: { - "BLOCK_NOT_FOUND": Error { - code: 24, - message: "Block not found", - }, - "CLASS_HASH_NOT_FOUND": Error { - code: 28, - message: "Class hash not found", - }, - "CONTRACT_ERROR": Error { - code: 40, - message: "Contract error", - }, - "CONTRACT_NOT_FOUND": Error { - code: 20, - message: "Contract not found", - }, - "FAILED_TO_RECEIVE_TXN": Error { - code: 1, - message: "Failed to write transaction", - }, - "INVALID_CONTINUATION_TOKEN": Error { - code: 33, - message: "The supplied continuation token is invalid or unknown", - }, - "INVALID_TXN_INDEX": Error { - code: 27, - message: "Invalid transaction index in a block", - }, - "NO_BLOCKS": Error { - code: 32, - message: "There are no blocks", - }, - "PAGE_SIZE_TOO_BIG": Error { - code: 31, - message: "Requested page size is too big", - }, - "TOO_MANY_KEYS_IN_FILTER": Error { - code: 34, - message: "Too many keys provided in a filter", - }, - "TXN_HASH_NOT_FOUND": Error { - code: 29, - message: "Transaction hash not found", - }, - }, - }, - ), -}